Search in sources :

Example 6 with PublicationXref

use of org.vcell.pathway.PublicationXref 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 PublicationXref

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

the class PathwayProducerBiopax3 method addContentPublicationXref.

private Element addContentPublicationXref(BioPaxObject bpObject, Element element) {
    element = addContentXref(bpObject, element);
    PublicationXref ob = (PublicationXref) bpObject;
    Element tmpElement = null;
    if (ob.getAuthor() != null && ob.getAuthor().size() > 0) {
        ArrayList<String> list = ob.getAuthor();
        for (String item : list) {
            tmpElement = new Element("author", bp);
            tmpElement.setAttribute("datatype", schemaString, rdf);
            tmpElement.setText(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getSource() != null && ob.getSource().size() > 0) {
        ArrayList<String> list = ob.getSource();
        for (String item : list) {
            tmpElement = new Element("source", bp);
            tmpElement.setAttribute("datatype", schemaString, rdf);
            tmpElement.setText(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getUrl() != null && ob.getUrl().size() > 0) {
        ArrayList<String> list = ob.getUrl();
        for (String item : list) {
            tmpElement = new Element("url", bp);
            tmpElement.setAttribute("datatype", schemaString, rdf);
            tmpElement.setText(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getYear() != null && ob.getYear() > 0) {
        tmpElement = new Element("year", bp);
        tmpElement.setAttribute("datatype", schemaInt, rdf);
        tmpElement.setText(ob.getYear().toString());
        element.addContent(tmpElement);
    }
    if (ob.getTitle() != null && ob.getTitle().length() > 0) {
        tmpElement = new Element("title", bp);
        tmpElement.setAttribute("datatype", schemaString, rdf);
        tmpElement.setText(ob.getTitle());
        element.addContent(tmpElement);
    }
    return element;
}
Also used : PublicationXref(org.vcell.pathway.PublicationXref) Element(org.jdom.Element) PathwayXMLHelper.schemaString(org.vcell.pathway.PathwayXMLHelper.schemaString)

Aggregations

PublicationXref (org.vcell.pathway.PublicationXref)7 Element (org.jdom.Element)5 BioPaxObject (org.vcell.pathway.BioPaxObject)5 RelationshipXref (org.vcell.pathway.RelationshipXref)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