use of org.vcell.pathway.Interaction in project vcell by virtualcell.
the class PathwayTableModel method refreshData.
private void refreshData() {
if (pathwayModel == null) {
setData(null);
return;
}
List<BioPaxObject> allPathwayObjectList = new ArrayList<BioPaxObject>();
for (BioPaxObject bpObject1 : pathwayModel.getBiopaxObjects()) {
if (bpObject1 instanceof PhysicalEntity || (bpObject1 instanceof Interaction && !(bpObject1 instanceof Control))) {
allPathwayObjectList.add(bpObject1);
}
}
ArrayList<BioPaxObject> pathwayObjectList = new ArrayList<BioPaxObject>();
for (BioPaxObject bpObject : allPathwayObjectList) {
if (searchText == null || searchText.length() == 0 || getLabel(bpObject).toLowerCase().contains(searchText.toLowerCase()) || getType(bpObject).toLowerCase().contains(searchText.toLowerCase())) {
pathwayObjectList.add(bpObject);
bioPaxObjectImportedMap.put(bpObject, bioModel != null && bioModel.getPathwayModel().find(bpObject) != null);
}
}
setData(pathwayObjectList);
}
use of org.vcell.pathway.Interaction in project vcell by virtualcell.
the class AnnotationMapping method createInteraction.
private Interaction createInteraction(ReactionStep reactionStep, ArrayList<Xref> xRef, ArrayList<String> name) {
Interaction interaction = null;
if (reactionStep instanceof SimpleReaction) {
interaction = new BiochemicalReactionImpl();
} else if (reactionStep instanceof FluxReaction) {
interaction = new TransportImpl();
}
interaction.setName(name);
interaction.setID("BIOMODEL_" + reactionStep.getName());
for (Xref ref : xRef) {
interaction.getxRef().add(ref);
}
return interaction;
}
use of org.vcell.pathway.Interaction in project vcell by virtualcell.
the class PathwayReaderBiopax3 method addContentPathway.
private boolean addContentPathway(Pathway pathway, Element element, Element childElement) {
if (addContentEntity(pathway, element, childElement)) {
return true;
}
/**
* BioSource organism
* ArrayList<Interaction> pathwayComponentInteraction
* ArrayList<Pathway> pathwayComponentPathway
* ArrayList<PathwayStep> pathwayOrder
*/
if (childElement.getName().equals("organism")) {
pathway.setOrganism(addObjectBioSource(childElement));
return true;
} else if (childElement.getName().equals("pathwayOrder")) {
pathway.getPathwayOrder().add(addObjectPathwayStep(childElement));
return true;
} else if (childElement.getName().equals("pathwayComponent")) {
if (childElement.getChildren().size() == 0) {
// if there are no children it must be a resource inside another object
// we don't know yet whether it's Interaction or Pathway, we make a proxy for each
// at the time when we solve the references we'll find out which is fake
InteractionProxy proxyI = new InteractionProxy();
addAttributes(proxyI, childElement);
pathwayModel.add(proxyI);
pathway.getPathwayComponentInteraction().add(proxyI);
PathwayProxy proxyP = new PathwayProxy();
addAttributes(proxyP, childElement);
pathwayModel.add(proxyP);
pathway.getPathwayComponentPathway().add(proxyP);
return true;
} else {
// it's the real object declaration - could be an interaction or a pathway
for (Object child : childElement.getChildren()) {
if (child instanceof Element) {
if (((Element) child).getName().equals("Pathway")) {
Pathway thingie = addObjectPathway((Element) child);
pathway.getPathwayComponentPathway().add(thingie);
return true;
} else {
Interaction thingie = (Interaction) addObjectBioPaxObjectSubclass((Element) child);
if (thingie == null) {
return false;
} else {
pathway.getPathwayComponentInteraction().add(thingie);
return true;
}
}
}
}
}
return false;
} else {
return false;
}
}
use of org.vcell.pathway.Interaction 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;
}
Aggregations