Search in sources :

Example 11 with Interaction

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);
}
Also used : Control(org.vcell.pathway.Control) PhysicalEntity(org.vcell.pathway.PhysicalEntity) BioPaxObject(org.vcell.pathway.BioPaxObject) Interaction(org.vcell.pathway.Interaction) ArrayList(java.util.ArrayList)

Example 12 with Interaction

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;
}
Also used : Xref(org.vcell.pathway.Xref) UnificationXref(org.vcell.pathway.UnificationXref) RelationshipXref(org.vcell.pathway.RelationshipXref) PublicationXref(org.vcell.pathway.PublicationXref) SimpleReaction(cbit.vcell.model.SimpleReaction) BiochemicalReactionImpl(org.vcell.pathway.BiochemicalReactionImpl) Interaction(org.vcell.pathway.Interaction) FluxReaction(cbit.vcell.model.FluxReaction) TransportImpl(org.vcell.pathway.TransportImpl)

Example 13 with 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;
    }
}
Also used : InteractionProxy(org.vcell.pathway.persistence.BiopaxProxy.InteractionProxy) Pathway(org.vcell.pathway.Pathway) Interaction(org.vcell.pathway.Interaction) MolecularInteraction(org.vcell.pathway.MolecularInteraction) GeneticInteraction(org.vcell.pathway.GeneticInteraction) Element(org.jdom.Element) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject) PathwayProxy(org.vcell.pathway.persistence.BiopaxProxy.PathwayProxy)

Example 14 with Interaction

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;
}
Also used : BiochemicalPathwayStep(org.vcell.pathway.BiochemicalPathwayStep) PathwayStep(org.vcell.pathway.PathwayStep) Pathway(org.vcell.pathway.Pathway) Interaction(org.vcell.pathway.Interaction) MolecularInteraction(org.vcell.pathway.MolecularInteraction) GeneticInteraction(org.vcell.pathway.GeneticInteraction) Element(org.jdom.Element)

Aggregations

Interaction (org.vcell.pathway.Interaction)14 BioPaxObject (org.vcell.pathway.BioPaxObject)9 MolecularInteraction (org.vcell.pathway.MolecularInteraction)8 Element (org.jdom.Element)7 GeneticInteraction (org.vcell.pathway.GeneticInteraction)7 GroupObject (org.vcell.pathway.GroupObject)7 InteractionParticipant (org.vcell.pathway.InteractionParticipant)5 Pathway (org.vcell.pathway.Pathway)4 Complex (org.vcell.pathway.Complex)3 Protein (org.vcell.pathway.Protein)3 SmallMolecule (org.vcell.pathway.SmallMolecule)3 InteractionProxy (org.vcell.pathway.persistence.BiopaxProxy.InteractionProxy)3 BioModelEntityObject (cbit.vcell.model.BioModelEntityObject)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 BiochemicalPathwayStep (org.vcell.pathway.BiochemicalPathwayStep)2 Control (org.vcell.pathway.Control)2 Dna (org.vcell.pathway.Dna)2 DnaRegion (org.vcell.pathway.DnaRegion)2 InteractionImpl (org.vcell.pathway.InteractionImpl)2