use of org.vcell.pathway.PathwayStep 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.PathwayStep in project vcell by virtualcell.
the class PathwayProducerBiopax3 method addContentPathwayStep.
// stepProcess Interaction multiple
// stepProcess Pathway multiple
// nextStep PathwayStep multiple
// evidence Evidence multiple
private Element addContentPathwayStep(BioPaxObject bpObject, Element element) {
element = addContentUtilityClass(bpObject, element);
PathwayStep ob = (PathwayStep) bpObject;
Element tmpElement = null;
if (ob.getStepProcessInteraction() != null && ob.getStepProcessInteraction().size() > 0) {
List<Interaction> list = ob.getStepProcessInteraction();
for (Interaction item : list) {
tmpElement = new Element("stepProcess", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getStepProcessPathway() != null && ob.getStepProcessPathway().size() > 0) {
List<Pathway> list = ob.getStepProcessPathway();
for (Pathway item : list) {
tmpElement = new Element("stepProcess", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getNextStep() != null && ob.getNextStep().size() > 0) {
List<PathwayStep> list = ob.getNextStep();
for (PathwayStep item : list) {
tmpElement = new Element("nextStep", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getEvidence() != null && ob.getEvidence().size() > 0) {
List<Evidence> list = ob.getEvidence();
for (Evidence item : list) {
tmpElement = new Element("evidence", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
return element;
}
use of org.vcell.pathway.PathwayStep in project vcell by virtualcell.
the class PathwayReader method addObjectPathwayStep.
private PathwayStep addObjectPathwayStep(Element element) {
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, pathwayStep);
}
}
}
pathwayModel.add(pathwayStep);
return pathwayStep;
}
use of org.vcell.pathway.PathwayStep 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;
}
}
use of org.vcell.pathway.PathwayStep in project vcell by virtualcell.
the class PathwayProducerBiopax3 method addContentPathway.
// pathwayOrder PathwayStep multiple
// pathwayComponent Interaction multiple
// pathwayComponent Pathway multiple
// organism BioSource single
private Element addContentPathway(BioPaxObject bpObject, Element element) {
element = addContentEntity(bpObject, element);
Pathway ob = (Pathway) bpObject;
Element tmpElement = null;
if (ob.getPathwayOrder() != null && ob.getPathwayOrder().size() > 0) {
List<PathwayStep> list = ob.getPathwayOrder();
for (PathwayStep item : list) {
tmpElement = new Element("pathwayOrder", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
// othervise both proxies will be filled out - while in reality one of them is "fake" and should be disposed of
if (ob.getPathwayComponentInteraction() != null && ob.getPathwayComponentInteraction().size() > 0) {
List<Interaction> list = ob.getPathwayComponentInteraction();
for (Interaction item : list) {
tmpElement = new Element("pathwayComponent", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getPathwayComponentPathway() != null && ob.getPathwayComponentPathway().size() > 0) {
List<Pathway> list = ob.getPathwayComponentPathway();
for (Pathway item : list) {
tmpElement = new Element("pathwayComponent", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
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