Search in sources :

Example 1 with Process

use of org.vcell.pathway.BioPAXUtil.Process in project vcell by virtualcell.

the class PathwayMapping method createReactionStepsFromTableRow.

private void createReactionStepsFromTableRow(BioModel bioModel, ComplexAssembly bioPaxObject, double stoich, String id, String location, ArrayList<ConversionTableRow> conversionTableRows, boolean addSubunits) throws Exception {
    // get participants from table rows
    if (bioModel == null) {
        return;
    }
    // there is just one "normal" reaction but it is possible to have controls associated to it, we take them too
    for (Process process : BioPAXUtil.getAllProcesses(bioModel.getPathwayModel(), bioPaxObject)) {
        ArrayList<ConversionTableRow> participants = new ArrayList<ConversionTableRow>();
        for (ConversionTableRow ctr : conversionTableRows) {
            // find the participants of this process
            if (ctr.interactionId() == null) {
                // proteins that are brought in as molecular type only have interaction id == null
                continue;
            // because they don't participate to the interaction
            }
            if (ctr.interactionId().equals(bioPaxObject.getID())) {
                participants.add(ctr);
            }
        }
        // create reaction object
        String name = getSafetyName(process.getName() + "_" + location);
        ReactionStep reactionStep = bioModel.getModel().getReactionStep(name);
        if (reactionStep == null) {
            // create a new reactionStep object
            ReactionStep simpleReactionStep = bioModel.getModel().createSimpleReaction(bioModel.getModel().getStructure(location));
            simpleReactionStep.setName(name);
            RelationshipObject newRelationship = new RelationshipObject(simpleReactionStep, bioPaxObject);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStep(bioModel, process, simpleReactionStep, newRelationship, participants, addSubunits);
            addKinetics(simpleReactionStep, process);
        } else {
            // bioModel.getModel().getReactionStep(safeId).setStructure(bioModel.getModel().getStructure(location));
            // add missing parts for the existing reactionStep
            RelationshipObject newRelationship = new RelationshipObject(reactionStep, bioPaxObject);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStep(bioModel, process, reactionStep, newRelationship, participants, addSubunits);
            addKinetics(reactionStep, process);
        }
    }
}
Also used : ReactionStep(cbit.vcell.model.ReactionStep) ArrayList(java.util.ArrayList) Process(org.vcell.pathway.BioPAXUtil.Process)

Example 2 with Process

use of org.vcell.pathway.BioPAXUtil.Process in project vcell by virtualcell.

the class PathwayMapping method createReactionStepsFromTableRow.

