Search in sources :

Example 6 with Stoichiometry

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

the class PathwayProducerBiopax3 method addContentConversion.

// right 						PhysicalEntity 	multiple
// participantStoichiometry 	Stoichiometry 	multiple
// left 						PhysicalEntity 	multiple
// spontaneous 				Boolean 		single
// conversionDirection 		String 			single
private Element addContentConversion(BioPaxObject bpObject, Element element) {
    element = addContentInteraction(bpObject, element);
    Conversion ob = (Conversion) bpObject;
    Element tmpElement = null;
    if (ob.getLeft() != null && ob.getLeft().size() > 0) {
        List<PhysicalEntity> list = ob.getLeft();
        for (PhysicalEntity item : list) {
            tmpElement = new Element("left", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getRight() != null && ob.getRight().size() > 0) {
        List<PhysicalEntity> list = ob.getRight();
        for (PhysicalEntity item : list) {
            tmpElement = new Element("right", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getParticipantStoichiometry() != null && ob.getParticipantStoichiometry().size() > 0) {
        List<Stoichiometry> list = ob.getParticipantStoichiometry();
        for (Stoichiometry item : list) {
            tmpElement = new Element("participantStoichiometry", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getSpontaneous() != null) {
        tmpElement = new Element("spontaneous", bp);
        tmpElement.setAttribute("datatype", schemaBoolean, rdf);
        tmpElement.setText(ob.getSpontaneous().toString());
        element.addContent(tmpElement);
    }
    if (ob.getConversionDirection() != null && ob.getConversionDirection().length() > 0) {
        tmpElement = new Element("conversionDirection", bp);
        tmpElement.setAttribute("datatype", schemaString, rdf);
        tmpElement.setText(ob.getConversionDirection());
        element.addContent(tmpElement);
    }
    return element;
}
Also used : Stoichiometry(org.vcell.pathway.Stoichiometry) PhysicalEntity(org.vcell.pathway.PhysicalEntity) Element(org.jdom.Element) Conversion(org.vcell.pathway.Conversion)

Example 7 with Stoichiometry

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

the class PathwayReader method addObjectStoichiometry.

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

Aggregations

Stoichiometry (org.vcell.pathway.Stoichiometry)7 Element (org.jdom.Element)6 PhysicalEntity (org.vcell.pathway.PhysicalEntity)4 BioPaxObject (org.vcell.pathway.BioPaxObject)3 Conversion (org.vcell.pathway.Conversion)2 ArrayList (java.util.ArrayList)1 Catalysis (org.vcell.pathway.Catalysis)1 Complex (org.vcell.pathway.Complex)1 Control (org.vcell.pathway.Control)1 GroupObject (org.vcell.pathway.GroupObject)1 Pathway (org.vcell.pathway.Pathway)1 Transport (org.vcell.pathway.Transport)1 CellularLocationVocabularyProxy (org.vcell.pathway.persistence.BiopaxProxy.CellularLocationVocabularyProxy)1 PhysicalEntityProxy (org.vcell.pathway.persistence.BiopaxProxy.PhysicalEntityProxy)1 StoichiometryProxy (org.vcell.pathway.persistence.BiopaxProxy.StoichiometryProxy)1 ConversionTableRow (org.vcell.relationship.ConversionTableRow)1