Search in sources :

Example 1 with SequenceLocation

use of org.vcell.pathway.SequenceLocation 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 2 with SequenceLocation

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

the class PathwayReader method addObjectSequenceLocation.

private SequenceLocation addObjectSequenceLocation(Element element) {
    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, sequenceLocation);
            }
        }
    }
    pathwayModel.add(sequenceLocation);
    return sequenceLocation;
}
Also used : Element(org.jdom.Element) SequenceLocation(org.vcell.pathway.SequenceLocation) BioPaxObject(org.vcell.pathway.BioPaxObject)

Example 3 with SequenceLocation

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

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

the class MatcheableTest method null2.

@Test
public void null2() {
    TimeStep t = null;
    SequenceLocation sl = null;
    assertTrue(Matchable.areEqual(t, t));
    assertTrue(Matchable.areEqual(t, sl));
    assertTrue(Matchable.areEqual(t, null));
}
Also used : TimeStep(cbit.vcell.solver.TimeStep) SequenceLocation(org.vcell.pathway.SequenceLocation) Test(org.junit.Test)

Aggregations

SequenceLocation (org.vcell.pathway.SequenceLocation)4 Element (org.jdom.Element)3 BioPaxObject (org.vcell.pathway.BioPaxObject)2 TimeStep (cbit.vcell.solver.TimeStep)1 Test (org.junit.Test)1 EntityFeature (org.vcell.pathway.EntityFeature)1 Evidence (org.vcell.pathway.Evidence)1 GroupObject (org.vcell.pathway.GroupObject)1 SequenceInterval (org.vcell.pathway.SequenceInterval)1 SequenceRegionVocabulary (org.vcell.pathway.SequenceRegionVocabulary)1 SequenceSite (org.vcell.pathway.SequenceSite)1 SequenceLocationProxy (org.vcell.pathway.persistence.BiopaxProxy.SequenceLocationProxy)1