Search in sources :

Example 36 with Reactant

use of cbit.vcell.model.Reactant in project vcell by virtualcell.

the class ReactionSpec method gatherIssues.

/**
 * Insert the method's description here.
 * Creation date: (11/1/2005 10:06:04 AM)
 * @param issueList java.util.Vector
 */
public void gatherIssues(IssueContext issueContext, List<Issue> issueList, ReactionContext rc) {
    ReactionCombo r = new ReactionCombo(this, rc);
    ReactionStep step = getReactionStep();
    if (!isExcluded() && rc.getSimulationContext().isStoch() && (rc.getSimulationContext().getGeometry().getDimension() > 0)) {
        boolean haveParticle = false;
        boolean haveContinuous = false;
        for (ReactionParticipant p : step.getReactionParticipants()) {
            if (p instanceof Product || p instanceof Reactant) {
                SpeciesContextSpec candidate = rc.getSpeciesContextSpec(p.getSpeciesContext());
                if (candidate.isForceContinuous() && !candidate.isConstant()) {
                    haveParticle = true;
                } else if (!candidate.isForceContinuous() && !candidate.isConstant()) {
                    haveContinuous = true;
                }
            }
        }
        if (haveParticle && haveContinuous) {
            String msg = "Reaction " + step.getName() + " has both continuous and particle Participants.";
            String tip = "Mass conservation for reactions of binding between discrete and continuous species is handled approximately. <br>" + "To avoid any algorithmic approximation, which may produce undesired results, the user is advised to indicate <br>" + "the continuous species in those reactions as modifiers (i.e. 'catalysts') in the physiology.";
            issueList.add(new Issue(r, issueContext, IssueCategory.Identifiers, msg, tip, Issue.SEVERITY_WARNING));
        }
    }
}
Also used : Issue(org.vcell.util.Issue) ReactionStep(cbit.vcell.model.ReactionStep) Product(cbit.vcell.model.Product) ReactionParticipant(cbit.vcell.model.ReactionParticipant) Reactant(cbit.vcell.model.Reactant)

Example 37 with Reactant

use of cbit.vcell.model.Reactant in project vcell by virtualcell.

the class ReactPartTable method getReactionParticipant.

/**
 * This method was created in VisualAge.
 * @return cbit.vcell.model.ReactionParticipant
 * @param rset java.sql.ResultSet
 */
public ReactionParticipant getReactionParticipant(KeyValue rpKey, java.sql.ResultSet rset) throws java.sql.SQLException, DataAccessException {
    ReactionParticipant rp = null;
    KeyValue key = rpKey;
    String role = rset.getString(ReactPartTable.table.role.toString());
    int stoichiometry = rset.getInt(ReactPartTable.table.stoich.toString());
    if (role.equals(ROLE_CATALYST)) {
        rp = new Catalyst(key, null, null);
    } else if (role.equals(ROLE_PRODUCT)) {
        rp = new Product(key, null, null, stoichiometry);
    } else if (role.equals(ROLE_REACTANT)) {
        rp = new Reactant(key, null, null, stoichiometry);
    } else if (role.equals(ROLE_FLUX)) {
        rp = new FluxReaction.Flux(key, null, null);
    } else {
        throw new DataAccessException("unexpected value of " + ReactPartTable.table.role.toString() + "'" + role + "'");
    }
    rp.setStoichiometry(stoichiometry);
    return rp;
}
Also used : KeyValue(org.vcell.util.document.KeyValue) Product(cbit.vcell.model.Product) ReactionParticipant(cbit.vcell.model.ReactionParticipant) Reactant(cbit.vcell.model.Reactant) Catalyst(cbit.vcell.model.Catalyst) DataAccessException(org.vcell.util.DataAccessException)

Aggregations

Reactant (cbit.vcell.model.Reactant)37 Product (cbit.vcell.model.Product)33 ReactionParticipant (cbit.vcell.model.ReactionParticipant)32 ReactionStep (cbit.vcell.model.ReactionStep)25 SpeciesContext (cbit.vcell.model.SpeciesContext)22 SimpleReaction (cbit.vcell.model.SimpleReaction)14 FluxReaction (cbit.vcell.model.FluxReaction)12 Model (cbit.vcell.model.Model)12 Structure (cbit.vcell.model.Structure)12 ArrayList (java.util.ArrayList)12 Catalyst (cbit.vcell.model.Catalyst)11 Expression (cbit.vcell.parser.Expression)10 HashMap (java.util.HashMap)9 Kinetics (cbit.vcell.model.Kinetics)8 KineticsParameter (cbit.vcell.model.Kinetics.KineticsParameter)8 ReactionRule (cbit.vcell.model.ReactionRule)8 Membrane (cbit.vcell.model.Membrane)7 Issue (org.vcell.util.Issue)7 Feature (cbit.vcell.model.Feature)6 LumpedKinetics (cbit.vcell.model.LumpedKinetics)6