sbml2matlab  1.02
SBML to MATLAB translator
 All Classes Files Functions
Defines | Functions
NOM/NOM.h File Reference

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

Detailed Description

NOM version of libSBML.

Author:
Frank Bergmann fberg.nosp@m.man@.nosp@m.kgi.e.nosp@m.du, Sri Paladugu spala.nosp@m.dug@.nosp@m.kgi.e.nosp@m.du, Herbert Sauro hsaur.nosp@m.o@u..nosp@m.washi.nosp@m.ngto.nosp@m.n.edu, Stanley Gu stanl.nosp@m.eygu.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date:
February 22, 2012

Function Documentation

DLL_EXPORT int addMissingModifiers ( char *  inSBML,
char **  outSBML 
)

Fills in any missing modifiers to the SBML file.

Parameters:
[in]SBMLis the input sbml string
[out]SBMLis output sbml string with modifiers added
Returns:
-1 if there has been an error
DLL_EXPORT int convertMathMLToString ( char *  mathMLStr,
char **  infix 
)

Converts a MathML string into infix notation.

Parameters:
[in]MathMLis the input string
[out]infixnotation is the output string
Returns:
-1 if there has been an error

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

Parameters:
[in]inputModelis the input SBML to be converted to another version
[out]outputModelis the pointer to the output SBML
[in]nLevelis the level of output SBML
[in]nVersionis the version of output SBML
Returns:
-1 if there has been an error
DLL_EXPORT int convertStringToMathML ( char *  infixStr,
char **  mathMLStr 
)

Converts an infix string into MathML Notation.

Parameters:
[in]infixis the input string
[out]MathMLnotation is the output string
Returns:
-1 if there has been an error
DLL_EXPORT int getCompartmentIdBySpeciesId ( char *  cId,
char **  compId 
)

Returns the compartment Id associated with a particular species Id.

Parameters:
[in]cIdspecies Id
[out]sIdis the Id of the accociated species
Returns:
-1 if there has been an error
DLL_EXPORT char* getError ( )

Returns the error message given the last error code generated.

Returns:
char* to the error message
DLL_EXPORT int getKineticLaw ( int  index,
char **  kineticLaw 
)

Return the kinetic law of the index^th reaction.

Parameters:
[in]indexis the ith reaction to obtain the kinetic law from
[out]kineticLawis the string returned by the call
Returns:
-1 if there has been an error
DLL_EXPORT int getListOfBoundarySpeciesIds ( char ***  IdList,
int *  numBoundary 
)

Returns a list of the Ids of the boundary species.

Parameters:
[out]IdListis a array of char* containing the names of the boundary species
[out]numBoundaryis the number of boundary species in the list
Returns:
-1 if there has been an error
DLL_EXPORT int getListOfFloatingSpeciesIds ( char ***  IdList,
int *  numFloat 
)

Returns a list of the Ids of the floating species.

Parameters:
[out]IdListis a array of char* containing the names of the floating species
[out]numFloatis the number of boundary species in the list
Returns:
-1 if there has been an error
DLL_EXPORT int getModelId ( char **  sId)

Return the model Id for the current model.

Parameters:
[out]sIdthe current model
Returns:
-1 if there has been an error
DLL_EXPORT int getModelName ( char **  name)

Return the model name in the current model.

Parameters:
[out]nameof the model
Returns:
-1 if there has been an error
DLL_EXPORT int getNthBoundarySpeciesId ( int  nIndex,
char **  sId 
)

Returns the nIndex^th boundary species Id.

Parameters:
[in]nIndexis the nIndex^th boundary spedcies Id
[out]sIdis the Id of the nIndex^th boundary species
Returns:
-1 if there has been an error
DLL_EXPORT int getNthBoundarySpeciesName ( int  nIndex,
char **  name 
)

Returns the nIndex^th boundary species name.

Parameters:
[in]nIndexis the nIndex^th boundary spedcies name
[out]nameis the name of the nIndex^th boundary species
Returns:
-1 if there has been an error
DLL_EXPORT int getNthCompartmentId ( int  nIndex,
char **  sId 
)

Returns the nIndex^th compartment Id.

Parameters:
[in]nIndexis the nIndex^th compartment Id
[out]sIdis the Id of the nIndex^th floating species
Returns:
-1 if there has been an error
DLL_EXPORT int getNthCompartmentName ( int  nIndex,
char **  name 
)

Returns the nIndex^th compartment name.

Parameters:
[in]nIndexis the nIndex^th compartment name
[out]nameis the name of the nIndex^th compartment
Returns:
-1 if there has been an error
DLL_EXPORT int getNthError ( int  index,
int *  line,
int *  column,
int *  errorId,
char **  errorType,
char **  errorMsg 
)

Returns details on the index^th error.

