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;
}
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;
}
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;
}
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;
}
Aggregations