Search in sources :

Example 1 with PathwayStep

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;
}
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 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;
}
Also used : BiochemicalPathwayStep(org.vcell.pathway.BiochemicalPathwayStep) PathwayStep(org.vcell.pathway.PathwayStep) Interaction(org.vcell.pathway.Interaction) MolecularInteraction(org.vcell.pathway.MolecularInteraction) GeneticInteraction(org.vcell.pathway.GeneticInteraction) Pathway(org.vcell.pathway.Pathway) Element(org.jdom.Element) Evidence(org.vcell.pathway.Evidence)

Example 3 with PathwayStep

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

Example 4 with 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;
    }
}
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)

Example 5 with PathwayStep

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;
}
Also used : BiochemicalPathwayStep(org.vcell.pathway.BiochemicalPathwayStep) PathwayStep(org.vcell.pathway.PathwayStep) Pathway(org.vcell.pathway.Pathway) Interaction(org.vcell.pathway.Interaction) MolecularInteraction(org.vcell.pathway.MolecularInteraction) GeneticInteraction(org.vcell.pathway.GeneticInteraction) Element(org.jdom.Element)

Aggregations

Element (org.jdom.Element)5 BiochemicalPathwayStep (org.vcell.pathway.BiochemicalPathwayStep)5 PathwayStep (org.vcell.pathway.PathwayStep)5 BioPaxObject (org.vcell.pathway.BioPaxObject)2 GeneticInteraction (org.vcell.pathway.GeneticInteraction)2 Interaction (org.vcell.pathway.Interaction)2 MolecularInteraction (org.vcell.pathway.MolecularInteraction)2 Pathway (org.vcell.pathway.Pathway)2 PathwayStepProxy (org.vcell.pathway.persistence.BiopaxProxy.PathwayStepProxy)2 Evidence (org.vcell.pathway.Evidence)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