Parameters:
[in]indexThe index^th error in the list
[out]lineThe line number in the SBML file that corresponds to the error
[out]columnThe column number in the SBML file that corresponds to the error
[out]errorIdThe SBML errorId (see libSBML for details);
[out]errorTypeThe error type includes "Advisory", "Warning", "Fatal", "Error", and "Warning"
[out]errorMsgThe error message associated with the error
Returns:
-1 if there has been an error
DLL_EXPORT int getNthFloatingSpeciesId ( int  nIndex,
char **  sId 
)

Returns the nIndex^th floating species Id.

Parameters:
[in]nIndexis the nIndex^th floating species Id
[out]sIdis the Id of the nIndex^th floating species
Returns:
-1 if there has been an error
DLL_EXPORT int getNthFloatingSpeciesName ( int  nIndex,
char **  name 
)

Returns the nIndex^th floating species name.

Parameters:
[in]nIndexis the nIndex^th floating species name
[out]nameis the name of the nIndex^th floating species
Returns:
-1 if there has been an error
DLL_EXPORT int getNthFunctionDefinition ( int  index,
char **  fnId,
int *  numArgs,
char ***  argList,
char **  body 
)

Collects information on the index^th function definition.

Parameters:
[in]indexis the index^th function definition to consider
[out]fnIdis the Id for this function definition
[out]numArgsis the number of arguments for this function definition
[out]argListis the list of arguments (names) to the function definition
[out]bodyis the main body of the function definition in infix notation
Returns:
-1 if there has been an error, otherwise returns 0
DLL_EXPORT int getNthGlobalParameterId ( int  nIndex,
char **  sId 
)

Returns the nIndex^th global parameter Id.

Parameters:
[in]nIndexis the nIndex^th global parameter Id
[out]sIdis the Id of the nIndex^th global parameter Id
Returns:
-1 if there has been an error
DLL_EXPORT int getNthGlobalParameterName ( int  nIndex,
char **  name 
)

Returns the nIndex^th global parameter name.

Parameters:
[in]nIndexis the nIndex^th global parameter name
[out]nameis the name of the nIndex^th global parameter name
Returns:
-1 if there has been an error
DLL_EXPORT int getNthLocalParameterId ( int  reactionIndex,
int  parameterIndex,
char **  sId 
)

Returns the Id of nth local parameter is a given reaction.

Parameters:
[in]reactionIndexis the ith reaction
[in]parameterIndexis the ith product
[out]sIdPointer to the Id of the local parameter
Returns:
-1 if there has been an error
DLL_EXPORT int getNthLocalParameterName ( int  reactionIndex,
int  parameterIndex,
char **  sId 
)

Returns the name of nth local parameter is a given reaction.

Parameters:
[in]reactionIndexis the ith reaction
[in]parameterIndexis the ith product
[out]sIdPointer to the name of the local parameter
Returns:
-1 if there has been an error
DLL_EXPORT int getNthLocalParameterValue ( int  reactionIndex,
int  parameterIndex,
double *  value 
)

Returns the value of the specificed local parameter.

Parameters:
[in]reactionIndexis the ith reaction
[in]parameterIndexis the ith product
[out]valuePointer to the value of the local parameter
Returns:
-1 if there has been an error
DLL_EXPORT int getNthProductName ( int  arg1,
int  arg2,
char **  name 
)

Return the name of the arg2^th reactant from the arg1^th reaction.

Parameters:
[in]arg1is the ith reaction
[in]arg2is the ith product
[out]nameis the product name that is returned
Returns:
-1 if there has been an error
DLL_EXPORT int getNthProductStoichiometry ( int  arg1,
int  arg2 
)

Returns the arg2^th product stoichiometry from the arg1^th reaction.

Parameters:
[in]arg1is the ith reaction
[in]arg2is the ith product
Returns:
-1 if there has been an error or the value of the stoichiometric amount
DLL_EXPORT int getNthReactantName ( int  arg1,
int  arg2,
char **  name 
)

Return the name of the arg2^th reactant from the arg1^th reaction.

Parameters:
[in]arg1is the ith reaction
[in]arg2is the ith reactant
[out]nameis the reactant name that is returned
Returns:
-1 if there has been an error
DLL_EXPORT int getNthReactantStoichiometry ( int  arg1,
int  arg2 
)

Returns the arg2^th reactant stoichiometry from the arg1^th reaction.

Parameters:
[in]arg1is the ith reaction
[in]arg2is the ith reactant
Returns:
-1 if there has been an error or the value of the stoichiometric amount
DLL_EXPORT int getNthReactionId ( int  nIndex,
char **  sId 
)

Returns the nIndex^th reaction Id.

Parameters:
[in]nIndexis the nIndex^th reaction Id
[out]sIdis the Id that is returned to the caller
Returns:
-1 if there has been an error
DLL_EXPORT int getNthReactionName ( int  nIndex,
char **  name 
)

Returns the nIndex^th reaction name.

Parameters:
[in]nIndexis the nIndex^th reaction
[out]nameis the name of the nIndex^th reaction
Returns:
-1 if there has been an error
DLL_EXPORT int getNthRule ( int  nIndex,
char **  rule,
int *  ruleType 
)

