/** * Adds a Reaction instance to the listOfReactions of this Model. * * @param reaction * @return {@code true} if the {@link #listOfReactions} was changed as a * result of this call. */ public boolean addReaction(Reaction reaction) { return getListOfReactions().add(reaction); }
/** * Gets the n-th {@link Reaction} object in this Model. * * @param n * the reaction index * @return the n-th {@link Reaction} of this Model. */ public Reaction getReaction(int n) { return getListOfReactions().get(n); }
/** * Removes the n-th {@link Reaction} of the {@link Model}. * * @param n * @return the removed element. */ public Reaction removeReaction(int n) { return getListOfReactions().remove(n); }
/** * Removes a reaction from the model. * * @param reac * @return {@code true} if the {@link Reaction} was found and removed. */ public boolean removeReaction(Reaction reac) { return getListOfReactions().remove(reac); }
/** * Returns the number of {@link KineticLaw}s of this {@link Model}. * * @return the number of {@link KineticLaw}s of this {@link Model}. */ public int getKineticLawCount() { int count = 0; if (isSetListOfReactions()) { for (Reaction r : getListOfReactions()) { if (r.isSetKineticLaw()) { count++; } } } return count; }
/** * Returns the number of {@link ModifierSpeciesReference}s in the * {@link Model}. * * @return the number of {@link ModifierSpeciesReference}s in the * {@link Model}. */ public int getModifierSpeciesReferenceCount() { int count = 0; if (isSetListOfReactions()) { for (Reaction r : getListOfReactions()) { count += r.getModifierCount(); } } return count; }
/** * Returns all {@link ModifierSpeciesReference}s, registered in * any {@link Reaction}. * * @return all {@link ModifierSpeciesReference} contained in this * {@link Model}. */ public Set<ModifierSpeciesReference> getModifierSpeciesReferences() { Set<ModifierSpeciesReference> listOfModifiers = new HashSet<ModifierSpeciesReference>(); if (isSetListOfReactions()) { for (Reaction r : getListOfReactions()) { if (r.isSetListOfModifiers()) { listOfModifiers.addAll(r.getListOfModifiers()); } } } return listOfModifiers; }
/** * Returns the number of {@link SpeciesReference}s of this {@link Model}. * * @return the number of {@link SpeciesReference}s of this {@link Model}. */ public int getSpeciesReferenceCount() { int count = 0; if (isSetListOfReactions()) { for (Reaction r : getListOfReactions()) { count += r.getReactantCount() + r.getProductCount(); } } return count; }
public static boolean isSpeciesReference(Model m, String name) { if (m.isSetListOfReactions()) { for (Reaction r : m.getListOfReactions()) { if (r.getReactant(name) != null || r.getProduct(name) != null || r.getModifier(name) != null) { return true; } } } return false; }
for (Reaction reaction : model.getListOfReactions()) {
@Override public boolean check(ValidationContext ctx, Model m) { if (m.isSetListOfReactions() || m.isListOfReactionsEmpty()) { return new UnknownElementValidationFunction<TreeNodeWithChangeSupport>().check(ctx, m.getListOfReactions()); } return true; } };
@Override public boolean check(ValidationContext ctx, Model m) { if (m.isSetListOfReactions() || m.isListOfReactionsEmpty()) { return new UnknownAttributeValidationFunction<TreeNodeWithChangeSupport>().check(ctx, m.getListOfReactions()); } return true; } };
/** * Returns the number of parameters that are contained within kineticLaws in * the reactions of this model. * * @return the number of parameters that are contained within kineticLaws in * the reactions of this model. */ public int getLocalParameterCount() { int count = 0; if (isSetListOfReactions()) { for (Reaction reaction : getListOfReactions()) { if (reaction.isSetKineticLaw()) { count += reaction.getKineticLaw().getLocalParameterCount(); } } } return count; }
/** * Returns the number of {@link StoichiometryMath} in the {@link Model}. * * @return the number of {@link StoichiometryMath} in the {@link Model}. * @deprecated since SBML L3V1 */ @Deprecated public int getStoichiometryMathCount() { int count = 0; if (isSetListOfReactions()) { for (Reaction r : getListOfReactions()) { for (SpeciesReference sr : r.getListOfReactants()) { if (sr.isSetStoichiometryMath()) { count++; } } for (SpeciesReference sr : r.getListOfProducts()) { if (sr.isSetStoichiometryMath()) { count++; } } } } return count; }
for (Reaction r : m.getListOfReactions()) { if (r.isSetKineticLaw()) { KineticLaw kl = r.getKineticLaw();
private Model flattenModel(Model modelOfSubmodel) { flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfReactions()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfCompartments()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfConstraints()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfEvents()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfFunctionDefinitions()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfParameters()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfRules()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfSpecies()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfUnitDefinitions()); return modelOfSubmodel; }
for (Reaction r: m.getListOfReactions())
private void processReactions() throws PluginConfigurationException { ListOf<Reaction> reactions = model.getListOfReactions(); for (int i = 0; i < reactions.size(); i++) { Reaction reaction = reactions.get(i);
ListOf<Reaction> reactions = model.getListOfReactions(); for (int i = 0; i < reactions.size(); i++) { Reaction reaction = reactions.get(i);
mergeListsOfModels(previousModel.getListOfEvents(), previousModel, mergedModel); mergeListsOfModels(previousModel.getListOfUnitDefinitions(), previousModel, mergedModel); mergeListsOfModels(previousModel.getListOfReactions(), previousModel, mergedModel); mergeListsOfModels(previousModel.getListOfParameters(), previousModel, mergedModel); mergeListsOfModels(previousModel.getListOfInitialAssignments(), previousModel, mergedModel); mergeListsOfModels(currentModel.getListOfEvents(), currentModel, mergedModel); mergeListsOfModels(currentModel.getListOfUnitDefinitions(), currentModel, mergedModel); mergeListsOfModels(currentModel.getListOfReactions(), currentModel, mergedModel); mergeListsOfModels(currentModel.getListOfParameters(), currentModel, mergedModel); mergeListsOfModels(currentModel.getListOfInitialAssignments(), currentModel, mergedModel);