Search in sources :

Example 6 with RelationshipXref

use of org.vcell.pathway.RelationshipXref in project vcell by virtualcell.

the class AnnotationMapping method getXrefs.

private ArrayList<Xref> getXrefs(BioModel bioModel, HashMap<String, String> refInfo) {
    ArrayList<Xref> xRef = new ArrayList<Xref>();
    for (String id : refInfo.keySet()) {
        String[] temp = (refInfo.get(id)).split(":");
        String db = temp[0];
        String type = temp[1];
        if (db.toUpperCase().contains("OBO.GO")) {
            db = "GENE_ONTOLOGY";
            id = id.split(":")[1];
        }
        String refId = db + "_" + id;
        Xref xref = (Xref) bioModel.getPathwayModel().findBioPaxObject(refId);
        if (xref == null) {
            if (type.toLowerCase().contains("described")) {
                xref = new PublicationXref();
            } else if (type.toLowerCase().contains("homolog") || db.toUpperCase().contains("TAXONOMY")) {
                xref = new RelationshipXref();
            } else {
                xref = new UnificationXref();
            }
            xref.setId(id);
            xref.setDb(db.toUpperCase());
            xref.setID(refId);
        }
        xRef.add(xref);
    }
    return xRef;
}
Also used : Xref(org.vcell.pathway.Xref) UnificationXref(org.vcell.pathway.UnificationXref) RelationshipXref(org.vcell.pathway.RelationshipXref) PublicationXref(org.vcell.pathway.PublicationXref) PublicationXref(org.vcell.pathway.PublicationXref) UnificationXref(org.vcell.pathway.UnificationXref) ArrayList(java.util.ArrayList) RelationshipXref(org.vcell.pathway.RelationshipXref)

Example 7 with RelationshipXref

use of org.vcell.pathway.RelationshipXref in project vcell by virtualcell.

the class PathwayReader method addObjectRelationshipXref.

private RelationshipXref addObjectRelationshipXref(Element element) {
    RelationshipXref relationshipXref = new RelationshipXref();
    addAttributes(relationshipXref, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentRelationshipXref(relationshipXref, element, childElement)) {
                showUnexpected(childElement, relationshipXref);
            }
        }
    }
    pathwayModel.add(relationshipXref);
    return relationshipXref;
}
Also used : Element(org.jdom.Element) BioPaxObject(org.vcell.pathway.BioPaxObject) RelationshipXref(org.vcell.pathway.RelationshipXref)

Aggregations

RelationshipXref (org.vcell.pathway.RelationshipXref)7 Element (org.jdom.Element)5 BioPaxObject (org.vcell.pathway.BioPaxObject)5 PublicationXref (org.vcell.pathway.PublicationXref)4 UnificationXref (org.vcell.pathway.UnificationXref)4 Xref (org.vcell.pathway.Xref)4 GroupObject (org.vcell.pathway.GroupObject)3 ArrayList (java.util.ArrayList)2 Namespace (org.jdom.Namespace)2 XrefProxy (org.vcell.pathway.persistence.BiopaxProxy.XrefProxy)2 BioModelEntityObject (cbit.vcell.model.BioModelEntityObject)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1 CellularLocationVocabulary (org.vcell.pathway.CellularLocationVocabulary)1 Complex (org.vcell.pathway.Complex)1 Control (org.vcell.pathway.Control)1 Dna (org.vcell.pathway.Dna)1 DnaRegion (org.vcell.pathway.DnaRegion)1 Entity (org.vcell.pathway.Entity)1