Codota Logo
ONDEXConcept.getAttribute
Code IndexAdd Codota to your IDE (free)

How to use
getAttribute
method
in
net.sourceforge.ondex.core.ONDEXConcept

Best Java code snippets using net.sourceforge.ondex.core.ONDEXConcept.getAttribute (Showing top 20 results out of 315)

  • Common ways to obtain ONDEXConcept
private void myMethod () {
ONDEXConcept o =
  • Codota IconONDEXRelation r;r.getToConcept()
  • Codota IconONDEXRelation r;r.getFromConcept()
  • Codota IconONDEXGraph graph;graph.getConcept(id)
  • Smart code suggestions by Codota
}
origin: net.sourceforge.ondex.core/lucene

@Override
public Attribute getAttribute(AttributeName attrname)
    throws NullValueException {
  return parent.getAttribute(attrname);
}
origin: net.sourceforge.ondex.apps/ovtk2

@Override
protected void doAction() {
  // set flagged attribute to false on all concepts
  for (ONDEXConcept c : entities) {
    if (c.getAttribute(anFlag) != null)
      c.getAttribute(anFlag).setValue(Boolean.FALSE);
  }
}
origin: net.sourceforge.ondex.apps/ovtk2

@Override
public boolean accepts() {
  boolean found = false;
  for (ONDEXConcept c : entities) {
    // at least one concept flagged
    if (c.getAttribute(anFlag) != null && c.getAttribute(anFlag).getValue().equals(Boolean.TRUE)) {
      found = true;
      break;
    }
  }
  return found;
}
origin: net.sourceforge.ondex.apps/ovtk2

@Override
public boolean accepts() {
  boolean found = true;
  for (ONDEXConcept c : entities) {
    // at least one concept not flagged
    if (c.getAttribute(anFlag) == null) {
      found = false;
      break;
    } else if (c.getAttribute(anFlag).getValue().equals(Boolean.FALSE)) {
      found = false;
      break;
    }
  }
  return !found;
}
origin: net.sourceforge.ondex.modules/generic

  private final boolean isInTargetPlain(ONDEXConcept possibleTarget, AttributeName an, Object id) {
    Attribute attribute = possibleTarget.getAttribute(an);
    if (attribute == null)
      return false;
    if (!attribute.getValue().equals(id))
      return false;
    return true;
  }
}
origin: net.sourceforge.ondex.apps/ovtk2

private static final void getGDSValues(Collection<ONDEXConcept> cs, AttributeName att, Set set) {
  for (ONDEXConcept c : cs) {
    Attribute attribute = c.getAttribute(att);
    if (attribute != null) {
      set.add(attribute.getValue());
    }
  }
}
origin: net.sourceforge.ondex.apps/ovtk2

@Override
protected void doAction() {
  // set flagged attribute to true on all concepts
  for (ONDEXConcept c : entities) {
    if (c.getAttribute(anFlag) == null) {
      c.createAttribute(anFlag, Boolean.TRUE, false);
    } else {
      c.getAttribute(anFlag).setValue(Boolean.TRUE);
    }
  }
}
origin: net.sourceforge.ondex.core/algorithms

