Search in sources :

Example 1 with BioSource

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

the class PathwayReader method addBioSource.

private BioSource addBioSource(Element element) {
    BioSource bioSource = new BioSource();
    addAttributes(bioSource, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            if (!addContentBioSource(bioSource, element, (Element) child)) {
                showUnexpected((Element) child, bioSource);
            }
        }
    }
    pathwayModel.add(bioSource);
    return bioSource;
}
Also used : Element(org.jdom.Element) BioSource(org.vcell.pathway.BioSource) BioPaxObject(org.vcell.pathway.BioPaxObject)

Example 2 with BioSource

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

the class PathwayReaderBiopax3 method addObjectBioSource.

private BioSource addObjectBioSource(Element element) {
    if (element.getChildren().size() == 0) {
        BioSourceProxy proxy = new BioSourceProxy();
        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("BioSource")) {
                BioSource thingie = addObjectBioSource(childElement);
                pathwayModel.add(thingie);
                return thingie;
            }
        }
    }
    BioSource bioSource = new BioSource();
    addAttributes(bioSource, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentBioSource(bioSource, element, childElement)) {
                showUnexpected(childElement);
            }
        }
    }
    pathwayModel.add(bioSource);
    return bioSource;
}
Also used : BioSourceProxy(org.vcell.pathway.persistence.BiopaxProxy.BioSourceProxy) Element(org.jdom.Element) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject) BioSource(org.vcell.pathway.BioSource)

Example 3 with BioSource

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

the class PathwayProducerBiopax3 method addContentBioSource.

// tissue 		TissueVocabulary 	single
// cellType 	CellVocabulary 		single
// name 		String 				multiple
// xref 		Xref 				multiple
private Element addContentBioSource(BioPaxObject bpObject, Element element) {
    element = addContentUtilityClass(bpObject, element);
    BioSource ob = (BioSource) bpObject;
    Element tmpElement = null;
    if (ob.getTissue() != null) {
        tmpElement = new Element("tissue", bp);
        addIDToProperty(tmpElement, ob.getTissue());
        mustPrintObject(ob.getTissue());
        element.addContent(tmpElement);
    }
    if (ob.getCellType() != null) {
        tmpElement = new Element("cellType", bp);
        addIDToProperty(tmpElement, ob.getCellType());
        mustPrintObject(ob.getCellType());
        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);
        }
    }
    return element;
}
Also used : Xref(org.vcell.pathway.Xref) RelationshipXref(org.vcell.pathway.RelationshipXref) PublicationXref(org.vcell.pathway.PublicationXref) Element(org.jdom.Element) BioSource(org.vcell.pathway.BioSource) PathwayXMLHelper.schemaString(org.vcell.pathway.PathwayXMLHelper.schemaString)

Example 4 with BioSource

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

the class PathwayReader method addObjectBioSource.

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

Aggregations

Element (org.jdom.Element)4 BioSource (org.vcell.pathway.BioSource)4 BioPaxObject (org.vcell.pathway.BioPaxObject)3 GroupObject (org.vcell.pathway.GroupObject)1 PathwayXMLHelper.schemaString (org.vcell.pathway.PathwayXMLHelper.schemaString)1 PublicationXref (org.vcell.pathway.PublicationXref)1 RelationshipXref (org.vcell.pathway.RelationshipXref)1 Xref (org.vcell.pathway.Xref)1 BioSourceProxy (org.vcell.pathway.persistence.BiopaxProxy.BioSourceProxy)1