Search in sources :

Example 6 with Pathway

use of org.vcell.pathway.Pathway in project vcell by virtualcell.

the class BioPAXPathwayModelTreeNode method getNewChildren.

public List<BioPAXTreeNode> getNewChildren() {
    Set<BioPaxObject> objects = getPathwayModel().getBiopaxObjects();
    Map<Class<?>, Set<BioPaxObject>> subclassMap = BioPAXTreeMaker.divideBySubclasses(BioPaxObject.class, objects);
    List<BioPAXTreeNode> childrenNew = new ArrayList<BioPAXTreeNode>();
    for (Map.Entry<Class<?>, Set<BioPaxObject>> entry : subclassMap.entrySet()) {
        Class<?> subclass = entry.getKey();
        Set<BioPaxObject> objectsOfSubclass = entry.getValue();
        List<BioPaxObject> objectsOfSubclassList = new ArrayList<BioPaxObject>();
        objectsOfSubclassList.addAll(objectsOfSubclass);
        childrenNew.add(new BioPAXObjectListTreeNode<BioPaxObject>(getPathwayModel(), objectsOfSubclassList, subclass, this));
    }
    // for(BioPaxObject object : objects) {
    // children.add(
    // new BioPAXMessageTreeNode(getPathwayModel(), object.toString(), this));
    // }
    // TODO
    int nObjects = pathwayModel.getBiopaxObjects().size();
    Pathway topLevelPathway = pathwayModel.getTopLevelPathway();
    if (topLevelPathway != null) {
        List<String> nameList = topLevelPathway.getName();
        if (nameList != null && !nameList.isEmpty()) {
        }
    }
    labelText = nObjects + " objects";
    return childrenNew;
}
Also used : Set(java.util.Set) BioPaxObject(org.vcell.pathway.BioPaxObject) Pathway(org.vcell.pathway.Pathway) ArrayList(java.util.ArrayList) Map(java.util.Map)

Example 7 with Pathway

use of org.vcell.pathway.Pathway 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)

Example 8 with Pathway

use of org.vcell.pathway.Pathway in project vcell by virtualcell.

the class PathwayProducerBiopax3 method addContentControl.

// controller 		Pathway 		multiple
// controller 		PhysicalEntity 	multiple
// controlType 	String 			single
// controlled 		Interaction 	single
// controlled 		Pathway 		single
private Element addContentControl(BioPaxObject bpObject, Element element) {
    element = addContentInteraction(bpObject, element);
    Control ob = (Control) bpObject;
    Element tmpElement = null;
    if (ob.getPathwayControllers() != null && ob.getPathwayControllers().size() > 0) {
        List<Pathway> list = ob.getPathwayControllers();
        for (Pathway item : list) {
            tmpElement = new Element("controller", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getPhysicalControllers() != null && ob.getPhysicalControllers().size() > 0) {
        List<PhysicalEntity> list = ob.getPhysicalControllers();
        for (PhysicalEntity item : list) {
            tmpElement = new Element("controller", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getControlType() != null && ob.getControlType().length() > 0) {
        tmpElement = new Element("controlType", bp);
        tmpElement.setAttribute("datatype", schemaString, rdf);
        tmpElement.setText(ob.getControlType());
        element.addContent(tmpElement);
    }
    if (ob.getControlledInteraction() != null) {
        tmpElement = new Element("controlled", bp);
        addIDToProperty(tmpElement, ob.getControlledInteraction());
        mustPrintObject(ob.getControlledInteraction());
        element.addContent(tmpElement);
    }
    if (ob.getControlledPathway() != null) {
        tmpElement = new Element("controlled", bp);
        addIDToProperty(tmpElement, ob.getControlledPathway());
        mustPrintObject(ob.getControlledPathway());
        element.addContent(tmpElement);
    }
    return element;
}
Also used : Control(org.vcell.pathway.Control) PhysicalEntity(org.vcell.pathway.PhysicalEntity) Pathway(org.vcell.pathway.Pathway) Element(org.jdom.Element)

Example 9 with Pathway

use of org.vcell.pathway.Pathway in project vcell by virtualcell.

the class PathwayReader method addObjectPathway.

private Pathway addObjectPathway(Element element) {
    Pathway pathway = new Pathway();
    addAttributes(pathway, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentPathway(pathway, element, childElement)) {
                showUnexpected(childElement, pathway);
            }
        }
    }
    pathwayModel.add(pathway);
    return pathway;
}
Also used : Pathway(org.vcell.pathway.Pathway) Element(org.jdom.Element) BioPaxObject(org.vcell.pathway.BioPaxObject)

Aggregations

Pathway (org.vcell.pathway.Pathway)9 Element (org.jdom.Element)7 BioPaxObject (org.vcell.pathway.BioPaxObject)6 GeneticInteraction (org.vcell.pathway.GeneticInteraction)4 Interaction (org.vcell.pathway.Interaction)4 MolecularInteraction (org.vcell.pathway.MolecularInteraction)4 GroupObject (org.vcell.pathway.GroupObject)3 ArrayList (java.util.ArrayList)2 BiochemicalPathwayStep (org.vcell.pathway.BiochemicalPathwayStep)2 Control (org.vcell.pathway.Control)2 PathwayStep (org.vcell.pathway.PathwayStep)2 PhysicalEntity (org.vcell.pathway.PhysicalEntity)2 InteractionProxy (org.vcell.pathway.persistence.BiopaxProxy.InteractionProxy)2 PathwayProxy (org.vcell.pathway.persistence.BiopaxProxy.PathwayProxy)2 Map (java.util.Map)1 Set (java.util.Set)1 Catalysis (org.vcell.pathway.Catalysis)1 Complex (org.vcell.pathway.Complex)1 Conversion (org.vcell.pathway.Conversion)1 Dna (org.vcell.pathway.Dna)1