@Override
public boolean isValid(ONDEXConcept c, EvidencePathNode<ONDEXConcept, ONDEXRelation, State> path) {
  Attribute attribute = c.getAttribute(att);
  if (attribute == null) {
    if (ignoreConceptWithoutAttribute) {
      return false;
    } else {
      return true;
    }
  }
  Object value = attribute.getValue();
  int result = Arrays.binarySearch(referenceValues, value);
  if (includeMatching) return result > -1;
  else return result == -1;
}
origin: net.sourceforge.ondex.apps/ovtk2-poplar

  @Override
  public int compare(ONDEXConcept o1, ONDEXConcept o2) {
    Attribute attribute1 = o1.getAttribute(an);
    Attribute attribute2 = o2.getAttribute(an);
    // both concepts must have a Attribute of the same type
    if (attribute1 != null && attribute2 != null) {
      Object v1 = attribute1.getValue();
      Object v2 = attribute2.getValue();
      // and it has to be a Number
      if (Number.class.isAssignableFrom(v1.getClass())
          && Number.class.isAssignableFrom(v2.getClass())) {
        Number n1 = (Number) v1;
        Number n2 = (Number) v2;
        // this decides increasing / decreasing order
        return n1.intValue() - n2.intValue();
      }
    }
    return 0;
  }
}
origin: net.sourceforge.ondex.apps/ovtk2

  @Override
  public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting())
      return;
    int index = list.getSelectedIndex();
    if (index > -1) {
      goButton.setEnabled(true);
      AttributeName attNameName = graph.getMetaData().getAttributeName(((JLabel) list.getModel().getElementAt(index)).getName());
      Set<String> attValues = new HashSet<String>();
      for (ONDEXConcept c : graph.getConceptsOfAttributeName(attNameName))
        attValues.add(c.getAttribute(attNameName).getValue().toString());
      text.setText("");
      for (String value : attValues) {
        text.append(value + "\n");
      }
    }
  }
}
origin: net.sourceforge.ondex.apps/ovtk2

  @Override
  public Font transform(ONDEXConcept n) {
    ONDEXConcept c = graph.getConcept(n.getId());
    Attribute attribute = c.getAttribute(an);
    if (attribute != null) {
      Float size = (float) (((Double) attribute.getValue() / (Double) gdsMax) * (maxSize - minSize) + minSize);
      return newFont.deriveFont(size);
    }
    return newFont;
  }
});
origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Sets attribute name to extract values from.
 * 
 * @param an
 *            AttributeName
 */
public Histogram(AttributeName an) {
  for (ONDEXConcept c : graph.getConceptsOfAttributeName(an)) {
    Attribute attribute = c.getAttribute(an);
    values.put(c, (Number) attribute.getValue());
  }
  doBins();
}
origin: net.sourceforge.ondex.apps/ovtk2-default

/**
 * Annotates the nodes according to specified values.
 * 
 * @param map
 *            Map<ONDEXConcept, Double>
 */
private void annotateNodes(Map<ONDEXConcept, Double> map) {
  AttributeName an = graph.getMetaData().getFactory()
      .createAttributeName("Betweenness_centrality", Double.class);
  // scale node size according to percentage
  for (ONDEXConcept c : map.keySet()) {
    Double percentBase = map.get(c);
    if (c.getAttribute(an) == null)
      c.createAttribute(an, percentBase, false);
    else
      c.getAttribute(an).setValue(percentBase);
  }
}
origin: net.sourceforge.ondex.apps/ovtk2

/**
 * @see AbstractContentDisplayPlugin.compileContent()
 */
@Override
public String compileContent(ONDEXEntity e) {
  if (an != null) {
    StringBuffer b = new StringBuffer("");
    if (e instanceof ONDEXConcept) {
      ONDEXConcept c = (ONDEXConcept) e;
      Attribute attribute = c.getAttribute(an);
      displayStructure(b, attribute);
    } else if (e instanceof ONDEXRelation) {
      ONDEXRelation r = (ONDEXRelation) e;
      Attribute attribute = r.getAttribute(an);
      displayStructure(b, attribute);
    }
    return b.toString();
  } else
    return "";
}
origin: net.sourceforge.ondex.modules/decypher

/**
 * Adds a sequence to the fasta styled database
 *
 * @param b       - BufferedWriter
 * @param concept - to store concept
 * @return if the entry was really added (could be false if the
 *         <code>IGNORE_PFAM_ANNOTATION_ARG</code> argument was changed
 * @throws IOException
 */
private boolean addEntryToFastaDatabase(BufferedWriter b,
                    ONDEXConcept concept, ONDEXGraph graph)
    throws IOException, InvalidPluginArgumentException {
  if (concept.getAttribute(atSource) == null
      || ((Boolean) super.args
      .getUniqueValue(ArgumentNames.IGNORE_PFAM_ANNOTATION_ARG) == false && this
      .hasPfamInformationAttached(concept
          .getConceptAccessions(), graph)))
    return false;
  Integer id = concept.getId();
  String sequence = (String) concept.getAttribute(atSource).getValue();
  b.write(">" + id + "\n" + sequence + "\n");
  // writtenProteins.put(id, concept);
  return true;
}
origin: net.sourceforge.ondex.apps/ovtk2-experimental

