Search in sources :

Example 1 with SequenceSite

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

the class PathwayReaderBiopax3 method addObjectSequenceSite.

private SequenceSite addObjectSequenceSite(Element element) {
    if (element.getChildren().size() == 0) {
        // if there are no children it must be a resource inside another object
        SequenceSiteProxy proxy = new SequenceSiteProxy();
        addAttributes(proxy, element);
        pathwayModel.add(proxy);
        return proxy;
    }
    SequenceSite sequenceSite = new SequenceSite();
    addAttributes(sequenceSite, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentSequenceSite(sequenceSite, element, childElement)) {
                showUnexpected(childElement);
            }
        }
    }
    pathwayModel.add(sequenceSite);
    return sequenceSite;
}
Also used : SequenceSite(org.vcell.pathway.SequenceSite) Element(org.jdom.Element) SequenceSiteProxy(org.vcell.pathway.persistence.BiopaxProxy.SequenceSiteProxy) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject)

Example 2 with SequenceSite

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

the class PathwayReaderBiopax3 method addObjectSequenceLocation.

private SequenceLocation addObjectSequenceLocation(Element element) {
    if (element.getChildren().size() == 0) {
        // if there are no children it must be a resource inside another object
        SequenceLocationProxy proxy = new SequenceLocationProxy();
        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("SequenceInterval")) {
                SequenceInterval thingie = addObjectSequenceInterval(childElement);
                pathwayModel.add(thingie);
                return thingie;
            }
        } else if (child instanceof Element) {
            Element childElement = (Element) child;
            if (childElement.getName().equals("SequenceSite")) {
                SequenceSite thingie = addObjectSequenceSite(childElement);
                pathwayModel.add(thingie);
                return thingie;
            }
        }
    }
    SequenceLocation sequenceLocation = new SequenceLocation();
    addAttributes(sequenceLocation, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentSequenceLocation(sequenceLocation, element, childElement)) {
                showUnexpected(childElement);
            }
        }
    }
    pathwayModel.add(sequenceLocation);
    return sequenceLocation;
}
Also used : Element(org.jdom.Element) SequenceSite(org.vcell.pathway.SequenceSite) SequenceInterval(org.vcell.pathway.SequenceInterval) SequenceLocation(org.vcell.pathway.SequenceLocation) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject) SequenceLocationProxy(org.vcell.pathway.persistence.BiopaxProxy.SequenceLocationProxy)

Example 3 with SequenceSite

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

the class PathwayReader method addObjectSequenceSite.

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

Example 4 with SequenceSite

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

the class PathwayProducerBiopax3 method addContentSequenceSite.

// sequencePosition 	Integer 	single
// positionStatus 		String 		single
private Element addContentSequenceSite(BioPaxObject bpObject, Element element) {
    element = addContentSequenceLocation(bpObject, element);
    SequenceSite ob = (SequenceSite) bpObject;
    Element tmpElement = null;
    if (ob.getSequencePosition() != null) {
        tmpElement = new Element("sequencePosition", bp);
        tmpElement.setAttribute("datatype", schemaInt, rdf);
        tmpElement.setText(ob.getSequencePosition().toString());
        element.addContent(tmpElement);
    }
    if (ob.getPositionStatus() != null && ob.getPositionStatus().length() > 0) {
        tmpElement = new Element("positionStatus", bp);
        tmpElement.setAttribute("datatype", schemaString, rdf);
        tmpElement.setText(ob.getPositionStatus());
        element.addContent(tmpElement);
    }
    return element;
}
Also used : SequenceSite(org.vcell.pathway.SequenceSite) Element(org.jdom.Element)

Aggregations

Element (org.jdom.Element)4 SequenceSite (org.vcell.pathway.SequenceSite)4 BioPaxObject (org.vcell.pathway.BioPaxObject)3 GroupObject (org.vcell.pathway.GroupObject)2 SequenceInterval (org.vcell.pathway.SequenceInterval)1 SequenceLocation (org.vcell.pathway.SequenceLocation)1 SequenceLocationProxy (org.vcell.pathway.persistence.BiopaxProxy.SequenceLocationProxy)1 SequenceSiteProxy (org.vcell.pathway.persistence.BiopaxProxy.SequenceSiteProxy)1