NOM version of libSBML. More...
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include "sbml/SBMLTypes.h"
#include "sbml/math/ASTNode.h"
#include <string>
#include <vector>
Go to the source code of this file.
Defines | |
#define | DLL_EXPORT |
#define | BUFFER_SIZE 1024 |
#define | FUNCDATAROWS 44 |
#define | FUNCDATACOLS 16 |
#define | GET_ID_IF_POSSIBLE(x) (x->isSetId() ? x->getId() : x->getName() ) |
#define | GET_NAME_IF_POSSIBLE(x) (x->isSetName() ? x->getName() : x->getId() ) |
Functions | |
DLL_EXPORT char * | getError () |
Returns the error message given the last error code generated. | |
DLL_EXPORT int | loadSBML (char *sbmlStr) |
Load SBML into the NOM. | |
DLL_EXPORT int | getNumErrors () |
Returns number of errors in SBML model. | |
DLL_EXPORT int | getNthError (int index, int *line, int *column, int *errorId, char **errorType, char **errorMsg) |
Returns details on the index^th error. | |
DLL_EXPORT int | validateSBML (char *cSBML) |
Validates the given SBML model. | |
DLL_EXPORT int | hasInitialAmount (char *sId, bool *isInitialAmount) |
Returns 0 (false) in the argument list if the species given by sId does not have an amount associated with it, otherwise returns 1 (true) | |
DLL_EXPORT int | hasInitialConcentration (char *cId, int *hasInitial) |
Returns 0 (false) in the argument list if the species given by sId does not have a concentration associated with it, otherwise returns 1 (true) | |
DLL_EXPORT int | getValue (char *sId, double *value) |
Get the value for a given symbol in the SBML. | |
DLL_EXPORT int | setValue (char *sId, double dValue) |
Set the value for a given symbol in the SBML. | |
DLL_EXPORT int | validate (char *sbmlStr) |
Retrusn 0 (false) the supplied SBML string is invalid, else returns 1 (true) | |
DLL_EXPORT int | getModelName (char **name) |
Return the model name in the current model. | |
DLL_EXPORT int | getModelId (char **sId) |
Return the model Id for the current model. | |
DLL_EXPORT int | setModelId (char *cId) |
Set the model Id for the current model. | |
DLL_EXPORT int | getNumFunctionDefinitions () |
Return the number of function definitions in the current model. | |
DLL_EXPORT int | getNumCompartments () |
Return the number of compartment in the current model. | |
DLL_EXPORT int | getNumReactions () |
Return the number of reactions in the current model. | |
DLL_EXPORT int | getNumFloatingSpecies () |
Return the number of floating species in the current model. | |
DLL_EXPORT int | getNumBoundarySpecies () |
Return the number of boundary species in the current model. | |
DLL_EXPORT int | getNumGlobalParameters () |
Return the number of global parameters in the current model. | |
DLL_EXPORT int | getNthGlobalParameterName (int nIndex, char **name) |
Returns the nIndex^th global parameter name. | |
DLL_EXPORT int | getNthGlobalParameterId (int nIndex, char **sId) |
Returns the nIndex^th global parameter Id. | |
DLL_EXPORT int | getNthFunctionDefinition (int index, char **fnId, int *numArgs, char ***argList, char **body) |
Collects information on the index^th function definition. | |
DLL_EXPORT int | getNthCompartmentName (int nIndex, char **name) |
Returns the nIndex^th compartment name. | |
DLL_EXPORT int | getNthCompartmentId (int nIndex, char **sId) |
Returns the nIndex^th compartment Id. | |
DLL_EXPORT int | getCompartmentIdBySpeciesId (char *cId, char **compId) |
Returns the compartment Id associated with a particular species Id. | |
DLL_EXPORT int | getListOfFloatingSpeciesIds (char ***IdList, int *numFloat) |
Returns a list of the Ids of the floating species. | |
DLL_EXPORT int | getNthFloatingSpeciesName (int nIndex, char **name) |
Returns the nIndex^th floating species name. | |
DLL_EXPORT int | getNthFloatingSpeciesId (int nIndex, char **sId) |
Returns the nIndex^th floating species Id. | |
DLL_EXPORT int | getListOfBoundarySpeciesIds (char ***IdList, int *numBoundary) |
Returns a list of the Ids of the boundary species. | |
DLL_EXPORT int | getNthBoundarySpeciesName (int nIndex, char **name) |
Returns the nIndex^th boundary species name. | |
DLL_EXPORT int | getNthBoundarySpeciesId (int nIndex, char **sId) |
Returns the nIndex^th boundary species Id. | |
DLL_EXPORT int | getNumRules () |
Returns the number of rules in the SBML model. | |
DLL_EXPORT int | getNthRule (int nIndex, char **rule, int *ruleType) |
Returns the nIndex^th rule from the current model. | |
DLL_EXPORT int | getNumEvents () |
Returns the number of events in the SBML model. | |
DLL_EXPORT int | getNthReactionName (int nIndex, char **name) |
Returns the nIndex^th reaction name. | |
DLL_EXPORT int | isReactionReversible (int arg, int *isReversible) |
Returns if reaction is reversible. | |
DLL_EXPORT int | getNthReactionId (int nIndex, char **sId) |
Returns the nIndex^th reaction Id. | |
DLL_EXPORT int | getNumReactants (int arg) |
Return the number of reactants for the arg^th reaction. | |
DLL_EXPORT int | getNumProducts (int arg) |
Return the number of reactants for the arg^th reaction. | |
DLL_EXPORT int | getNthReactantName (int arg1, int arg2, char **name) |
Return the name of the arg2^th reactant from the arg1^th reaction. | |
DLL_EXPORT int | getNthProductName (int arg1, int arg2, char **name) |
Return the name of the arg2^th reactant from the arg1^th reaction. | |
DLL_EXPORT int | getKineticLaw (int index, char **kineticLaw) |
Return the kinetic law of the index^th reaction. | |
DLL_EXPORT int | getNthReactantStoichiometry (int arg1, int arg2) |
Returns the arg2^th reactant stoichiometry from the arg1^th reaction. | |
DLL_EXPORT int | getNthProductStoichiometry (int arg1, int arg2) |
Returns the arg2^th product stoichiometry from the arg1^th reaction. | |
DLL_EXPORT int | getNumLocalParameters (int reactionIndex) |
Returns the number of local parameters. | |
DLL_EXPORT int | getNthLocalParameterName (int reactionIndex, int parameterIndex, char **sId) |
Returns the name of nth local parameter is a given reaction. | |
DLL_EXPORT int | getNthLocalParameterId (int reactionIndex, int parameterIndex, char **sId) |
Returns the Id of nth local parameter is a given reaction. | |
DLL_EXPORT int | getNthLocalParameterValue (int reactionIndex, int parameterIndex, double *value) |
Returns the value of the specificed local parameter. | |
DLL_EXPORT int | getParamPromotedSBML (char *inSBML, char **outSBML) |
Any local parameters in an SBML model are promoted to global status by this call. | |
DLL_EXPORT int | addMissingModifiers (char *inSBML, char **outSBML) |
Fills in any missing modifiers to the SBML file. | |
DLL_EXPORT int | convertMathMLToString (char *mathMLStr, char **infix) |
Converts a MathML string into infix notation. | |
DLL_EXPORT int | convertStringToMathML (char *infixStr, char **mathMLStr) |
Converts an infix string into MathML Notation. | |
DLL_EXPORT int | reorderRules (char **sbml) |
reorders rules in SBML | |
DLL_EXPORT int | convertSBML (char *inputModel, char **outputModel, int nLevel, int nVersion) |
converts input SBML to another level and version |
NOM version of libSBML.
DLL_EXPORT int addMissingModifiers | ( | char * | inSBML, |
char ** | outSBML | ||
) |
Fills in any missing modifiers to the SBML file.
[in] | SBML | is the input sbml string |
[out] | SBML | is output sbml string with modifiers added |
DLL_EXPORT int convertMathMLToString | ( | char * | mathMLStr, |
char ** | infix | ||
) |
Converts a MathML string into infix notation.
[in] | MathML | is the input string |
[out] | infix | notation is the output string |
Prepend an XML header if not already present.
DLL_EXPORT int convertSBML | ( | char * | inputModel, |
char ** | outputModel, | ||
int | nLevel, | ||
int | nVersion | ||
) |
converts input SBML to another level and version
[in] | inputModel | is the input SBML to be converted to another version |
[out] | outputModel | is the pointer to the output SBML |
[in] | nLevel | is the level of output SBML |
[in] | nVersion | is the version of output SBML |
DLL_EXPORT int convertStringToMathML | ( | char * | infixStr, |
char ** | mathMLStr | ||
) |
Converts an infix string into MathML Notation.
[in] | infix | is the input string |
[out] | MathML | notation is the output string |
DLL_EXPORT int getCompartmentIdBySpeciesId | ( | char * | cId, |
char ** | compId | ||
) |
Returns the compartment Id associated with a particular species Id.
[in] | cId | species Id |
[out] | sId | is the Id of the accociated species |
DLL_EXPORT char* getError | ( | ) |
Returns the error message given the last error code generated.
DLL_EXPORT int getKineticLaw | ( | int | index, |
char ** | kineticLaw | ||
) |
Return the kinetic law of the index^th reaction.
[in] | index | is the ith reaction to obtain the kinetic law from |
[out] | kineticLaw | is the string returned by the call |
DLL_EXPORT int getListOfBoundarySpeciesIds | ( | char *** | IdList, |
int * | numBoundary | ||
) |
Returns a list of the Ids of the boundary species.
[out] | IdList | is a array of char* containing the names of the boundary species |
[out] | numBoundary | is the number of boundary species in the list |
DLL_EXPORT int getListOfFloatingSpeciesIds | ( | char *** | IdList, |
int * | numFloat | ||
) |
Returns a list of the Ids of the floating species.
[out] | IdList | is a array of char* containing the names of the floating species |
[out] | numFloat | is the number of boundary species in the list |
DLL_EXPORT int getModelId | ( | char ** | sId | ) |
Return the model Id for the current model.
[out] | sId | the current model |
DLL_EXPORT int getModelName | ( | char ** | name | ) |
Return the model name in the current model.
[out] | name | of the model |
DLL_EXPORT int getNthBoundarySpeciesId | ( | int | nIndex, |
char ** | sId | ||
) |
Returns the nIndex^th boundary species Id.
[in] | nIndex | is the nIndex^th boundary spedcies Id |
[out] | sId | is the Id of the nIndex^th boundary species |
DLL_EXPORT int getNthBoundarySpeciesName | ( | int | nIndex, |
char ** | name | ||
) |
Returns the nIndex^th boundary species name.
[in] | nIndex | is the nIndex^th boundary spedcies name |
[out] | name | is the name of the nIndex^th boundary species |
DLL_EXPORT int getNthCompartmentId | ( | int | nIndex, |
char ** | sId | ||
) |
Returns the nIndex^th compartment Id.
[in] | nIndex | is the nIndex^th compartment Id |
[out] | sId | is the Id of the nIndex^th floating species |
DLL_EXPORT int getNthCompartmentName | ( | int | nIndex, |
char ** | name | ||
) |
Returns the nIndex^th compartment name.
[in] | nIndex | is the nIndex^th compartment name |
[out] | name | is the name of the nIndex^th compartment |
DLL_EXPORT int getNthError | ( | int | index, |
int * | line, | ||
int * | column, | ||
int * | errorId, | ||
char ** | errorType, | ||
char ** | errorMsg | ||
) |
Returns details on the index^th error.
[in] | index | The index^th error in the list |
[out] | line | The line number in the SBML file that corresponds to the error |
[out] | column | The column number in the SBML file that corresponds to the error |
[out] | errorId | The SBML errorId (see libSBML for details); |
[out] | errorType | The error type includes "Advisory", "Warning", "Fatal", "Error", and "Warning" |
[out] | errorMsg | The error message associated with the error |
DLL_EXPORT int getNthFloatingSpeciesId | ( | int | nIndex, |
char ** | sId | ||
) |
Returns the nIndex^th floating species Id.
[in] | nIndex | is the nIndex^th floating species Id |
[out] | sId | is the Id of the nIndex^th floating species |
DLL_EXPORT int getNthFloatingSpeciesName | ( | int | nIndex, |
char ** | name | ||
) |
Returns the nIndex^th floating species name.
[in] | nIndex | is the nIndex^th floating species name |
[out] | name | is the name of the nIndex^th floating species |
DLL_EXPORT int getNthFunctionDefinition | ( | int | index, |
char ** | fnId, | ||
int * | numArgs, | ||
char *** | argList, | ||
char ** | body | ||
) |
Collects information on the index^th function definition.
[in] | index | is the index^th function definition to consider |
[out] | fnId | is the Id for this function definition |
[out] | numArgs | is the number of arguments for this function definition |
[out] | argList | is the list of arguments (names) to the function definition |
[out] | body | is the main body of the function definition in infix notation |
DLL_EXPORT int getNthGlobalParameterId | ( | int | nIndex, |
char ** | sId | ||
) |
Returns the nIndex^th global parameter Id.
[in] | nIndex | is the nIndex^th global parameter Id |
[out] | sId | is the Id of the nIndex^th global parameter Id |
DLL_EXPORT int getNthGlobalParameterName | ( | int | nIndex, |
char ** | name | ||
) |
Returns the nIndex^th global parameter name.
[in] | nIndex | is the nIndex^th global parameter name |
[out] | name | is the name of the nIndex^th global parameter name |
DLL_EXPORT int getNthLocalParameterId | ( | int | reactionIndex, |
int | parameterIndex, | ||
char ** | sId | ||
) |
Returns the Id of nth local parameter is a given reaction.
[in] | reactionIndex | is the ith reaction |
[in] | parameterIndex | is the ith product |
[out] | sId | Pointer to the Id of the local parameter |
DLL_EXPORT int getNthLocalParameterName | ( | int | reactionIndex, |
int | parameterIndex, | ||
char ** | sId | ||
) |
Returns the name of nth local parameter is a given reaction.
[in] | reactionIndex | is the ith reaction |
[in] | parameterIndex | is the ith product |
[out] | sId | Pointer to the name of the local parameter |
DLL_EXPORT int getNthLocalParameterValue | ( | int | reactionIndex, |
int | parameterIndex, | ||
double * | value | ||
) |
Returns the value of the specificed local parameter.
[in] | reactionIndex | is the ith reaction |
[in] | parameterIndex | is the ith product |
[out] | value | Pointer to the value of the local parameter |
DLL_EXPORT int getNthProductName | ( | int | arg1, |
int | arg2, | ||
char ** | name | ||
) |
Return the name of the arg2^th reactant from the arg1^th reaction.
[in] | arg1 | is the ith reaction |
[in] | arg2 | is the ith product |
[out] | name | is the product name that is returned |
DLL_EXPORT int getNthProductStoichiometry | ( | int | arg1, |
int | arg2 | ||
) |
Returns the arg2^th product stoichiometry from the arg1^th reaction.
[in] | arg1 | is the ith reaction |
[in] | arg2 | is the ith product |
DLL_EXPORT int getNthReactantName | ( | int | arg1, |
int | arg2, | ||
char ** | name | ||
) |
Return the name of the arg2^th reactant from the arg1^th reaction.
[in] | arg1 | is the ith reaction |
[in] | arg2 | is the ith reactant |
[out] | name | is the reactant name that is returned |
DLL_EXPORT int getNthReactantStoichiometry | ( | int | arg1, |
int | arg2 | ||
) |
Returns the arg2^th reactant stoichiometry from the arg1^th reaction.
[in] | arg1 | is the ith reaction |
[in] | arg2 | is the ith reactant |
DLL_EXPORT int getNthReactionId | ( | int | nIndex, |
char ** | sId | ||
) |
Returns the nIndex^th reaction Id.
[in] | nIndex | is the nIndex^th reaction Id |
[out] | sId | is the Id that is returned to the caller |
DLL_EXPORT int getNthReactionName | ( | int | nIndex, |
char ** | name | ||
) |
Returns the nIndex^th reaction name.
[in] | nIndex | is the nIndex^th reaction |
[out] | name | is the name of the nIndex^th reaction |
DLL_EXPORT int getNthRule | ( | int | nIndex, |
char ** | rule, | ||
int * | ruleType | ||
) |
Returns the nIndex^th rule from the current model.
[in] | nIndex | is the nIndex^th rule |
[out] | rule | Pointer to a char* that will return the rule itself |
[out] | ruleType | Pointer to a char* that will return the type of the rule (i.e. algebraic, assignment, etc) |
DLL_EXPORT int getNumBoundarySpecies | ( | ) |
Return the number of boundary species in the current model.
DLL_EXPORT int getNumCompartments | ( | ) |
Return the number of compartment in the current model.
DLL_EXPORT int getNumErrors | ( | ) |
Returns number of errors in SBML model.
DLL_EXPORT int getNumEvents | ( | ) |
Returns the number of events in the SBML model.
DLL_EXPORT int getNumFloatingSpecies | ( | ) |
Return the number of floating species in the current model.
DLL_EXPORT int getNumFunctionDefinitions | ( | ) |
Return the number of function definitions in the current model.
DLL_EXPORT int getNumGlobalParameters | ( | ) |
Return the number of global parameters in the current model.
DLL_EXPORT int getNumLocalParameters | ( | int | reactionIndex | ) |
Returns the number of local parameters.
[in] | reactionIndex | is the ith reaction |
DLL_EXPORT int getNumProducts | ( | int | arg | ) |
Return the number of reactants for the arg^th reaction.
DLL_EXPORT int getNumReactants | ( | int | arg | ) |
Return the number of reactants for the arg^th reaction.
DLL_EXPORT int getNumReactions | ( | ) |
Return the number of reactions in the current model.
DLL_EXPORT int getNumRules | ( | ) |
Returns the number of rules in the SBML model.
DLL_EXPORT int getParamPromotedSBML | ( | char * | inSBML, |
char ** | outSBML | ||
) |
Any local parameters in an SBML model are promoted to global status by this call.
[in] | in | SBML is the input sbml string |
[out] | ou | tSBML is output sbml string with local parameters promoted to global parameters |
DLL_EXPORT int getValue | ( | char * | sId, |
double * | value | ||
) |
Get the value for a given symbol in the SBML.
[in] | sId | This is the name of the symbol to request the value for |
[out] | value | The value of the symbol is returned in this argument |
DLL_EXPORT int hasInitialAmount | ( | char * | sId, |
bool * | isInitialAmount | ||
) |
Returns 0 (false) in the argument list if the species given by sId does not have an amount associated with it, otherwise returns 1 (true)
[in] | sId | is the Id of the species |
[out] | isInitialAmount | is 0 if false, 1 if true |
DLL_EXPORT int hasInitialConcentration | ( | char * | cId, |
int * | hasInitial | ||
) |
Returns 0 (false) in the argument list if the species given by sId does not have a concentration associated with it, otherwise returns 1 (true)
[in] | cId | is the Id of the species |
[out] | hasInitial | is 0 if false, 1 if true |
DLL_EXPORT int isReactionReversible | ( | int | arg, |
int * | isReversible | ||
) |
Returns if reaction is reversible.
[in] | arg | is the reaction number index |
[out] | isReversible | is 1 if the reaction is reversible and 0 if not. |
DLL_EXPORT int loadSBML | ( | char * | sbmlStr | ) |
Load SBML into the NOM.
[in] | sbmlStr | sbmlStr is a char pointer to the SBML model |
DLL_EXPORT int reorderRules | ( | char ** | sbml | ) |
reorders rules in SBML
[in] | sbml | is the input sbml string to be modified by rule reordering |
DLL_EXPORT int setModelId | ( | char * | cId | ) |
Set the model Id for the current model.
[out] | cId | the Id to set in the current model |
DLL_EXPORT int setValue | ( | char * | sId, |
double | dValue | ||
) |
Set the value for a given symbol in the SBML.
[in] | sId | is the name of the symbol to set the value to |
[in] | dValue | The value which wish to use |
DLL_EXPORT int validate | ( | char * | sbmlStr | ) |
Retrusn 0 (false) the supplied SBML string is invalid, else returns 1 (true)
[in] | sbmlStr | is the SBML string to validate |
DLL_EXPORT int validateSBML | ( | char * | cSBML | ) |
Validates the given SBML model.