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