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

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

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

  • 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.apps/ovtk2

/**
 * Tries to get the most worthwhile identifier for the concept
 * 
 * @param c
 *            - concept
 * @return - some id (in order of decreasing preference: name, pid,
 *         description, concepts class+is)
 */
private static String getSomething(ONDEXConcept c) {
  if (c.getConceptName() != null) {
    return c.getConceptName().getName();
  }
  if (c.getPID() != null && c.getPID().equals("")) {
    return c.getPID();
  }
  if (c.getDescription() != null && c.getDescription().equals("")) {
    return c.getDescription();
  }
  return "[" + c.getOfType().getId() + " " + c.getId() + "]";
}
origin: net.sourceforge.ondex.core/tools

for (EvidenceType et : copySourceConcept.getEvidence()) {
  copyTargetConcept.addEvidenceType(et);
for (ConceptAccession acc : copySourceConcept.getConceptAccessions()) {
  copyTargetConcept.createConceptAccession(acc.getAccession(),
      acc.getElementOf(), true);
for (ConceptName name : copySourceConcept.getConceptNames()) {
  copyTargetConcept.createConceptName(name.getName(),
      name.isPreferred());
for (Attribute attribute : copySourceConcept.getAttributes()) {
  copyTargetConcept.createAttribute(attribute.getOfType(),
      attribute.getValue(), attribute.isDoIndex());
if (copySourceConcept.getAnnotation() != null)
  copyTargetConcept.setAnnotation(copySourceConcept.getAnnotation());
if (copySourceConcept.getDescription() != null)
  copyTargetConcept
      .setDescription(copySourceConcept.getDescription());
for (ONDEXConcept c : copySourceConcept.getTags())
  copyTargetConcept.addTag(c);
origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Clone concept with having a new PID.
 * 
 * @param oldC
 *            old ONDEXConcept
 * @param newPID
 *            new PID to use
 * @return new ONDEXConcept
 */
public ONDEXConcept clone(ONDEXConcept oldC, String newPID) {
  // first clone concept with new PID
  ONDEXConcept newC = graph.createConcept(newPID, oldC.getAnnotation(), oldC.getDescription(), oldC.getElementOf(), oldC.getOfType(), oldC.getEvidence());
  // copies everything else
  copyEverythingElse(oldC, newC);
  return newC;
}
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.apps/ovtk2

/**
 * Clone concept with having a new DataSource.
 * 
 * @param oldC
 *            old ONDEXConcept
 * @param newDataSource
 *            new DataSource to use
 * @return new ONDEXConcept
 */
public ONDEXConcept clone(ONDEXConcept oldC, DataSource newDataSource) {
  // first clone concept with new DataSource
  ONDEXConcept newC = graph.createConcept(oldC.getPID(), oldC.getAnnotation(), oldC.getDescription(), newDataSource, oldC.getOfType(), oldC.getEvidence());
  // copies everything else
  copyEverythingElse(oldC, newC);
  return newC;
}
origin: net.sourceforge.ondex.core/tools

/**
 * Copies all of the attributes from one concept to another (only if they do
 * not already exist at target)
 * 
 * @param from
 *            - concept to copy from
 * @param to
 *            - concept to copy to
 * @throws AccessDeniedException
 * @throws NullValueException
 * @throws EmptyStringException
 */
public static void copyConceptAttributes(ONDEXConcept from, ONDEXConcept to)
    throws NullValueException, AccessDeniedException,
    EmptyStringException {
  for (EvidenceType et : from.getEvidence())
    addNewEvidence(to, et);
  for (ConceptAccession ca : from.getConceptAccessions())
    addNewAccession(to, ca);
  for (ConceptName cn : from.getConceptNames())
    addNewName(to, cn);
  for (Attribute attribute : from.getAttributes())
    addNewAttribute(to, attribute);
  if (from.getAnnotation() != null && to.getDescription() == null)
    to.setAnnotation(from.getAnnotation());
  if (from.getDescription() != null && to.getDescription() == null)
    to.setDescription(from.getDescription());
}
origin: net.sourceforge.ondex.apps/ovtk2-experimental

public String getName(ONDEXConcept ac) {
  String label = "";
  // get first preferred name as label
  for (ConceptName cn : ac.getConceptNames()) {
    if (cn.isPreferred()) {
      label = cn.getName();
      break;
    }
  }
  // next try annotation
  if (label == null || label.trim().length() == 0) {
    label = ac.getAnnotation();
  }
  // next try description
  if (label == null || label.trim().length() == 0) {
    label = ac.getDescription();
  }
  // next try pid
  if (label == null || label.trim().length() == 0) {
    label = ac.getPID();
  }
  // last resort to concept id
  if (label == null || label.trim().length() == 0) {
    label = String.valueOf(ac.getId());
  }
  return label;
}
origin: net.sourceforge.ondex.modules/poplar

public int getOrCreateGeneID(String geneId) {
  if (poplarReg.containsGene(geneId)) {
    return poplarReg.getGene(geneId);
  } else {
    ONDEXConcept gene = og.getFactory().createConcept(geneId, dataSourcePHYTOZOME, ccGene, etIMPD);
    gene.createConceptAccession(geneId, dataSourcePHYTOZOME, false);
    gene.createConceptName(geneId, false);
    Integer ondexGeneId = gene.getId();
    gene.createAttribute(anTaxID, Parser.POPLAR_TAX_ID, false);
    poplarReg.addGene(geneId, ondexGeneId);
    return ondexGeneId;
  }
}
origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Clone concept with having a new ConceptClass.
 * 
 * @param oldC
 *            old ONDEXConcept
 * @param newCC
 *            new ConceptClass to use
 * @return new ONDEXConcept
 */
public ONDEXConcept clone(ONDEXConcept oldC, ConceptClass newCC) {
  // first clone concept with new ConceptClass
  ONDEXConcept newC = graph.createConcept(oldC.getPID(), oldC.getAnnotation(), oldC.getDescription(), oldC.getElementOf(), newCC, oldC.getEvidence());
  // copies everything else
  copyEverythingElse(oldC, newC);
  return newC;
}
origin: net.sourceforge.ondex.modules/cyjs_json

/**
 * Generate metadata for Context.
 * @param context
 *            A Context tag (from the Ondex API).
 * @return JSONObject
 *            JSONObject containing information about the Context tag.
 */
private JSONObject buildContext(ONDEXConcept context) {
 JSONObject contextJson= new JSONObject();
  contextJson.put(JSONAttributeNames.ID, context.getId());
 return contextJson;
}
origin: net.sourceforge.ondex.modules/rdf-export-2

  @Override
  public String getUri ( ONDEXConcept c, Map<String, Object> params )
  {
    String ns = Java2RdfUtils.getParam ( params, "instanceNamespace", NamespaceUtils.ns ( "bkr" ) );
    
    String ccPart = Optional
      .ofNullable ( c.getOfType () )
      .flatMap ( cc -> Optional.ofNullable ( cc.getId () ) )
      .orElse ( null );
    
    return OndexRDFUtils.iri ( ns, ccPart, c.getPID (), c.getId () );
  }                
}
origin: net.sourceforge.ondex.apps/ovtk2

/**
 * helper method to extract a usable concept name.
 * 
 * @param c
 *            a concept.
 * @return a usable name.
 */
private String extractName(ONDEXConcept c) {
  String str = "";
  if (c.getConceptName() != null)
    str = c.getConceptName().getName();
  if (str.trim().length() == 0)
    str = c.getPID();
  if (str.trim().length() == 0)
    str = c.getId() + "";
  return str;
}
origin: net.sourceforge.ondex.modules/legacy

@Override
public void nodeToConcept(AbstractNode node) {
  Publication pub = (Publication) node;
  if(StandardFunctions.nullChecker(pub.getUniqueId(), dataSourceBioC, ccPublication, etIMPD))
    return;
  ONDEXConcept concept = this.graph.getFactory().createConcept(pub.getUniqueId(), dataSourceBioC, ccPublication, etIMPD);
  
  if (pub.getPubMedId() != 0){
    concept.createConceptAccession(new String(pub.getPubMedId() + ""), dataSourceNLM, false);
  }
  if (pub.getTitle() != null &&  !pub.getTitle().equals("")){
    concept.createAttribute(attTitle, pub.getTitle(), false);
  }
  pub.setConcept(concept);
}
origin: net.sourceforge.ondex.core/lucene

@Override
public ConceptClass getOfType() {
  return parent.getOfType();
}
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-experimental

private void updateSelectedNodes() {
  selected.clear();
  OVTK2PropertiesAggregator viewer = OVTK2Desktop.getDesktopResources()
      .getSelectedViewer();
  if (viewer != null) {
    PickedState<ONDEXConcept> state = viewer.getVisualizationViewer()
        .getPickedVertexState();
    Set<ONDEXConcept> set = state.getPicked();
    for (ONDEXConcept node : set) {
      ONDEXConcept ac = node;
      selected.put(ac.getId() + ":" + ac.getPID(), ac.getId());
    }
  }
}
origin: net.sourceforge.ondex.modules/arabidopsis

private ONDEXConcept createGene(String geneid,
                String[] additionalIdsFrom,
                String conceptName) {
  ONDEXConcept gene = graph.getFactory()
      .createConcept(geneid, dataSource, cc_gene, eviType);
  createAccessions(additionalIdsFrom, gene);
  if (conceptName != null && !conceptName.equalsIgnoreCase("na")) {
    gene.createConceptName(conceptName.trim(), true);
  }
  gene.createAttribute(taxidAn, String.valueOf(3702), false);
  return gene;
}
origin: net.sourceforge.ondex.modules/cyc-pathwaydbs

@Override
public void nodeToConcept(AbstractNode node) {
  Reaction reaction = (Reaction) node;
  ONDEXConcept concept = graph.getFactory().createConcept(
      reaction.getUniqueId(), dataSourceAraC, ccReaction, etIMPD);
  if (reaction.getBalancedState() != null)
    concept.setAnnotation(reaction.getBalancedState());
  concept.createConceptName(constructFormula(reaction), false);
  if (reaction.getDeltaGo() != null) {
    concept.createAttribute(deltaGo, reaction.getDeltaGo(), false);
  }
  reaction.setConcept(concept);
}
origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Copies all accessions from old concept to new concept.
 * 
 * @param oldC
 *            old ONDEXConcept
 * @param newC
 *            new ONDEXConcept
 */
private void copyAccessions(ONDEXConcept oldC, ONDEXConcept newC) {
  // iterate over all old accessions
  for (ConceptAccession acc : oldC.getConceptAccessions()) {
    // clone old accession on new concept
    newC.createConceptAccession(acc.getAccession(), acc.getElementOf(), acc.isAmbiguous());
  }
}
origin: net.sourceforge.ondex.modules/arabidopsis

public ONDEXConcept lookupHormone(String id) {
  Holder h = lookupConcept(hormoneIndex, hormone, id);
  ONDEXConcept c = h.concept;
  if (h.isNew)
    c.createConceptName(id, true);
  return c;
}
net.sourceforge.ondex.coreONDEXConcept

Javadoc

This class represents a ONDEX Concept. It can have 0..* ConceptNames, 0.. ConceptAccessions and 0..* ConceptAttribute. ConceptNames, ConceptAccessions and ConceptAttribute can be added with the create*-methods.

Most used methods

  • 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.
  • getAttribute
  • 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.
  • getConceptName,
  • getAnnotation,
  • addTag,
  • getDescription,
  • getAttributes,
  • getTags,
  • getEvidence,
  • setAnnotation,
  • getConceptAccession,
  • setDescription

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
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