Search in sources :

Example 1 with EntityFeature

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

the class PathwayReader method addObjectEntityFeature.

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

Example 2 with EntityFeature

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

the class PathwayReaderBiopax3 method addObjectEntityFeature.

private EntityFeature addObjectEntityFeature(Element element) {
    if (element.getChildren().size() == 0) {
        EntityFeatureProxy proxy = new EntityFeatureProxy();
        addAttributes(proxy, element);
        pathwayModel.add(proxy);
        return proxy;
    }
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (childElement.getName().equals("BindingFeature")) {
                BindingFeature thingie = addObjectBindingFeature(childElement);
                pathwayModel.add(thingie);
                return thingie;
            } else if (childElement.getName().equals("FragmentFeature")) {
                FragmentFeature thingie = addObjectFragmentFeature(childElement);
                pathwayModel.add(thingie);
                return thingie;
            } else if (childElement.getName().equals("ModificationFeature")) {
                ModificationFeature thingie = addObjectModificationFeature(childElement);
                pathwayModel.add(thingie);
                return thingie;
            }
        }
    }
    EntityFeature entityFeature = new EntityFeatureImpl();
    addAttributes(entityFeature, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentEntityFeature(entityFeature, element, childElement)) {
                showUnexpected(childElement);
            }
        }
    }
    pathwayModel.add(entityFeature);
    return entityFeature;
}
Also used : CovalentBindingFeature(org.vcell.pathway.CovalentBindingFeature) BindingFeature(org.vcell.pathway.BindingFeature) FragmentFeature(org.vcell.pathway.FragmentFeature) EntityFeature(org.vcell.pathway.EntityFeature) EntityFeatureProxy(org.vcell.pathway.persistence.BiopaxProxy.EntityFeatureProxy) Element(org.jdom.Element) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject) ModificationFeature(org.vcell.pathway.ModificationFeature) EntityFeatureImpl(org.vcell.pathway.EntityFeatureImpl)

Example 3 with EntityFeature

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

the class PathwayProducerBiopax3 method addContentEntityFeature.

// featureLocation 		SequenceLocation 			multiple
// featureLocationType 	SequenceRegionVocabulary 	multiple
// memberFeature 			EntityFeature 				multiple
// evidence 				Evidence 					multiple
private Element addContentEntityFeature(BioPaxObject bpObject, Element element) {
    element = addContentUtilityClass(bpObject, element);
    EntityFeature ob = (EntityFeature) bpObject;
    Element tmpElement = null;
    if (ob.getFeatureLocation() != null && ob.getFeatureLocation().size() > 0) {
        List<SequenceLocation> list = ob.getFeatureLocation();
        for (SequenceLocation item : list) {
            tmpElement = new Element("featureLocation", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getFeatureLocationType() != null && ob.getFeatureLocationType().size() > 0) {
        List<SequenceRegionVocabulary> list = ob.getFeatureLocationType();
        for (SequenceRegionVocabulary item : list) {
            tmpElement = new Element("featureLocationType", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getMemberFeature() != null && ob.getMemberFeature().size() > 0) {
        List<EntityFeature> list = ob.getMemberFeature();
        for (EntityFeature item : list) {
            tmpElement = new Element("memberFeature", 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 : EntityFeature(org.vcell.pathway.EntityFeature) Element(org.jdom.Element) SequenceLocation(org.vcell.pathway.SequenceLocation) Evidence(org.vcell.pathway.Evidence) SequenceRegionVocabulary(org.vcell.pathway.SequenceRegionVocabulary)

Example 4 with EntityFeature

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

the class PathwayProducerBiopax3 method addContentEntityReference.

// memberEntityReference	EntityReference					multiple
// entityReferenceType		EntityReferenceTypeVocabulary	single
// entityFeature			EntityFeature					multiple
// name					String							multiple
// xref					Xref							multiple
// evidence				Evidence						multiple
private Element addContentEntityReference(BioPaxObject bpObject, Element element) {
    element = addContentUtilityClass(bpObject, element);
    EntityReference ob = (EntityReference) bpObject;
    Element tmpElement = null;
    if (ob.getMemberEntityReference() != null && ob.getMemberEntityReference().size() > 0) {
        List<EntityReference> list = ob.getMemberEntityReference();
        for (EntityReference item : list) {
            tmpElement = new Element("memberEntityReference", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getEntityReferenceType() != null) {
        tmpElement = new Element("entityReferenceType", bp);
        addIDToProperty(tmpElement, ob.getEntityReferenceType());
        mustPrintObject(ob.getEntityReferenceType());
        element.addContent(tmpElement);
    }
    if (ob.getEntityFeature() != null && ob.getEntityFeature().size() > 0) {
        List<EntityFeature> list = ob.getEntityFeature();
        for (EntityFeature item : list) {
            tmpElement = new Element("entityFeature", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getName() != null && ob.getName().size() > 0) {
        List<String> list = ob.getName();
        for (String item : list) {
            tmpElement = new Element("name", bp);
            tmpElement.setAttribute("datatype", schemaString, rdf);
            tmpElement.setText(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getxRef() != null && ob.getxRef().size() > 0) {
        List<Xref> list = ob.getxRef();
        for (Xref item : list) {
            tmpElement = new Element("xref", 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 : EntityFeature(org.vcell.pathway.EntityFeature) Xref(org.vcell.pathway.Xref) RelationshipXref(org.vcell.pathway.RelationshipXref) PublicationXref(org.vcell.pathway.PublicationXref) Element(org.jdom.Element) EntityReference(org.vcell.pathway.EntityReference) Evidence(org.vcell.pathway.Evidence) PathwayXMLHelper.schemaString(org.vcell.pathway.PathwayXMLHelper.schemaString)

Example 5 with EntityFeature

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

Aggregations

Element (org.jdom.Element)5 EntityFeature (org.vcell.pathway.EntityFeature)5 BioPaxObject (org.vcell.pathway.BioPaxObject)2 EntityFeatureImpl (org.vcell.pathway.EntityFeatureImpl)2 Evidence (org.vcell.pathway.Evidence)2 BindingFeature (org.vcell.pathway.BindingFeature)1 CovalentBindingFeature (org.vcell.pathway.CovalentBindingFeature)1 EntityReference (org.vcell.pathway.EntityReference)1 FragmentFeature (org.vcell.pathway.FragmentFeature)1 GroupObject (org.vcell.pathway.GroupObject)1 ModificationFeature (org.vcell.pathway.ModificationFeature)1 PathwayXMLHelper.schemaString (org.vcell.pathway.PathwayXMLHelper.schemaString)1 PhysicalEntity (org.vcell.pathway.PhysicalEntity)1 PublicationXref (org.vcell.pathway.PublicationXref)1 RelationshipXref (org.vcell.pathway.RelationshipXref)1 SequenceLocation (org.vcell.pathway.SequenceLocation)1 SequenceRegionVocabulary (org.vcell.pathway.SequenceRegionVocabulary)1 Xref (org.vcell.pathway.Xref)1 EntityFeatureProxy (org.vcell.pathway.persistence.BiopaxProxy.EntityFeatureProxy)1