use of org.vcell.pathway.persistence.BiopaxProxy.PathwayStepProxy in project vcell by virtualcell.
the class PathwayReaderBiopax3 method addObjectPathwayStep.
private PathwayStep addObjectPathwayStep(Element element) {
if (element.getChildren().size() == 0) {
// if there are no children it must be a resource inside another object
PathwayStepProxy proxy = new PathwayStepProxy();
addAttributes(proxy, element);
pathwayModel.add(proxy);
return proxy;
}
PathwayStep pathwayStep = new PathwayStep();
addAttributes(pathwayStep, element);
for (Object child : element.getChildren()) {
if (child instanceof Element) {
Element childElement = (Element) child;
if (!addContentPathwayStep(pathwayStep, element, childElement)) {
showUnexpected(childElement);
}
}
}
pathwayModel.add(pathwayStep);
return pathwayStep;
}
use of org.vcell.pathway.persistence.BiopaxProxy.PathwayStepProxy in project vcell by virtualcell.
the class PathwayReader method addContentPathwayStep.
private boolean addContentPathwayStep(PathwayStep pathwayStep, Element element, Element childElement) {
if (addContentUtilityClass(pathwayStep, element, childElement)) {
return true;
}
/**
* ArrayList<PathwayStep> nextStep
* ArrayList<Interaction> stepProcessInteraction
* ArrayList<Pathway> stepProcessPathway
* ArrayList<Evidence> evidence
*/
if (childElement.getName().equals("NEXT-STEP")) {
Element pathwayStepElement = childElement.getChild("pathwayStep", bp);
if (pathwayStepElement != null) {
PathwayStep nextPathwayStep = addObjectPathwayStep(pathwayStepElement);
pathwayStep.getNextStep().add(nextPathwayStep);
pathwayModel.add(nextPathwayStep);
return true;
} else if (childElement.getChildren().size() == 0) {
PathwayStepProxy pathwayStepProxy = new PathwayStepProxy();
addAttributes(pathwayStepProxy, childElement);
pathwayStep.getNextStep().add(pathwayStepProxy);
pathwayModel.add(pathwayStepProxy);
return true;
} else {
return false;
}
} else if (childElement.getName().equals("STEP-INTERACTIONS")) {
if (childElement.getChildren().size() == 0) {
// if there are no children it must be a resource inside another object
InteractionProxy proxyI = new InteractionProxy();
addAttributes(proxyI, childElement);
pathwayModel.add(proxyI);
pathwayStep.getStepProcessInteraction().add(proxyI);
PathwayProxy proxyP = new PathwayProxy();
addAttributes(proxyP, childElement);
pathwayModel.add(proxyP);
pathwayStep.getStepProcessPathway().add(proxyP);
return true;
} else {
// it's a real stepProcess object nested here - we ignore this situation for now
showIgnored(childElement, "Found NESTED child.", pathwayStep);
}
return false;
// }else if (childElement.getName().equals("EVIDENCE")) {
// pathwayStep.getEvidence().add(addObjectEvidence(childElement));
// return true;
} else {
// no match
return false;
}
}
Aggregations