use of org.vcell.pathway.persistence.BiopaxProxy.DnaRegionReferenceProxy in project vcell by virtualcell.
the class PathwayReaderBiopax3 method addContentDnaReference.
private boolean addContentDnaReference(DnaReference dnaReference, Element element, Element childElement) {
if (addContentEntityReference(dnaReference, element, childElement)) {
return true;
}
/**
* ArrayList<DnaRegionReference> subRegion
* BioSource organism
* ArrayList<RnaRegionReference> subRegion
* String sequence
*/
if (childElement.getName().equals("organism")) {
dnaReference.setOrganism(addObjectBioSource(childElement));
return true;
} else if (childElement.getName().equals("dnaSubRegion")) {
// obsolete
dnaReference.getDnaSubRegion().add(addObjectDnaRegionReference(childElement));
return true;
} else if (childElement.getName().equals("rnaSubRegion")) {
// obsolete
dnaReference.getRnaSubRegion().add(addObjectRnaRegionReference(childElement));
return true;
} else if (childElement.getName().equals("sequence")) {
dnaReference.setSequence(childElement.getTextTrim());
return true;
} else if (childElement.getName().equals("subRegion")) {
if (childElement.getChildren().size() == 0) {
// if there are no children it must be a resource inside another object
// we don't know yet whether it's DnaRegionReference or RnaRegionReference, we make a proxy for each
// at the time when we solve the references we'll find out which is fake
DnaRegionReference dReg = new DnaRegionReferenceProxy();
addAttributes(dReg, childElement);
pathwayModel.add(dReg);
dnaReference.getDnaSubRegion().add(dReg);
RnaRegionReference rReg = new RnaRegionReferenceProxy();
addAttributes(rReg, childElement);
pathwayModel.add(rReg);
dnaReference.getRnaSubRegion().add(rReg);
return true;
} else {
// it's the real object declaration - we ignore this situation for now
showIgnored(childElement, "Found NESTED child.");
return false;
}
} else {
// no match
return false;
}
}
use of org.vcell.pathway.persistence.BiopaxProxy.DnaRegionReferenceProxy in project vcell by virtualcell.
the class PathwayReaderBiopax3 method addObjectDnaRegionReference.
private DnaRegionReference addObjectDnaRegionReference(Element element) {
if (element.getChildren().size() == 0) {
DnaRegionReferenceProxy proxy = new DnaRegionReferenceProxy();
addAttributes(proxy, element);
pathwayModel.add(proxy);
return proxy;
}
DnaRegionReference dnaRegionReference = new DnaRegionReference();
addAttributes(dnaRegionReference, element);
for (Object child : element.getChildren()) {
if (child instanceof Element) {
Element childElement = (Element) child;
if (!addContentDnaRegionReference(dnaRegionReference, element, childElement)) {
showUnexpected(childElement);
}
}
}
pathwayModel.add(dnaRegionReference);
return dnaRegionReference;
}
Aggregations