Search in sources :

Example 6 with PhysicalEntityProxy

use of org.vcell.pathway.persistence.BiopaxProxy.PhysicalEntityProxy in project vcell by virtualcell.

the class PathwayReader method addContentControl.

private boolean addContentControl(Control control, Element element, Element childElement) {
    if (addContentInteraction(control, element, childElement)) {
        return true;
    }
    /**
     * InteractionImpl controlledInteraction
     * Pathway controlledPathway
     * String controlType
     * ArrayList<Pathway> pathwayControllers
     * ArrayList<PhysicalEntity> physicalControllers
     */
    if (childElement.getName().equals("CONTROLLER")) {
        Element physicalEntityParticipantElement = childElement.getChild("physicalEntityParticipant", bp);
        if (physicalEntityParticipantElement != null) {
            Element physicalEntityPropertyElement = physicalEntityParticipantElement.getChild("PHYSICAL-ENTITY", bp);
            if (physicalEntityPropertyElement != null) {
                if (physicalEntityPropertyElement.getChildren().size() == 0) {
                    PhysicalEntityProxy physicalEntityProxy = new PhysicalEntityProxy();
                    addAttributes(physicalEntityProxy, physicalEntityPropertyElement);
                    pathwayModel.add(physicalEntityProxy);
                    control.addPhysicalController(physicalEntityProxy);
                    return true;
                }
            }
        }
        Element sequenceParticipantElement = childElement.getChild("sequenceParticipant", bp);
        if (sequenceParticipantElement != null) {
            Element physicalEntityPropertyElement = sequenceParticipantElement.getChild("PHYSICAL-ENTITY", bp);
            if (physicalEntityPropertyElement != null) {
                if (physicalEntityPropertyElement.getChildren().size() == 0) {
                    PhysicalEntityProxy physicalEntityProxy = new PhysicalEntityProxy();
                    addAttributes(physicalEntityProxy, physicalEntityPropertyElement);
                    pathwayModel.add(physicalEntityProxy);
                    control.addPhysicalController(physicalEntityProxy);
                    return true;
                }
            }
        }
        // }
        return false;
    // // is it a pathway controller?
    // control.getPathwayControllers().add(addPathway(childElement));
    } else if (childElement.getName().equals("CONTROLLED")) {
        Attribute resourceAttribute = childElement.getAttribute("resource", rdf);
        if (resourceAttribute != null) {
            InteractionOrPathwayProxy controlledEntityProxy = new InteractionOrPathwayProxy();
            control.setControlledInteraction(controlledEntityProxy);
            pathwayModel.add(controlledEntityProxy);
            String uri = context.unRelativizeURI(childElement, resourceAttribute.getValue());
            controlledEntityProxy.setID(uri);
            return true;
        }
        return false;
    } else if (childElement.getName().equals("CONTROL-TYPE")) {
        control.setControlType(childElement.getTextTrim());
        return true;
    } else {
        return false;
    }
}
Also used : Attribute(org.jdom.Attribute) Element(org.jdom.Element) PhysicalEntityProxy(org.vcell.pathway.persistence.BiopaxProxy.PhysicalEntityProxy) InteractionOrPathwayProxy(org.vcell.pathway.persistence.BiopaxProxy.InteractionOrPathwayProxy)

Aggregations

Element (org.jdom.Element)6 PhysicalEntityProxy (org.vcell.pathway.persistence.BiopaxProxy.PhysicalEntityProxy)6 BioPaxObject (org.vcell.pathway.BioPaxObject)2 Complex (org.vcell.pathway.Complex)2 Dna (org.vcell.pathway.Dna)2 DnaRegion (org.vcell.pathway.DnaRegion)2 GroupObject (org.vcell.pathway.GroupObject)2 PhysicalEntity (org.vcell.pathway.PhysicalEntity)2 Protein (org.vcell.pathway.Protein)2 Rna (org.vcell.pathway.Rna)2 RnaRegion (org.vcell.pathway.RnaRegion)2 SmallMolecule (org.vcell.pathway.SmallMolecule)2 Attribute (org.jdom.Attribute)1 GeneticInteraction (org.vcell.pathway.GeneticInteraction)1 Interaction (org.vcell.pathway.Interaction)1 MolecularInteraction (org.vcell.pathway.MolecularInteraction)1 Pathway (org.vcell.pathway.Pathway)1 Stoichiometry (org.vcell.pathway.Stoichiometry)1 CellularLocationVocabularyProxy (org.vcell.pathway.persistence.BiopaxProxy.CellularLocationVocabularyProxy)1 InteractionOrPathwayProxy (org.vcell.pathway.persistence.BiopaxProxy.InteractionOrPathwayProxy)1