Search in sources :

Example 1 with RnaRegionReference

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

the class PathwayReaderBiopax3 method addObjectEntityReference.

private EntityReference addObjectEntityReference(Element element) {
    if (element.getChildren().size() == 0) {
        EntityReferenceProxy proxy = new EntityReferenceProxy();
        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("DnaReference")) {
                DnaReference thingie = addObjectDnaReference(childElement);
                pathwayModel.add(thingie);
                return thingie;
            } else if (childElement.getName().equals("DnaRegionReference")) {
                DnaRegionReference thingie = addObjectDnaRegionReference(childElement);
                pathwayModel.add(thingie);
                return thingie;
            } else if (childElement.getName().equals("ProteinReference")) {
                ProteinReference thingie = addObjectProteinReference(childElement);
                pathwayModel.add(thingie);
                return thingie;
            } else if (childElement.getName().equals("RnaReference")) {
                RnaReference thingie = addObjectRnaReference(childElement);
                pathwayModel.add(thingie);
                return thingie;
            } else if (childElement.getName().equals("RnaRegionReference")) {
                RnaRegionReference thingie = addObjectRnaRegionReference(childElement);
                pathwayModel.add(thingie);
                return thingie;
            } else if (childElement.getName().equals("SmallMoleculeReference")) {
                SmallMoleculeReference thingie = addObjectSmallMoleculeReference(childElement);
                pathwayModel.add(thingie);
                return thingie;
            }
        }
    }
    EntityReference entityReference = new EntityReference();
    addAttributes(entityReference, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentEntityReference(entityReference, element, childElement)) {
                // to self ??
                showUnexpected(childElement);
            }
        }
    }
    pathwayModel.add(entityReference);
    return entityReference;
}
Also used : DnaReference(org.vcell.pathway.DnaReference) DnaRegionReference(org.vcell.pathway.DnaRegionReference) Element(org.jdom.Element) EntityReference(org.vcell.pathway.EntityReference) EntityReferenceProxy(org.vcell.pathway.persistence.BiopaxProxy.EntityReferenceProxy) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject) ProteinReference(org.vcell.pathway.ProteinReference) RnaReference(org.vcell.pathway.RnaReference) RnaRegionReference(org.vcell.pathway.RnaRegionReference) SmallMoleculeReference(org.vcell.pathway.SmallMoleculeReference)

Example 2 with RnaRegionReference

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

the class PathwayProducerBiopax3 method addContentRnaRegionReference.