private void createReactionStepsFromTableRow(BioModel bioModel, Transport bioPaxObject, double stoich, String id, String location, ArrayList<ConversionTableRow> conversionTableRows, boolean addSubunits) throws Exception {
    if (bioModel == null) {
        return;
    }
    for (Process process : BioPAXUtil.getAllProcesses(bioModel.getPathwayModel(), bioPaxObject)) {
        // use user defined id as the name of the reaction name
        // get participants from table rows
        ArrayList<ConversionTableRow> participants = new ArrayList<ConversionTableRow>();
        for (ConversionTableRow ctr : conversionTableRows) {
            if (ctr.interactionId().equals(bioPaxObject.getID())) {
                participants.add(ctr);
            }
        }
        // create reaction object
        String name = getSafetyName(process.getName() + "_" + location);
        if (bioModel.getModel().getReactionStep(name) == null) {
            // create a new reactionStep object
            FluxReaction fluxReactionStep = bioModel.getModel().createFluxReaction((Membrane) bioModel.getModel().getStructure(location));
            fluxReactionStep.setName(name);
            RelationshipObject newRelationship = new RelationshipObject(fluxReactionStep, bioPaxObject);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStep(bioModel, process, fluxReactionStep, newRelationship, participants, addSubunits);
        } else {
            // bioModel.getModel().getReactionStep(safeId).setStructure(bioModel.getModel().getStructure(location));
            // add missing parts for the existing reactionStep
            RelationshipObject newRelationship = new RelationshipObject(bioModel.getModel().getReactionStep(name), bioPaxObject);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStep(bioModel, process, bioModel.getModel().getReactionStep(name), newRelationship, participants, addSubunits);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) Process(org.vcell.pathway.BioPAXUtil.Process) FluxReaction(cbit.vcell.model.FluxReaction)

Example 3 with Process

use of org.vcell.pathway.BioPAXUtil.Process in project vcell by virtualcell.

the class PathwayMapping method createReactionStepsFromTableRow.

private void createReactionStepsFromTableRow(BioModel bioModel, Conversion conversion, double stoich, String id, String location, boolean addSubunits) throws Exception {
    // use user defined id as the name of the reaction name
    if (bioModel == null) {
        return;
    }
    Set<Process> processes = BioPAXUtil.getAllProcesses(bioModel.getPathwayModel(), conversion);
    for (Process process : processes) {
        String name = getSafetyName(process.getName() + "_" + location);
        if (bioModel.getModel().getReactionStep(name) == null) {
            // create a new reactionStep object
            ReactionStep simpleReactionStep = bioModel.getModel().createSimpleReaction(bioModel.getModel().getStructure(location));
            simpleReactionStep.setName(name);
            RelationshipObject newRelationship = new RelationshipObject(simpleReactionStep, conversion);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStepFromPathway(bioModel, process, simpleReactionStep, newRelationship, addSubunits);
        } else {
            bioModel.getModel().getReactionStep(name).setStructure(bioModel.getModel().getStructure(location));
            // add missing parts for the existing reactionStep
            RelationshipObject newRelationship = new RelationshipObject(bioModel.getModel().getReactionStep(name), conversion);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStepFromPathway(bioModel, process, bioModel.getModel().getReactionStep(name), newRelationship, addSubunits);
        }
    }
}
Also used : ReactionStep(cbit.vcell.model.ReactionStep) Process(org.vcell.pathway.BioPAXUtil.Process)

Example 4 with Process

use of org.vcell.pathway.BioPAXUtil.Process in project vcell by virtualcell.

the class PathwayMapping method createReactionStepsFromBioPaxObject.

private void createReactionStepsFromBioPaxObject(BioModel bioModel, Conversion conversion, boolean addSubunits) throws Exception {
    if (bioModel == null) {
        return;
    }
    for (Process process : BioPAXUtil.getAllProcesses(bioModel.getPathwayModel(), conversion)) {
        String name = process.getName();
        if (bioModel.getModel().getReactionStep(name) == null) {
            // create a new reactionStep object
            ReactionStep simpleReactionStep = bioModel.getModel().createSimpleReaction(bioModel.getModel().getStructures()[0]);
            simpleReactionStep.setName(name);
            RelationshipObject newRelationship = new RelationshipObject(simpleReactionStep, conversion);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStepFromPathway(bioModel, process, simpleReactionStep, newRelationship, addSubunits);
        } else {
            // add missing parts for the existing reactionStep
            RelationshipObject newRelationship = new RelationshipObject(bioModel.getModel().getReactionStep(name), conversion);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStepFromPathway(bioModel, process, bioModel.getModel().getReactionStep(name), newRelationship, addSubunits);
        }
    }
}
Also used : ReactionStep(cbit.vcell.model.ReactionStep) Process(org.vcell.pathway.BioPAXUtil.Process)

Example 5 with Process

use of org.vcell.pathway.BioPAXUtil.Process in project vcell by virtualcell.

the class PathwayMapping method createReactionStepsFromTableRow.

private void createReactionStepsFromTableRow(BioModel bioModel, Conversion bioPaxObject, double stoich, String id, String location, ArrayList<ConversionTableRow> conversionTableRows, boolean addSubunits) throws Exception {
    // get participants of this reaction from table rows
    if (bioModel == null) {
        return;
    }
    for (Process process : BioPAXUtil.getAllProcesses(bioModel.getPathwayModel(), bioPaxObject)) {
        ArrayList<ConversionTableRow> participants = new ArrayList<ConversionTableRow>();
        for (ConversionTableRow ctr : conversionTableRows) {
            if (ctr.interactionId() == null) {
                continue;
            }
            if (ctr.interactionId().equals(bioPaxObject.getID())) {
                participants.add(ctr);
            }
        }
        // create reaction object
        String name = getSafetyName(process.getName() + "_" + location);
        ReactionStep reactionStep = bioModel.getModel().getReactionStep(name);
        if (reactionStep == null) {
            // create a new reactionStep object
            ReactionStep simpleReactionStep = bioModel.getModel().createSimpleReaction(bioModel.getModel().getStructure(location));
            simpleReactionStep.setName(name);
            RelationshipObject newRelationship = new RelationshipObject(simpleReactionStep, bioPaxObject);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStep(bioModel, process, simpleReactionStep, newRelationship, participants, addSubunits);
            addKinetics(simpleReactionStep, process);
        } else {
            // bioModel.getModel().getReactionStep(safeId).setStructure(bioModel.getModel().getStructure(location));
            // add missing parts for the existing reactionStep
            RelationshipObject newRelationship = new RelationshipObject(reactionStep, bioPaxObject);
            bioModel.getRelationshipModel().addRelationshipObject(newRelationship);
            createReactionStep(bioModel, process, reactionStep, newRelationship, participants, addSubunits);
            addKinetics(reactionStep, process);
        }
    }
}
Also used : ReactionStep(cbit.vcell.model.ReactionStep) ArrayList(java.util.ArrayList) Process(org.vcell.pathway.BioPAXUtil.Process)

Aggregations

Process (org.vcell.pathway.BioPAXUtil.Process)5 ReactionStep (cbit.vcell.model.ReactionStep)4 ArrayList (java.util.ArrayList)3 FluxReaction (cbit.vcell.model.FluxReaction)1