use of org.vcell.pathway.Pathway in project vcell by virtualcell.
the class BioPAXPathwayModelTreeNode method getNewChildren.
public List<BioPAXTreeNode> getNewChildren() {
Set<BioPaxObject> objects = getPathwayModel().getBiopaxObjects();
Map<Class<?>, Set<BioPaxObject>> subclassMap = BioPAXTreeMaker.divideBySubclasses(BioPaxObject.class, objects);
List<BioPAXTreeNode> childrenNew = new ArrayList<BioPAXTreeNode>();
for (Map.Entry<Class<?>, Set<BioPaxObject>> entry : subclassMap.entrySet()) {
Class<?> subclass = entry.getKey();
Set<BioPaxObject> objectsOfSubclass = entry.getValue();
List<BioPaxObject> objectsOfSubclassList = new ArrayList<BioPaxObject>();
objectsOfSubclassList.addAll(objectsOfSubclass);
childrenNew.add(new BioPAXObjectListTreeNode<BioPaxObject>(getPathwayModel(), objectsOfSubclassList, subclass, this));
}
// for(BioPaxObject object : objects) {
// children.add(
// new BioPAXMessageTreeNode(getPathwayModel(), object.toString(), this));
// }
// TODO
int nObjects = pathwayModel.getBiopaxObjects().size();
Pathway topLevelPathway = pathwayModel.getTopLevelPathway();
if (topLevelPathway != null) {
List<String> nameList = topLevelPathway.getName();
if (nameList != null && !nameList.isEmpty()) {
}
}
labelText = nObjects + " objects";
return childrenNew;
}
use of org.vcell.pathway.Pathway in project vcell by virtualcell.
the class PathwayProducerBiopax3 method addContentPathway.
// pathwayOrder PathwayStep multiple
// pathwayComponent Interaction multiple
// pathwayComponent Pathway multiple
// organism BioSource single
private Element addContentPathway(BioPaxObject bpObject, Element element) {
element = addContentEntity(bpObject, element);
Pathway ob = (Pathway) bpObject;
Element tmpElement = null;
if (ob.getPathwayOrder() != null && ob.getPathwayOrder().size() > 0) {
List<PathwayStep> list = ob.getPathwayOrder();
for (PathwayStep item : list) {
tmpElement = new Element("pathwayOrder", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
// othervise both proxies will be filled out - while in reality one of them is "fake" and should be disposed of
if (ob.getPathwayComponentInteraction() != null && ob.getPathwayComponentInteraction().size() > 0) {
List<Interaction> list = ob.getPathwayComponentInteraction();
for (Interaction item : list) {
tmpElement = new Element("pathwayComponent", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getPathwayComponentPathway() != null && ob.getPathwayComponentPathway().size() > 0) {
List<Pathway> list = ob.getPathwayComponentPathway();
for (Pathway item : list) {
tmpElement = new Element("pathwayComponent", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getOrganism() != null) {
tmpElement = new Element("organism", bp);
addIDToProperty(tmpElement, ob.getOrganism());
mustPrintObject(ob.getOrganism());
element.addContent(tmpElement);
}
return element;
}
use of org.vcell.pathway.Pathway in project vcell by virtualcell.
the class PathwayProducerBiopax3 method addContentControl.
// controller Pathway multiple
// controller PhysicalEntity multiple
// controlType String single
// controlled Interaction single
// controlled Pathway single
private Element addContentControl(BioPaxObject bpObject, Element element) {
element = addContentInteraction(bpObject, element);
Control ob = (Control) bpObject;
Element tmpElement = null;
if (ob.getPathwayControllers() != null && ob.getPathwayControllers().size() > 0) {
List<Pathway> list = ob.getPathwayControllers();
for (Pathway item : list) {
tmpElement = new Element("controller", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getPhysicalControllers() != null && ob.getPhysicalControllers().size() > 0) {
List<PhysicalEntity> list = ob.getPhysicalControllers();
for (PhysicalEntity item : list) {
tmpElement = new Element("controller", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getControlType() != null && ob.getControlType().length() > 0) {
tmpElement = new Element("controlType", bp);
tmpElement.setAttribute("datatype", schemaString, rdf);
tmpElement.setText(ob.getControlType());
element.addContent(tmpElement);
}
if (ob.getControlledInteraction() != null) {
tmpElement = new Element("controlled", bp);
addIDToProperty(tmpElement, ob.getControlledInteraction());
mustPrintObject(ob.getControlledInteraction());
element.addContent(tmpElement);
}
if (ob.getControlledPathway() != null) {
tmpElement = new Element("controlled", bp);
addIDToProperty(tmpElement, ob.getControlledPathway());
mustPrintObject(ob.getControlledPathway());
element.addContent(tmpElement);
}
return element;
}
use of org.vcell.pathway.Pathway in project vcell by virtualcell.
the class PathwayReader method addObjectPathway.
private Pathway addObjectPathway(Element element) {
Pathway pathway = new Pathway();
addAttributes(pathway, element);
for (Object child : element.getChildren()) {
if (child instanceof Element) {
Element childElement = (Element) child;
if (!addContentPathway(pathway, element, childElement)) {
showUnexpected(childElement, pathway);
}
}
}
pathwayModel.add(pathway);
return pathway;
}
Aggregations