// absoluteRegion 	SequenceLocation 			single
// subRegion 		DnaRegionReference 			multiple
// subRegion 		RnaRegionReference 			multiple
// sequence 		String 						single
// regionType 		SequenceRegionVocabulary 	single
// organism 		BioSource 					single
private Element addContentRnaRegionReference(BioPaxObject bpObject, Element element) {
    element = addContentEntityReference(bpObject, element);
    RnaRegionReference ob = (RnaRegionReference) bpObject;
    Element tmpElement = null;
    if (ob.getAbsoluteRegion() != null) {
        tmpElement = new Element("absoluteRegion", bp);
        addIDToProperty(tmpElement, ob.getAbsoluteRegion());
        mustPrintObject(ob.getAbsoluteRegion());
        element.addContent(tmpElement);
    }
    if (ob.getDnaSubRegion() != null && ob.getDnaSubRegion().size() > 0) {
        List<DnaRegionReference> list = ob.getDnaSubRegion();
        for (DnaRegionReference item : list) {
            tmpElement = new Element("subRegion", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getRnaSubRegion() != null && ob.getRnaSubRegion().size() > 0) {
        List<RnaRegionReference> list = ob.getRnaSubRegion();
        for (RnaRegionReference item : list) {
            tmpElement = new Element("subRegion", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getSequence() != null && ob.getSequence().length() > 0) {
        tmpElement = new Element("sequence", bp);
        tmpElement.setAttribute("datatype", schemaString, rdf);
        tmpElement.setText(ob.getSequence());
        element.addContent(tmpElement);
    }
    if (ob.getRegionType() != null) {
        tmpElement = new Element("regionType", bp);
        addIDToProperty(tmpElement, ob.getRegionType());
        mustPrintObject(ob.getRegionType());
        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 : DnaRegionReference(org.vcell.pathway.DnaRegionReference) Element(org.jdom.Element) RnaRegionReference(org.vcell.pathway.RnaRegionReference)

Example 3 with RnaRegionReference

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

the class PathwayReader method addObjectRnaRegionReference.

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

Example 4 with RnaRegionReference

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

the class PathwayProducerBiopax3 method addContentDnaRegionReference.

// absoluteRegion 	SequenceLocation 			single
// subRegion 		DnaRegionReference 			multiple
// subRegion 		RnaRegionReference 			multiple
// sequence 		String 						single
// regionType 		SequenceRegionVocabulary 	single
// organism 		BioSource 					single
private Element addContentDnaRegionReference(BioPaxObject bpObject, Element element) {
    element = addContentEntityReference(bpObject, element);
    DnaRegionReference ob = (DnaRegionReference) bpObject;
    Element tmpElement = null;
    if (ob.getAbsoluteRegion() != null) {
        tmpElement = new Element("absoluteRegion", bp);
        addIDToProperty(tmpElement, ob.getAbsoluteRegion());
        mustPrintObject(ob.getAbsoluteRegion());
        element.addContent(tmpElement);
    }
    if (ob.getDnaSubRegion() != null && ob.getDnaSubRegion().size() > 0) {
        List<DnaRegionReference> list = ob.getDnaSubRegion();
        for (DnaRegionReference item : list) {
            tmpElement = new Element("subRegion", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getRnaSubRegion() != null && ob.getRnaSubRegion().size() > 0) {
        List<RnaRegionReference> list = ob.getRnaSubRegion();
        for (RnaRegionReference item : list) {
            tmpElement = new Element("subRegion", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getSequence() != null && ob.getSequence().length() > 0) {
        tmpElement = new Element("sequence", bp);
        tmpElement.setAttribute("datatype", schemaString, rdf);
        tmpElement.setText(ob.getSequence());
        element.addContent(tmpElement);
    }
    if (ob.getRegionType() != null) {
        tmpElement = new Element("regionType", bp);
        addIDToProperty(tmpElement, ob.getRegionType());
        mustPrintObject(ob.getRegionType());
        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 : DnaRegionReference(org.vcell.pathway.DnaRegionReference) Element(org.jdom.Element) RnaRegionReference(org.vcell.pathway.RnaRegionReference)

Example 5 with RnaRegionReference

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

the class PathwayProducerBiopax3 method addContentRnaReference.

// subRegion 	DnaRegionReference 	multiple
// subRegion 	RnaRegionReference 	multiple
// sequence 	String 				single
// organism 	BioSource 			single
private Element addContentRnaReference(BioPaxObject bpObject, Element element) {
    element = addContentEntityReference(bpObject, element);
    RnaReference ob = (RnaReference) bpObject;
    Element tmpElement = null;
    if (ob.getDnaSubRegion() != null && ob.getDnaSubRegion().size() > 0) {
        List<DnaRegionReference> list = ob.getDnaSubRegion();
        for (DnaRegionReference item : list) {
            tmpElement = new Element("subRegion", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getRnaSubRegion() != null && ob.getRnaSubRegion().size() > 0) {
        List<RnaRegionReference> list = ob.getRnaSubRegion();
        for (RnaRegionReference item : list) {
            tmpElement = new Element("subRegion", bp);
            addIDToProperty(tmpElement, item);
            mustPrintObject(item);
            element.addContent(tmpElement);
        }
    }
    if (ob.getSequence() != null && ob.getSequence().length() > 0) {
        tmpElement = new Element("sequence", bp);
        tmpElement.setAttribute("datatype", schemaString, rdf);
        tmpElement.setText(ob.getSequence());
        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 : DnaRegionReference(org.vcell.pathway.DnaRegionReference) Element(org.jdom.Element) RnaReference(org.vcell.pathway.RnaReference) RnaRegionReference(org.vcell.pathway.RnaRegionReference)

Aggregations

RnaRegionReference (org.vcell.pathway.RnaRegionReference)8 Element (org.jdom.Element)7 DnaRegionReference (org.vcell.pathway.DnaRegionReference)6 BioPaxObject (org.vcell.pathway.BioPaxObject)3 DnaReference (org.vcell.pathway.DnaReference)2 GroupObject (org.vcell.pathway.GroupObject)2 RnaReference (org.vcell.pathway.RnaReference)2 RnaRegionReferenceProxy (org.vcell.pathway.persistence.BiopaxProxy.RnaRegionReferenceProxy)2 EntityReference (org.vcell.pathway.EntityReference)1 ProteinReference (org.vcell.pathway.ProteinReference)1 SmallMoleculeReference (org.vcell.pathway.SmallMoleculeReference)1 DnaRegionReferenceProxy (org.vcell.pathway.persistence.BiopaxProxy.DnaRegionReferenceProxy)1 EntityReferenceProxy (org.vcell.pathway.persistence.BiopaxProxy.EntityReferenceProxy)1