use of org.vcell.pathway.ProteinReference in project vcell by virtualcell.
the class PathwayReaderBiopax3 method addObjectEntityReference.
private EntityReference addObjectEntityReference(Element element) {
if (element.getChildren().size() == 0) {
EntityReferenceProxy proxy = new EntityReferenceProxy();
addAttributes(proxy, element);
pathwayModel.add(proxy);
return proxy;
}
for (Object child : element.getChildren()) {
if (child instanceof Element) {
Element childElement = (Element) child;
if (childElement.getName().equals("DnaReference")) {
DnaReference thingie = addObjectDnaReference(childElement);
pathwayModel.add(thingie);
return thingie;
} else if (childElement.getName().equals("DnaRegionReference")) {
DnaRegionReference thingie = addObjectDnaRegionReference(childElement);
pathwayModel.add(thingie);
return thingie;
} else if (childElement.getName().equals("ProteinReference")) {
ProteinReference thingie = addObjectProteinReference(childElement);
pathwayModel.add(thingie);
return thingie;
} else if (childElement.getName().equals("RnaReference")) {
RnaReference thingie = addObjectRnaReference(childElement);
pathwayModel.add(thingie);
return thingie;
} else if (childElement.getName().equals("RnaRegionReference")) {
RnaRegionReference thingie = addObjectRnaRegionReference(childElement);
pathwayModel.add(thingie);
return thingie;
} else if (childElement.getName().equals("SmallMoleculeReference")) {
SmallMoleculeReference thingie = addObjectSmallMoleculeReference(childElement);
pathwayModel.add(thingie);
return thingie;
}
}
}
EntityReference entityReference = new EntityReference();
addAttributes(entityReference, element);
for (Object child : element.getChildren()) {
if (child instanceof Element) {
Element childElement = (Element) child;
if (!addContentEntityReference(entityReference, element, childElement)) {
// to self ??
showUnexpected(childElement);
}
}
}
pathwayModel.add(entityReference);
return entityReference;
}
use of org.vcell.pathway.ProteinReference in project vcell by virtualcell.
the class PathwayReader method addObjectProteinReference.
private ProteinReference addObjectProteinReference(Element element) {
ProteinReference proteinReference = new ProteinReference();
addAttributes(proteinReference, element);
for (Object child : element.getChildren()) {
if (child instanceof Element) {
Element childElement = (Element) child;
if (!addContentProteinReference(proteinReference, element, childElement)) {
showUnexpected(childElement, proteinReference);
}
}
}
pathwayModel.add(proteinReference);
return proteinReference;
}
use of org.vcell.pathway.ProteinReference in project vcell by virtualcell.
the class PathwayReaderBiopax3 method addObjectProteinReference.
private ProteinReference addObjectProteinReference(Element element) {
ProteinReference proteinReference = new ProteinReference();
addAttributes(proteinReference, element);
for (Object child : element.getChildren()) {
if (child instanceof Element) {
Element childElement = (Element) child;
if (!addContentProteinReference(proteinReference, element, childElement)) {
showUnexpected(childElement);
}
}
}
pathwayModel.add(proteinReference);
return proteinReference;
}
use of org.vcell.pathway.ProteinReference in project vcell by virtualcell.
the class PathwayProducerBiopax3 method addContentProteinReference.
// sequence String single
// organism BioSource single
private Element addContentProteinReference(BioPaxObject bpObject, Element element) {
element = addContentEntityReference(bpObject, element);
ProteinReference ob = (ProteinReference) bpObject;
Element tmpElement = null;
if (ob.getSequence() != null && ob.getSequence().length() > 0) {
tmpElement = new Element("sequence", bp);
tmpElement.setAttribute("datatype", schemaString, rdf);
tmpElement.setText(ob.getSequence());
element.addContent(tmpElement);
}
if (ob.getOrganism() != null) {
tmpElement = new Element("organism", bp);
addIDToProperty(tmpElement, ob.getOrganism());
mustPrintObject(ob.getOrganism());
element.addContent(tmpElement);
}
return element;
}
Aggregations