Search in sources :

Example 1 with PathwayStepProxy

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;
}
Also used : PathwayStep(org.vcell.pathway.PathwayStep) BiochemicalPathwayStep(org.vcell.pathway.BiochemicalPathwayStep) PathwayStepProxy(org.vcell.pathway.persistence.BiopaxProxy.PathwayStepProxy) Element(org.jdom.Element) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject)

Example 2 with PathwayStepProxy

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;
    }
}
Also used : PathwayStep(org.vcell.pathway.PathwayStep) BiochemicalPathwayStep(org.vcell.pathway.BiochemicalPathwayStep) InteractionProxy(org.vcell.pathway.persistence.BiopaxProxy.InteractionProxy) PathwayStepProxy(org.vcell.pathway.persistence.BiopaxProxy.PathwayStepProxy) Element(org.jdom.Element) PathwayProxy(org.vcell.pathway.persistence.BiopaxProxy.PathwayProxy) InteractionOrPathwayProxy(org.vcell.pathway.persistence.BiopaxProxy.InteractionOrPathwayProxy)

Aggregations

Element (org.jdom.Element)2 BiochemicalPathwayStep (org.vcell.pathway.BiochemicalPathwayStep)2 PathwayStep (org.vcell.pathway.PathwayStep)2 PathwayStepProxy (org.vcell.pathway.persistence.BiopaxProxy.PathwayStepProxy)2 BioPaxObject (org.vcell.pathway.BioPaxObject)1 GroupObject (org.vcell.pathway.GroupObject)1 InteractionOrPathwayProxy (org.vcell.pathway.persistence.BiopaxProxy.InteractionOrPathwayProxy)1 InteractionProxy (org.vcell.pathway.persistence.BiopaxProxy.InteractionProxy)1 PathwayProxy (org.vcell.pathway.persistence.BiopaxProxy.PathwayProxy)1