Returns the nIndex^th rule from the current model.

Parameters:
[in]nIndexis the nIndex^th rule
[out]rulePointer to a char* that will return the rule itself
[out]ruleTypePointer to a char* that will return the type of the rule (i.e. algebraic, assignment, etc)
Returns:
-1 if there has been an error or the number of rules
DLL_EXPORT int getNumBoundarySpecies ( )

Return the number of boundary species in the current model.

Returns:
-1 if there has been an error, otherwise returns # of boundary species
DLL_EXPORT int getNumCompartments ( )

Return the number of compartment in the current model.

Returns:
-1 if there has been an error, otherwise returns # of compartments
DLL_EXPORT int getNumErrors ( )

Returns number of errors in SBML model.

Returns:
-1 if there has been an error, otherwise returns number of errors in SBML model
DLL_EXPORT int getNumEvents ( )

Returns the number of events in the SBML model.

Returns:
-1 if there has been an error or the number of events
DLL_EXPORT int getNumFloatingSpecies ( )

Return the number of floating species in the current model.

Returns:
-1 if there has been an error, otherwise returns # of floating species
DLL_EXPORT int getNumFunctionDefinitions ( )

Return the number of function definitions in the current model.

Returns:
-1 if there has been an error, otherwise returns # of function definitions
DLL_EXPORT int getNumGlobalParameters ( )

Return the number of global parameters in the current model.

Returns:
-1 if there has been an error, otherwise returns # of global parameters
DLL_EXPORT int getNumLocalParameters ( int  reactionIndex)

Returns the number of local parameters.

Parameters:
[in]reactionIndexis the ith reaction
Returns:
-1 if there has been an error or the number of local parameters
DLL_EXPORT int getNumProducts ( int  arg)

Return the number of reactants for the arg^th reaction.

Returns:
-1 if there has been an error
DLL_EXPORT int getNumReactants ( int  arg)

Return the number of reactants for the arg^th reaction.

Returns:
-1 if there has been an error
DLL_EXPORT int getNumReactions ( )

Return the number of reactions in the current model.

Returns:
-1 if there has been an error, otherwise returns # of reactions
DLL_EXPORT int getNumRules ( )

Returns the number of rules in the SBML model.

Returns:
-1 if there has been an error or the number of rules
DLL_EXPORT int getParamPromotedSBML ( char *  inSBML,
char **  outSBML 
)

Any local parameters in an SBML model are promoted to global status by this call.

Parameters:
[in]inSBML is the input sbml string
[out]outSBML is output sbml string with local parameters promoted to global parameters
Returns:
-1 if there has been an error
DLL_EXPORT int getValue ( char *  sId,
double *  value 
)

Get the value for a given symbol in the SBML.

Parameters:
[in]sIdThis is the name of the symbol to request the value for
[out]valueThe value of the symbol is returned in this argument
Returns:
-1 if there has been an error, otherwise returns 0
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)

Parameters:
[in]sIdis the Id of the species
[out]isInitialAmountis 0 if false, 1 if true
Returns:
-1 if there has been an error
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)

Parameters:
[in]cIdis the Id of the species
[out]hasInitialis 0 if false, 1 if true
Returns:
-1 if there has been an error
DLL_EXPORT int isReactionReversible ( int  arg,
int *  isReversible 
)

Returns if reaction is reversible.

Parameters:
[in]argis the reaction number index
[out]isReversibleis 1 if the reaction is reversible and 0 if not.
Returns:
-1 if there has been an error
DLL_EXPORT int loadSBML ( char *  sbmlStr)

Load SBML into the NOM.

Parameters:
[in]sbmlStrsbmlStr is a char pointer to the SBML model
Returns:
-1 if there has been an error, otherwise returns 0
DLL_EXPORT int reorderRules ( char **  sbml)

reorders rules in SBML

Parameters:
[in]sbmlis the input sbml string to be modified by rule reordering
Returns:
-1 if there has been an error
DLL_EXPORT int setModelId ( char *  cId)

Set the model Id for the current model.

Parameters:
[out]cIdthe Id to set in the current model
Returns:
-1 if there has been an error
DLL_EXPORT int setValue ( char *  sId,
double  dValue 
)

Set the value for a given symbol in the SBML.

Parameters:
[in]sIdis the name of the symbol to set the value to
[in]dValueThe value which wish to use
Returns:
-1 if there has been an error, otherwise returns 0
DLL_EXPORT int validate ( char *  sbmlStr)

Retrusn 0 (false) the supplied SBML string is invalid, else returns 1 (true)

Parameters:
[in]sbmlStris the SBML string to validate
Returns:
-1 if there has been an error, otherwise returns 0
DLL_EXPORT int validateSBML ( char *  cSBML)

Validates the given SBML model.

Returns:
-1 if the SBML model is invalid, else returns 0