Search in sources :

Example 21 with PhysicalEntity

use of org.vcell.pathway.PhysicalEntity 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 22 with PhysicalEntity

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

the class PathwayProducerBiopax3 method addContentPhysicalEntity.

// feature					EntityFeature				multiple
// notFeature				EntityFeature				multiple
// memberPhysicalEntity	PhysicalEntity				multiple
// cellularLocation		CellularLocationVocabulary	single
private Element addContentPhysicalEntity(BioPaxObject bpObject, Element element) {
    element = addContentEntity(bpObject, element);
    PhysicalEntity ob = (PhysicalEntity) bpObject;
    Element tmpElement = null;
    if (ob.getFeature() != null && ob.getFeature().size() > 0) {
        List<EntityFeature> list = ob.getFeature();
        for (EntityFeature item : list) {
            tmpElement = new Element("feature", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getNotFeature() != null && ob.getNotFeature().size() > 0) {
        List<EntityFeature> list = ob.getNotFeature();
        for (EntityFeature item : list) {
            tmpElement = new Element("notFeature", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getMemberPhysicalEntity() != null && ob.getMemberPhysicalEntity().size() > 0) {
        List<PhysicalEntity> list = ob.getMemberPhysicalEntity();
        for (PhysicalEntity item : list) {
            tmpElement = new Element("memberPhysicalEntity", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getCellularLocation() != null) {
        tmpElement = new Element("cellularLocation", bp);
        addIDToProperty(tmpElement, ob.getCellularLocation());
        mustPrintObject(ob.getCellularLocation());
        element.addContent(tmpElement);
    }
    return element;
}
Also used : EntityFeature(org.vcell.pathway.EntityFeature) PhysicalEntity(org.vcell.pathway.PhysicalEntity) Element(org.jdom.Element)

Example 23 with PhysicalEntity

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

the class PathwayProducerBiopax3 method addContentComplex.

// componentStoichiometry 	Stoichiometry 		multiple
// component 				PhysicalEntity 		multiple
private Element addContentComplex(BioPaxObject bpObject, Element element) {
    element = addContentPhysicalEntity(bpObject, element);
    Complex ob = (Complex) bpObject;
    Element tmpElement = null;
    if (ob.getComponentStoichiometry() != null && ob.getComponentStoichiometry().size() > 0) {
        List<Stoichiometry> list = ob.getComponentStoichiometry();
        for (Stoichiometry item : list) {
            tmpElement = new Element("componentStoichiometry", bp);
            // if(item instanceof RdfObjectProxy) {
            // tmpElement.setAttribute("resource", ((RdfObjectProxy)item).getResource(), rdf);
            // } else {
            // tmpElement.setAttribute("resource", item.resourceFromID(), rdf);
            // }
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getComponents() != null && ob.getComponents().size() > 0) {
        List<PhysicalEntity> list = ob.getComponents();
        for (PhysicalEntity item : list) {
            tmpElement = new Element("component", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    return element;
}
Also used : Stoichiometry(org.vcell.pathway.Stoichiometry) PhysicalEntity(org.vcell.pathway.PhysicalEntity) Element(org.jdom.Element) Complex(org.vcell.pathway.Complex)

Example 24 with PhysicalEntity

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

the class PathwayReader method addObjectPhysicalEntity.

private PhysicalEntity addObjectPhysicalEntity(Element element) {
    PhysicalEntity physicalEntity = new PhysicalEntity();
    Namespace rdf = Namespace.getNamespace("rdf", DefaultNameSpaces.RDF.uri);
    if (element.getAttributes().size() > 0) {
        physicalEntity = new PhysicalEntity();
        addAttributes(physicalEntity, element);
    }
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentPhysicalEntity(physicalEntity, element, childElement)) {
                showUnexpected(childElement, physicalEntity);
            }
        }
    }
    pathwayModel.add(physicalEntity);
    return physicalEntity;
}
Also used : PhysicalEntity(org.vcell.pathway.PhysicalEntity) Element(org.jdom.Element) BioPaxObject(org.vcell.pathway.BioPaxObject) Namespace(org.jdom.Namespace)

Example 25 with PhysicalEntity

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

the class AnnotationMapping method createPhysicalEntity.

private PhysicalEntity createPhysicalEntity(ArrayList<Xref> xRef, ArrayList<String> refName, String name) {
    PhysicalEntity physicalEntity = null;
    if (isSmallMolecule(xRef)) {
        physicalEntity = new SmallMolecule();
    } else {
        physicalEntity = new PhysicalEntity();
    }
    physicalEntity.setName(refName);
    physicalEntity.setID("BIOMODEL_" + name);
    // physicalEntity.setxRef(xRef);
    for (Xref ref : xRef) {
        physicalEntity.getxRef().add(ref);
    }
    return physicalEntity;
}
Also used : Xref(org.vcell.pathway.Xref) UnificationXref(org.vcell.pathway.UnificationXref) RelationshipXref(org.vcell.pathway.RelationshipXref) PublicationXref(org.vcell.pathway.PublicationXref) PhysicalEntity(org.vcell.pathway.PhysicalEntity) SmallMolecule(org.vcell.pathway.SmallMolecule)

Aggregations

PhysicalEntity (org.vcell.pathway.PhysicalEntity)27 BioPaxObject (org.vcell.pathway.BioPaxObject)15 ArrayList (java.util.ArrayList)10 Conversion (org.vcell.pathway.Conversion)9 Element (org.jdom.Element)8 Complex (org.vcell.pathway.Complex)8 HashSet (java.util.HashSet)7 Control (org.vcell.pathway.Control)7 GroupObject (org.vcell.pathway.GroupObject)6 SmallMolecule (org.vcell.pathway.SmallMolecule)5 MolecularType (org.vcell.model.rbm.MolecularType)4 Protein (org.vcell.pathway.Protein)4 RelationshipObject (org.vcell.relationship.RelationshipObject)4 EdgeShape (cbit.gui.graph.EdgeShape)3 Shape (cbit.gui.graph.Shape)3 SpeciesContext (cbit.vcell.model.SpeciesContext)3 Dna (org.vcell.pathway.Dna)3 Entity (org.vcell.pathway.Entity)3 InteractionParticipant (org.vcell.pathway.InteractionParticipant)3 Rna (org.vcell.pathway.Rna)3