Tabnine Logo
ONDEXConcept.createConceptAccession
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: net.sourceforge.ondex.modules/arabidopsis

public ONDEXConcept lookupPublication(String id) {
  Holder h = lookupConcept(pubIndex, publication, id);
  ONDEXConcept c = h.concept;
  if (h.isNew)
    c.createConceptAccession(id, pmid, false);
  return c;
}
origin: net.sourceforge.ondex.core/base

public synchronized ConceptAccession getAccession ( String accession, DataSource dataSrc, boolean isAmbiguous, ONDEXConcept concept )
{
  // TODO: is the ID unique? Is it concept-unique? 
  return this.cacheGet ( 
    ConceptAccession.class, accession,
    () -> concept.createConceptAccession ( accession, dataSrc, isAmbiguous )
  );        
}

origin: net.sourceforge.ondex.modules/sbml

private void assignAccessions(ONDEXConcept c, Set<String> accs) {
  for (String acc : accs) {
    String[] split = dataSourceLookup.recognize(acc);
    if (split != null) {
      String cvStr = split[0], value = split[1];
      DataSource dataSource = dataSourceLookup.get(cvStr);
      if (dataSource != null) {
        c.createConceptAccession(value, dataSource, false);
      }
    } else {
      unmatchedKeys.add(acc);
    }
  }
}
origin: net.sourceforge.ondex.modules/sbml

private void assignAccessions(ONDEXConcept c, Set<String> accs) {
  for (String acc : accs) {
    String[] split = dataSourceLookup.recognize(acc);
    if (split != null) {
      String cvStr = split[0], value = split[1];
      DataSource dataSource = dataSourceLookup.get(cvStr);
      if (dataSource != null) {
        c.createConceptAccession(value, dataSource, false);
      }
    } else {
      unmatchedKeys.add(acc);
    }
  }
}
origin: net.sourceforge.ondex.modules/carbs

  /**
   * Creates the corresponding ONDEXConcept on the given graph.
   * 
   * @return created publication ONDEXConcept
   */
  public ONDEXConcept createONDEXConcept(int index) {

    if (!taxids[index].isEmpty()) {
      ONDEXConcept c = graph.getFactory().createConcept(taxids[index], dataSource, cc, et);

      // publication associated Attribute
      c.createAttribute(taxidAttributeName, taxids[index], false);
      c.createConceptAccession(taxids[index], external, false);
      
      return c;
    }
    else { throw new RuntimeException("Organism without valid taxid tag!"); } 
  }
}
origin: net.sourceforge.ondex.modules/chemical

/**
 * Extracts all target information and creats a new Ondex concept
 * 
 * @param eElement
 * @return
 */
private ONDEXConcept createTarget(Element eElement) {
  // check for existing targets
  String key = getTagValue("target__chemblid", eElement);
  if (!targets.containsKey(key)) {
    // new target concept
    ONDEXConcept c = graph.getFactory().createConcept(key, dsCHEMBL,
        ccTarget, evidencetype);
    c.createConceptName(getTagValue("target__name", eElement), true);
    c.createConceptAccession(key, dsTARGET, false);
    targets.put(key, c);
  }
  return targets.get(key);
}
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/cyc-pathwaydbs

@Override
public void nodeToConcept(AbstractNode node) {
  Protein protein = (Protein) node;
  ConceptClass cc = null;
  if (protein.isComplex())
    cc = ccProteinComplex;
  else
    cc = ccProtein;
  ONDEXConcept concept = graph.getFactory().createConcept(protein.getUniqueId(), dataSourceAraC,
      cc, etIMPD);
  
  concept.createAttribute( attTaxId, MetaData.TAXID, false);
  int monomerPos = protein.getUniqueId().indexOf("-MONOMER");
  if (monomerPos != -1){
    concept.createConceptAccession(protein.getUniqueId().subSequence(0, monomerPos).toString(), super.dataSourceTAIR, true);
    String nameWithoutMonomer = protein.getUniqueId().subSequence(0, monomerPos).toString();
    if ( !protein.getSynonym().contains(nameWithoutMonomer))
      concept.createConceptName(nameWithoutMonomer,false );
  }
  protein.setConcept(concept);
}
origin: net.sourceforge.ondex.apps/ovtk2

public static void correctUniprotAccession(OVTK2PropertiesAggregator viewer) {
  ONDEXGraph graph = viewer.getONDEXJUNGGraph();
  ConceptClass prot = graph.getMetaData().getConceptClass("Protein");
  DataSource nc_np = graph.getMetaData().getDataSource("NC_NP");
  for (ONDEXConcept p : graph.getConceptsOfConceptClass(prot)) {
    List<String> newAcc = new ArrayList<String>();
    for (ConceptAccession ca : p.getConceptAccessions()) {
      if (ca.getElementOf().equals(nc_np)) {
        if (ca.getAccession().contains(".")) {
          newAcc.add(ca.getAccession().split("\\.")[0]);
        }
      }
    }
    for (String str : newAcc) {
      p.createConceptAccession(str, nc_np, true);
    }
  }
}
origin: net.sourceforge.ondex.modules/cyc-pathwaydbs

