9 #include <tr1proxy/rr_memory.h>
10 #include "sbml/math/ASTNode.h"
11 #include "rrExporter.h"
12 #include "rrStringListContainer.h"
13 #include "rrHashTable.h"
27 using libsbml::SBMLDocument;
28 using libsbml::ASTNode;
31 using libsbml::UnitDefinition;
32 using libsbml::KineticLaw;
46 SBMLDocument* getSBMLDocument();
61 ASTNode replaceSymbol(ASTNode* node,
const std::string& oldId,
const std::string& newId);
62 bool exists(
const std::string& sId);
63 bool getNthParameterHasValue(
const int& nReactionIndex,
const int& nParameterIndex);
64 bool getNthUseValuesFromTriggerTime(
const int& arg);
65 bool hasInitialAmount(
const std::string& sId);
66 bool hasInitialConcentration(
const std::string& sId);
67 bool hasSBOTerm(
const std::string& sId);
68 bool hasValue(
const std::string& sId);
83 bool isCompartment(
const std::string& sId);
84 bool isConstantImpl(
const std::string& sId);
85 bool isFloating(
const std::string& sId);
86 bool isReactionReversible(
const int& nIndex);
87 bool isSpecies (
const std::string& sId);
88 bool multiplyCompartment(
const std::string& sbmlId, std::string& compartmentId);
89 bool needEmptySetNode(Model model);
90 bool needSinkNode(Model model);
91 bool needSourceNode(Model model);
92 double getNthParameterValue(
const int& nReactionIndex,
const int& nParameterIndex);
93 double getNthProductStoichiometryDouble(
const int& nIndex,
const int& nProduct);
94 double getNthReactantStoichiometryDouble(
const int& nIndex,
const int& nReactant);
95 double getValue(
const std::string& sId);
96 int checkConsistency();
97 int getNthProductStoichiometry(
const int& nIndex,
const int& nProduct);
98 int getNthReactantStoichiometry(
const int& nIndex,
const int& nReactant);
99 int getNumBoundarySpecies();
100 int getNumCompartments();
101 int getNumConstraints();
104 int getNumFloatingSpecies();
105 int getNumFunctionDefinitions();
106 int getNumGlobalParameters();
107 int getNumInitialAssignments();
113 int getNumParameters(
int reaction);
115 int getNumProducts(
const int& var0);
116 int getNumReactants(
const int& var0);
121 int getNumReactions();
124 int getSBOTerm(
const std::string& sId);
125 std::pair<std::string, std::string> getNthInitialAssignmentPair(
const int& nIndex);
126 SBase* getElement(
const std::string& sId);
128 std::string addEmptySetNode(
const std::string& sbml);
129 std::string addEmptySetNodes(
const std::string& sbml);
130 std::string addMissingModifiers(
const std::string& sModel);
131 std::string addSourceSinkNodes(
const std::string& sbml);
132 std::string convertLevel1ToLevel2Impl(
const std::string& sSBML);
133 std::string convertLevel2ToLevel1Impl(
const std::string& sSBML);
135 std::string convertPowImpl(
const std::string& sSBML);
136 std::string convertSBML(
const std::string& sModel,
const int& nLevel,
const int& nVersion);
137 std::string convertSBML(
const std::string& sModel,
const int& nLevel,
const int& nVersion,
bool throwError);
138 std::string convertTimeToCSymbol(
const std::string& sArg,
const std::string& sTimeSymbol);
139 std::string fixCommonIssues(
const std::string& sbml);
140 std::string fixCommonIssues(
const std::string& sbml,
const std::string& programName,
const std::string& programVersion);
141 std::string fetAnnotatedModel(
const std::string& targetSBML,
const std::string& sourceSBML,
bool checkModelId);
143 std::string getAnnotation(
const std::string& sId);
144 std::string getCompartmentIdBySpeciesId(
const std::string& sId);
150 std::string getMetaId(
const std::string& sId);
153 std::string getNotes(
const std::string& sId);
154 std::string getNthBoundarySpeciesId(
const int& nIndex);
155 std::string getNthBoundarySpeciesName(
const int& nIndex);
156 std::string getNthCompartmentId(
const int& nIndex);
157 std::string getNthCompartmentName(
const int& nIndex);
158 std::string getNthConstraint(
const int& nIndex, std::string& sMessage);
159 std::string getNthFloatingSpeciesId(
const int& nIndex);
160 std::string getNthFloatingSpeciesName(
const int& nIndex);
161 std::string getNthGlobalParameterId(
const int& nIndex);
162 std::string getNthGlobalParameterName(
const int& nIndex);
163 std::string getNthInitialAssignment(
const int& nIndex);
164 std::string getNthParameterId(
const int& nReactionIndex,
const int& nParameterIndex);
165 std::string getNthParameterName(
const int& nReactionIndex,
const int& nParameterIndex);
166 std::string getNthProductName(
const int& nIndex,
const int& nProduct);
167 std::string getNthReactantName(
const int& nIndex,
const int& nReactant);
168 std::string getNthReactionId(
const int& nIndex);
169 std::string getNthReactionName(
const int& nIndex);
170 std::string getNthRule(
const int& nIndex);
171 std::string getNthRuleType(
const int& arg);
172 std::string getOutsideCompartment(
const std::string& var0);
175 std::string getSBOCapableSBML(
const std::string& sModel);
176 std::string removeJD1Layout(
const std::string& sSBML);
177 std::string removeJD2Layout(
const std::string& sSBML);
178 std::string removeLayoutInformation(
const std::string& sSBML);
179 std::string validateSBML(
const std::string& sModel);
180 std::string validateWithConsistency(
const std::string& sModel);
181 std::vector<std::string> getBuiltinFunctionInfo(
const std::string& var0);
182 std::vector<std::string> getBuiltinFunctions();
183 void changeConstantForRules(Model* model);
185 void loadFromFile(
const std::string& fileName);
186 void loadParameterPromotedSBML(
const std::string& var0,
const std::string& sTimeSymbol);
187 void loadSBML(
const std::string& var0);
188 void loadSBML(
const std::string& var0,
const std::string& sTimeSymbol);
190 void setAnnotation(
const std::string& sId,
const std::string& sAnnotation);
192 void setNotes(
const std::string& sId,
const std::string& sNotes);
193 void setSBOTerm(
const std::string& sId,
const int& nSBOTerm);
194 void setValue(
const std::string& sId,
const double& dValue);
195 void setValue(Model* model,
const std::string&
id,
const double& value,
const bool& throwIfNotFound);
198 std::string getNthBoundarySpeciesCompartmentName(
const int& nIndex);
215 std::string getNthFloatingSpeciesCompartmentName(
int index);
222 static std::string convertTime(
const std::string& sArg,
const std::string& sTimeSymbol);
230 static StringList getSymbols(
const ASTNode* math);
235 stack<std::string> getMatchForSymbol(
const std::string& sbmlId);
246 static deque<Rule*> reorderAssignmentRules(deque<Rule*>& assignmentRules);
248 static void fillStack(stack<std::string>& stack,
SBMLSymbol& symbol);
257 static void reorderRules(SBMLDocument& oc, Model& model);
261 static std::string getId(SBase& element);
262 static std::string convertMathMLToString(
const std::string& sMathML);
264 static std::string convertStringToMathML(
const std::string& var0);
271 SBMLDocument *mSBMLDoc;
283 ASTNode changeTimeToCSymbol(ASTNode* node,
const std::string& name,
const int& type);
284 bool addMissingModifiers(Model *oModel);
285 StringList getSymbols(
const std::string& formula);
287 std::string getInitialAssignmentFor(
const std::string& sbmlId);
289 std::string getRuleFor(
const std::string& sbmlId);
290 void addDependenciesToList(
const ASTNode* node,
StringList& sResult);
291 void addMissingParameter(
const std::string& parameterId, SBMLDocument *doc);
292 void buildSymbolTable();
293 void changeNameToCSymbol(Model* model,
const std::string& name,
const int& type);
294 void changePow(ASTNode* node);
296 void lookForDependencies();
297 void removeSpatialSizeUnitsFromSpecies(SBMLDocument* doc);
298 void removeSubstanceUnitsFromKineticLaws(SBMLDocument* doc);
299 void removeTimeUnitsFromKineticLaws(SBMLDocument* doc);
300 void updateDependencies(
const std::string& sbmlId);
301 void upgradeToL2V4IfNecessary(SBMLDocument* doc);
311 static std::string getName(
const SBase* element);
312 static void modifyKineticLaws(SBMLDocument& oSBMLDoc, Model &oModel);
313 static void modifyKineticLawsForLocalParameters(KineticLaw& oLaw,
const std::string& reactionId, Model &oModel);
314 static void modifyKineticLawsForReaction(KineticLaw& oLaw,
const std::string& reactionId, Model &oModel);
315 static void changeSymbol(Model& oModel,
const std::string& sTimeSymbol,
const int& targetType);
316 static void changeTimeSymbol(Model& model,
const std::string& timeSymbol);
318 static void changeParameterName(ASTNode& node,
const std::string& sParameterName,
const std::string& sPrefix);
319 static void getSymbols(
const ASTNode* node,
StringList& list);
324 static const std::string STR_DoubleFormat;
333 std::string SBML_formulaToStdString(
const ASTNode *tree);
Methods to query various information from an SBML document.
Definition: rrNOMSupport.h:41
bool isBoundary(const std::string &sId)
Checks whether the element for the given SBML id is a boundary species.
Definition: rrSBMLSymbol.h:16
Definition: rrStringListContainer.h:18
Definition: rrStringList.h:19
Definition: rrHashTable.h:17
C_DECL_SPEC char *rrcCallConv getModelId(RRHandle handle)
Returns the id of currently loaded SBML model.
C_DECL_SPEC void rrcCallConv setModelId(RRHandle handle, char *id)
Sets the id of currently loaded SBML model.
C_DECL_SPEC char *rrcCallConv getModelName(RRHandle handle)
Returns the name of currently loaded SBML model.
C_DECL_SPEC char *rrcCallConv getKineticLaw(RRHandle handle, const char *rid)
Get the kinetic law for a existing reaction in the current model.
C_DECL_SPEC char *rrcCallConv getSBML(RRHandle handle)
Retrieve the SBML model that was last loaded into roadRunner.
C_DECL_SPEC bool rrcCallConv loadSBML(RRHandle handle, const char *sbml)
Load a model from an SBML string.
C_DECL_SPEC bool rrcCallConv reset(RRHandle handle)
Resets all variables of the model to their current initial values. Does not change the parameters.
C_DECL_SPEC bool rrcCallConv getValue(RRHandle handle, const char *symbolId, double *value)
Get the value for a given symbol, use getAvailableTimeCourseSymbols(void) for a list of symbols.
C_DECL_SPEC bool rrcCallConv setValue(RRHandle handle, const char *symbolId, const double value)
Set the value for a given symbol, use getAvailableTimeCourseSymbols(void) for a list of symbols.
C_DECL_SPEC char *rrcCallConv getlibSBMLVersion(RRHandle handle)
Retrieve the current version number of the libSBML library.
C_DECL_SPEC char *rrcCallConv getParamPromotedSBML(RRHandle handle, const char *sArg)
Promote any local parameters to global status.