/** * Searches for the shortest name of the PhysicalEntity. * @param spe entity to search in * @return the shortest name */ private String getShortestName(SimplePhysicalEntity spe) { String name = null; for (String s : spe.getName()) { if (name == null || s.length() > name.length()) name = s; } EntityReference er = spe.getEntityReference(); if (er != null) { for (String s : er.getName()) { if (name == null || s.length() > name.length()) name = s; } } return name; }
writer.write(sChange.getConv().getName().toString()); writer.write("\t"); writer.write(er.getName().toString()); writer.write("\t"); writer.write(er.getXref().toString());
private org.opencb.bionetdb.core.models.Dna createDna(BioPAXElement bioPAXElement) { org.opencb.bionetdb.core.models.Dna dna = new org.opencb.bionetdb.core.models.Dna(); Dna dnaBP = (Dna) bioPAXElement; // Common properties setPhysicalEntityCommonProperties(dnaBP, dna); // Dna properties if (dnaBP.getEntityReference() != null) { EntityReference entityReference = dnaBP.getEntityReference(); // altIds for (String name : entityReference.getName()) { org.opencb.bionetdb.core.models.Xref xref = new org.opencb.bionetdb.core.models.Xref(); xref.setSource(REACTOME_FEAT + "biopax"); xref.setId(name); dna.setXref(xref); } // description dna.setDescription(new ArrayList<>(entityReference.getComment())); // xref Set<Xref> xrefs = entityReference.getXref(); for (Xref xref : xrefs) { org.opencb.bionetdb.core.models.Xref x = new org.opencb.bionetdb.core.models.Xref(); x.setSource(xref.getDb()); x.setSourceVersion(xref.getDbVersion()); x.setId(xref.getId()); x.setIdVersion(xref.getIdVersion()); dna.setXref(x); } } return dna; }
private org.opencb.bionetdb.core.models.Protein createProtein(BioPAXElement bioPAXElement) { org.opencb.bionetdb.core.models.Protein protein = new org.opencb.bionetdb.core.models.Protein(); Protein proteinBP = (Protein) bioPAXElement; // Common properties setPhysicalEntityCommonProperties(proteinBP, protein); // Protein properties if (proteinBP.getEntityReference() != null) { EntityReference entityReference = proteinBP.getEntityReference(); // altIds for (String name : entityReference.getName()) { org.opencb.bionetdb.core.models.Xref xref = new org.opencb.bionetdb.core.models.Xref(); xref.setSource(REACTOME_FEAT + "biopax"); xref.setId(name); protein.setXref(xref); } // description protein.setDescription(new ArrayList<>(entityReference.getComment())); // xref Set<Xref> xrefs = entityReference.getXref(); for (Xref xref : xrefs) { org.opencb.bionetdb.core.models.Xref x = new org.opencb.bionetdb.core.models.Xref(); x.setSource(xref.getDb()); x.setSourceVersion(xref.getDbVersion()); x.setId(xref.getId()); x.setIdVersion(xref.getIdVersion()); protein.setXref(x); } } return protein; }
private org.opencb.bionetdb.core.models.Rna createRna(BioPAXElement bioPAXElement) { org.opencb.bionetdb.core.models.Rna rna = new org.opencb.bionetdb.core.models.Rna(); Rna rnaBP = (Rna) bioPAXElement; // Common properties setPhysicalEntityCommonProperties(rnaBP, rna); // Rna properties if (rnaBP.getEntityReference() != null) { EntityReference entityReference = rnaBP.getEntityReference(); // altIds for (String name : entityReference.getName()) { org.opencb.bionetdb.core.models.Xref xref = new org.opencb.bionetdb.core.models.Xref(); xref.setSource(REACTOME_FEAT + "biopax"); xref.setId(name); rna.setXref(xref); } // description rna.setDescription(new ArrayList<>(entityReference.getComment())); // xref Set<Xref> xrefs = entityReference.getXref(); for (Xref xref : xrefs) { org.opencb.bionetdb.core.models.Xref x = new org.opencb.bionetdb.core.models.Xref(); x.setSource(xref.getDb()); x.setSourceVersion(xref.getDbVersion()); x.setId(xref.getId()); x.setIdVersion(xref.getIdVersion()); rna.setXref(x); } } return rna; }
for (String name : entityReference.getName()) { org.opencb.bionetdb.core.models.Xref xref = new org.opencb.bionetdb.core.models.Xref(); xref.setSource(REACTOME_FEAT + "biopax");