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;
}
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;
}
Aggregations