@Override
public void nodeToConcept(AbstractNode node) {
  ECNumber ecNumber = (ECNumber) node;
  ONDEXConcept concept = graph.getFactory().createConcept(ecNumber.getUniqueId(), dataSourceMetaC,
      ccEC, etIMPD);
  concept.createConceptAccession(ecNumber.getUniqueId(), dataSourceEC, false);
  ecNumber.setConcept(concept);    
}
origin: net.sourceforge.ondex.modules/cyc-pathwaydbs

@Override
public void nodeToConcept(AbstractNode node) {
  ECNumber ecNumber = (ECNumber) node;
  ONDEXConcept concept = graph.getFactory().createConcept(ecNumber.getUniqueId(), dataSourceAraC,
      ccEC, etIMPD);
  concept.createConceptAccession(ecNumber.getUniqueId(), dataSourceEC, false);
  ecNumber.setConcept(concept);    
}
origin: net.sourceforge.ondex.modules/cyc-pathwaydbs

@Override
public void nodeToConcept(AbstractNode node) {
  ECNumber ecNumber = (ECNumber) node;
  ONDEXConcept concept = graph.getFactory().createConcept(ecNumber.getUniqueId(), dataSourceMetaC,
      ccEC, etIMPD);
  concept.createConceptAccession(ecNumber.getUniqueId(), dataSourceEC, false);
  ecNumber.setConcept(concept);    
}
origin: net.sourceforge.ondex.modules/legacy

@Override
public void nodeToConcept(AbstractNode node) {
  ECNumber ecNumber = (ECNumber) node;
  ONDEXConcept concept = graph.getFactory().createConcept(ecNumber.getUniqueId(), dataSourceBioC,
      ccEC, etIMPD);
  concept.createConceptAccession(ecNumber.getUniqueId(), dataSourceEC, false);
  ecNumber.setConcept(concept);    
}
origin: net.sourceforge.ondex.apps/ovtk2

  @Override
  public void actionPerformed(ActionEvent e) {
    this.setVisible(false);
    editor.acc.setAmbiguous(box.isSelected());

    // has the DataSource of accession changed?
    DataSource dataSource = (DataSource) selection.getSelectedItem();
    if (!editor.acc.getElementOf().equals(dataSource)) {
      // delete old one
      ConceptAccession old = editor.concept.getConceptAccession(editor.acc.getAccession(), editor.acc.getElementOf());
      editor.concept.deleteConceptAccession(editor.acc.getAccession(), editor.acc.getElementOf());
      // create one with new DataSource
      editor.acc = editor.concept.createConceptAccession(old.getAccession(), dataSource, old.isAmbiguous());
    }
  }
}
origin: net.sourceforge.ondex.core/tools

/**
 * Creates an accession on concept only if it does not already exists
 * 
 * @param target
 *            - relation
 * @param newAcc
 *            - attribute to create
 * @throws AccessDeniedException
 * @throws EmptyStringException
 * @throws NullValueException
 */
public static void addNewAccession(ONDEXConcept target,
    ConceptAccession newAcc) throws NullValueException,
    EmptyStringException, AccessDeniedException {
  if (target.getConceptAccession(newAcc.getAccession(),
      newAcc.getElementOf()) == null)
    target.createConceptAccession(newAcc.getAccession(),
        newAcc.getElementOf(), true);
}
origin: net.sourceforge.ondex.modules/cyc-pathwaydbs

@Override
public void nodeToConcept(AbstractNode node) {
  Publication pub = (Publication) node;
  if(StandardFunctions.nullChecker(pub.getUniqueId(), dataSourceMetaC, ccPublication, etIMPD))
    return;
  ONDEXConcept concept = this.graph.getFactory().createConcept(pub.getUniqueId(), dataSourceMetaC, 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.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.modules/cyc-pathwaydbs

@Override
public void nodeToConcept(AbstractNode node) {
  Publication pub = (Publication) node;
  if(StandardFunctions.nullChecker(pub.getUniqueId(), dataSourceAraC, ccPublication, etIMPD))
    return;
  ONDEXConcept concept = this.graph.getFactory().createConcept(pub.getUniqueId(), dataSourceAraC, 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.modules/cyc-pathwaydbs

@Override
public void nodeToConcept(AbstractNode node) {
  Publication pub = (Publication) node;
  if(StandardFunctions.nullChecker(pub.getUniqueId(), dataSourceMetaC, ccPublication, etIMPD))
    return;
  ONDEXConcept concept = this.graph.getFactory().createConcept(pub.getUniqueId(), dataSourceMetaC, 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.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;
  }
}
net.sourceforge.ondex.coreONDEXConceptcreateConceptAccession

Javadoc

Creates a new ConceptAccession with the given accession, the information which DataSource it belongs to and if its accession is ambiguous. Then adds the new ConceptAccession to the list of ConceptAccessions of this AbstractConcept.

Popular methods of ONDEXConcept

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

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JButton (javax.swing)
  • Join (org.hibernate.mapping)
  • Table (org.hibernate.mapping)
    A relational table
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now