use of org.vcell.pathway.BioPaxObject in project vcell by virtualcell.
the class PathwayGrouping method findGroupAncestor.
public BioPaxObject findGroupAncestor(Map<BioPaxObject, BioPaxObject> groupMap, BioPaxObject bpObject) {
BioPaxObject ancestor = groupMap.get(bpObject);
if (ancestor == null)
return bpObject;
else {
BioPaxObject temp = groupMap.get(ancestor);
while (temp != null) {
ancestor = temp;
temp = groupMap.get(ancestor);
}
return ancestor;
}
}
use of org.vcell.pathway.BioPaxObject in project vcell by virtualcell.
the class PathwayGrouping method updateBioPaxObjectList.
// get a list of independent biopax Objects including groupObjects
public Set<BioPaxObject> updateBioPaxObjectList(PathwayModel pathwayModel) {
Set<BioPaxObject> clonedOriginalList = new HashSet<BioPaxObject>(pathwayModel.getBiopaxObjects());
Set<BioPaxObject> removedList = new HashSet<BioPaxObject>();
for (BioPaxObject bpObject : clonedOriginalList) {
if (bpObject instanceof GroupObject) {
GroupObject gObject = (GroupObject) bpObject;
for (BioPaxObject bpo : gObject.getGroupedObjects()) {
removedList.add(bpo);
}
}
}
clonedOriginalList.removeAll(removedList);
return clonedOriginalList;
}
use of org.vcell.pathway.BioPaxObject in project vcell by virtualcell.
the class PathwayGrouping method updateGroupableList.
private HashSet<BioPaxObject> updateGroupableList(PathwayModel pathwayModel, HashSet<BioPaxObject> bpObjects) {
HashSet<BioPaxObject> groupable = new HashSet<BioPaxObject>();
Map<BioPaxObject, BioPaxObject> groupMap = pathwayModel.getGroupMap();
// the group object should be a tree structure. so we will group the parents of the selected objects together.
for (BioPaxObject bpObject : bpObjects) {
groupable.add(findGroupAncestor(groupMap, bpObject));
}
return groupable;
}
Aggregations