@Override
public boolean accepts() {
  ONDEXGraph graph = viewer.getONDEXJUNGGraph();
  // ConceptClass ccProtein =
  // graph.getMetaData().getConceptClass("Protein");
  AttributeName an = graph.getMetaData().getAttributeName("AA");
  if (an != null) {
    int i = 0;
    for (ONDEXConcept c : entities) {
      if (c.getAttribute(an) != null)
        i++;
      // at least two proteins with AA
      if (i > 1)
        return true;
    }
  }
  return false;
}
origin: net.sourceforge.ondex.modules/arabidopsis

  public void parseLine(String[] data) throws FileNotFoundException, IOException {
    ONDEXConcept protein = lookup.lookupProtein(data[1], data[2]);
    ONDEXConcept mut = lookup.lookupMutatant(data[4]);
    if (data.length > 5 && mut.getAttribute(description) == null) {
      mut.createAttribute(description, data[5], false);
    }
    ONDEXRelation rr = createRealtion(protein, mut, r);
    createHormoneContext(data[3], rr, protein, mut);
  }
});
origin: net.sourceforge.ondex.apps/ovtk2-poplar

@Override
public int compare(IntegerStringWrapper o1, IntegerStringWrapper o2) {
  Integer c1 = null;
  if (graph.getConcept(o1.getValue()).getOfType()
      .equals(ccChromosome))
    c1 = (Integer) graph.getConcept(o1.getValue())
        .getAttribute(anChromosome).getValue();
  else
    c1 = (Integer) graph.getConcept(o1.getValue())
        .getAttribute(anScaffold).getValue();
  Integer c2 = null;
  if (graph.getConcept(o2.getValue()).getOfType()
      .equals(ccChromosome))
    c2 = (Integer) graph.getConcept(o2.getValue())
        .getAttribute(anChromosome).getValue();
  else
    c2 = (Integer) graph.getConcept(o2.getValue())
        .getAttribute(anScaffold).getValue();
  return c1.compareTo(c2);
}
origin: net.sourceforge.ondex.core/tools

/**
 * Creates a gds on concept only if it does not already exists
 * 
 * @param target
 *            - relation
 * @param newAttribute
 *            - attribute to create
 * @throws AccessDeniedException
 * @throws NullValueException
 */
public static void addNewAttribute(ONDEXConcept target,
    Attribute newAttribute) throws NullValueException,
    AccessDeniedException {
  if (target.getAttribute(newAttribute.getOfType()) == null)
    target.createAttribute(newAttribute.getOfType(),
        newAttribute.getValue(), newAttribute.isDoIndex());
}
origin: net.sourceforge.ondex.core/tools

public static void changeAttributeValue(ONDEXEntity e, AttributeName n,
    Object value) {
  if (e instanceof ONDEXConcept) {
    ONDEXConcept c = (ONDEXConcept) e;
    boolean doIndex = c.getAttribute(n).isDoIndex();
    c.deleteAttribute(n);
    c.createAttribute(n, value, doIndex);
  }
  if (e instanceof ONDEXRelation) {
    ONDEXRelation r = (ONDEXRelation) e;
    boolean doIndex = r.getAttribute(n).isDoIndex();
    r.deleteAttribute(n);
    r.createAttribute(n, value, doIndex);
  } else {
    throw new IllegalArgumentException(
        "This method only works with Ondex concepts and relations.");
  }
}
net.sourceforge.ondex.coreONDEXConceptgetAttribute

Popular methods of ONDEXConcept

  • getId
  • createAttribute
  • createConceptAccession
    Creates a new ConceptAccession with the given accession, the information which DataSource it belongs
  • createConceptName
    Creates a new ConceptName with the given name and the information if this name is preferred. Then ad
  • getOfType
  • getConceptAccessions
  • getElementOf
    Returns the DataSource, which this AbstractConcept belongs to.
  • getPID
    Returns the parser id of this instance of AbstractConcept.
  • getConceptNames
    Returns all ConceptNames contained in the list of ConceptNames.
  • getConceptName
    Returns a ConceptName or null if unsuccessful for a given name or null if unsuccessful.
  • getAnnotation
    Returns the annotation of this instance of AbstractConcept.
  • addTag
  • getAnnotation,
  • addTag,
  • getDescription,
  • getAttributes,
  • getTags,
  • getEvidence,
  • setAnnotation,
  • getConceptAccession,
  • setDescription

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now