This is the API Reference page for the module: roadrunner
The RoadRunner SBML Simulation Engine, (c) 2009-2013 Herbert Sauro, Andy Somogyi and Totte Karlson
All three of the libRoadRunner options default to the empty string, in this case, the default values are used.
Parameters: |
|
---|
and some more stuff.
Creates a new SelectionRecord for the given selection string.
Returns a vector of steady state values for the floating species. The order of species in the vector is indicated by the order of species Ids in a call to getFloatingSpeciesIds()
Returns a scaled control coefficient with respect to a global parameter.
For example:
rr.getCC ('J1', 'Vmax')
rr.getCC ('S1', 'Xo')
rr.getCC ('S2', 'Km')
The first returns a flux control coefficient with respect to flux J1. The second and third return concentration control coefficients with respect to speies S1 and S2.
Parameters: |
|
---|---|
Returns: | the value of the control coefficeint returned to the caller. |
Return type: | double |
Get unscaled control coefficient with respect to a global parameter.
Parameters: |
|
---|
Return the compiler used to build the ExecutableModel.
recurse through all of the child configurable objects that this class ownes and build an assemble all of thier configuration parameters into a single xml document which is returned as a string.
The value of this result depends on what child objects are presently loaded.
Returns a conservation matrix which is a matrix where is the number of conservation laws and the number of species.
Returns the copyright string
Retrieve a single elasticity coefficient with respect to a global parameter.
For example:
x = rr.getEE ('J1', 'Vmax')
Parameters: |
|
---|
Get unscaled elasticity coefficient with respect to a global parameter or species.
returns a list of floating species ids with thier names prefixed with eigen_. For example, if the model contained the floating species S1 and S2, this would return a list containing [“eigen_S1”, “eigen_S2”].
Returns eigenvalues, first column real part, second column imaginary part.
Return type: | numpy.ndarray |
---|
getVersion plus info about dependent libs versions.
Returns a list of the floating species Ids, but with theIids surrounded by square brackets, i.e. ‘S1’ -> ‘[S1]’
Compute the full Jacobian at the current operating point.
This is the Jacobian of ONLY the floating species.
Returns the full reordered stoichiometry matrix for the currently loaded model. The rows will coresponds to the order of species in the call to getFloatinSpeciesIds(), the colunms will corresponds to the order of reactions in the call to getReactionIds().
return info about the current state of the object
Return type: | str |
---|
Number of currently running RoadRunner instances.
When there are multiple instances of RoadRunner, this is the instance id.
get the integrator which is currently being used to time evolve the system.
Returns the L0 matrix for the current model. The L0 matrix is an (m-r) by r matrix that expresses the dependent reaction rates in terms of the indepdent rates. m is the number of floating species and r is the rank of the stoichiometry matrix.
Return type: | numpy.ndarray |
---|
Returns the full link matrix, L for the current model. The Link matrix is an m by r matrix where m is the number of floating species and r the rank of the stichiometric matrix, N.
Return type: | numpy.ndarray |
---|
Returns the reduced stoichiometry matrix, , which wil have only r rows where r is the rank of the full stoichiometry matrix. The matrix will be reordered such that the rows of are independent.
Return type: | numpy.ndarray |
---|
Takes an sbml document (in textual form) and changes all of the local parameters to be global parameters.
Parameters: | sbml (str) – the contents of an sbml document |
---|---|
Return type: | str |
Returns the reduced Jacobian for the independent species. This matrix will be non-singular for models that include moiety-concerved cycles.
Return type: | numpy.ndarray |
---|
Returns the reordered stoichiometry matrix where the tops rows represent the independent species of which there will be rank (N) and the bottom rows the dependent species.
Return type: | numpy.ndarray |
---|
Returns the current state of the model in the form of an sbml string.
That is the SBML will reflect the current state of the model and not the orginal SBML that was loaded into roadRunner.
Return type: | str |
---|
Returns the original sbml model that was loaded into roadrunner.
Return type: | str |
---|
Returns the m by n matrix of scaled conentration control coefficients where m is the number of floating species and n the number of reactiohs.
Return type: | numpy.ndarray |
---|
Returns the scaled elasticity for a given reaction and given species.
Parameters: |
|
---|---|
Return type: | double |
Returns the n by n matrix of scaled flux control coefficients where n is the number of reactions.
Return type: | numpy.ndarray |
---|
Returns the scaled elasticity matrix at the current operating point.
Return type: | numpy.ndarray |
---|
Returns the value for a given selection.
Parameters: | sel (str or SelectionRecord) – a selection that is either a string or a SelectionRecord that was obtained from createSelection |
---|
returns the values selected with SimulateOptions for the current model time / timestep
Return type: | numpy.ndarray |
---|
get the simulation result in case one forgot to hold on to the simulate return value.
Return type: | numpy.ndarray |
---|
Create a new selection based on a selection string
Return type: | roadrunner.SelectionRecord |
---|
Returns the unscaled concentration control coefficent matrix.
Returns the unscaled species elasticity matrix at the current operating point.
Returns the unscaled flux control coefficient matrix.
Get a single species elasticity value. IMPORTANT: Assumes that the reaction rates have been precomputed at the operating point !!
Parameters: |
|
---|
Returns the current version of the roadRunner library.
Returns theversion of the libSBML library that is currently being used.
Return True if model was loaded; False otherwise
Loads an sbml document, given a string for file path, uri, or contents.
This method also accepts http uri for remote files, however this feature is currently limited to the Mac version, plan on enabling http loading of SBML documents on Windows and Linux shortly.
Some examples of loading files on Mac or Linux:
>>> r.load("myfile.xml") # load a file from the current dirctory
>>> r.load("/Users/Fred/myfile.xml") # absolute path
>>> r.load("http://sbml.org/example_system.xml") # remote file
Or on Windows:
>>> r.load("myfile.xml") # load a file from the current dirctory
>>> r.load("file://localhost/c:/Users/Fred/myfile.xml") # using a uri
>>> myfile = open("myfile.xml, "r")
>>> contents = file.read()
>>> r.load(contents)
In future version, we will also support loading directly from a libSBML Dcoument object.
Parameters: | uriOrDocument – A string which may be a local path, URI or contents of an SBML document. |
---|
Get the currently loaded model. The model object contains the enite state of the SBML model.
Carry out a one step integration of the model. The method takes two arguments, the current time and the step size to us in the integration. The method returns the new time which will be currentTime + StepSize:
newTime = rr.oneStep (10, 0.5)
This method resets all the floating species concentrations to their initial values.
given a xml document, which should have been returned from getConfigurationXML, this method recurses though all the child configurable elements and sets thier configuration to the values specified in the document.
Parameters: | xml (str) – the contents of an xml document. |
---|
Enables / Disables conserved moiety analysis (boolean).
If this is enabled, the sbml document (either current, or one about to be loaded) is converted using the ConservedMoietyConverter. All of the linearly dependent species are replaced with assignment rules and a new set of conserved moeity parameters are introduced.
Simulate the current SBML model.
There are a number of ways to call simulate.
The options given in the 2nd and 3rd forms will remain in effect until changed. So, if one calls:
rr.simulate (0, 3, 100)
The start time of 0, end time of 3 and steps of 100 will remain in effect, so that if this is followed by a call to:
rr.simulate()
This simulation will use the previous values.
Returns: | a numpy array with each selected output timeseries being a column vector, and the 0’th column is the simulation time. |
---|---|
Return type: | numpy.ndarray |
Get the SimulateOptions object where simulation options may be set.
Returns the copyright string
getVersion plus info about dependent libs versions.
Takes an sbml document (in textual form) and changes all of the local parameters to be global parameters.
Parameters: | sbml (str) – the contents of an sbml document |
---|---|
Return type: | str |
Evaluates the current model, that is it updates the rates of change and any assignments in the model. It does not carry out an integration step.
Returns: | Returns true if successful |
---|
A list of SelectionRecords which determine what values are used for a steady state calculation. This list may be set by assigning a list of valid selection symbols:
r.steadyStateSelections = \['S1', '\[S2]', 'P1']
Attempt to evaluate the steady state for the model. The method returns a value that indicates how close the solution is to the steady state. The smaller the value the better. Values less than 1E-6 usually indicate a steady state has been found. If necessary the method can be called a second time to improve the solution.
Returns: | the sum of squares of the steady state solution. |
---|---|
Return type: | double |
Performs a steady state calculation (evolves the system to a steady state), then calculates and returns the set of values specifed by the steady state selections.
Returns: | a numpy array corresponding to the values specified by steadyStateSelections |
---|---|
Return type: | numpy.ndarray |
RoadRunner simulation options.
This is the full set of options that determines how RoadRunner performs a simulation of an sbml model.
This is a superset of the values stored in a sbml test suite settings file, the documentation of the fields which correspond to an sbml test suite settings was taken from http://sbml.org
This object can be read from a sbml test suite options file by using a file name in the constructor.
Parameters: | sbmlSettingFilePath – (optional) if this is given, the settings are read from this settings file, if not, the default values are set. |
---|
A number representing the absolute difference permitted for the integrator tolerence.
A list of the variable whose output in the results file is in amount (not concentration) units. This list of variables must be a subset of the names listed in variables.
A list of the variable whose output in the results file is in concentration (not amount) units. This list of variables must be a subset of the names listed in variables.
The duration of the simulation run, in the model’s units of time. Note, setting the duration automatically sets the end time and visa versa.
The simulation end time. Note, setting the end time automatically sets the duration accoringly and visa versa.
can be set to ResetModel so that the model is reset to its intial state when the simulation is run.
A float-point number representing the relative difference permitted. Defaults 0.0001
Causes the model to be reset to the original conditions specified in the sbml when the simulation is run.
The start time of the simulation time-series data. Often this is 0, but not necessarily.
The number of steps at which the output is sampled. The samples are evenly spaced. When a simulation system calculates the data points to record, it will typically divide the duration by the number of time steps. Thus, for X steps, the output will have X+1 data rows.
Use the stiff integrator.
The variables (in addition to time) whose values will be saved in the result. These are SBML model id’s. Order is significant, as this determines the order of the columns in the result matrix.
Important: if a symbol in this list refers to a species in the model, then that symbol should also be listed in either the amount or concentration lists below. If a species symbol is listed in variables, but is not listed in either amounts or concentrations, then it defaults to an amount value.
The ordering of the symbols in variabls is what determines the output ordering. The order of symbols in either amounts or concetrations do not effect the output ordering.
NOTE:If a listed variable has two underscores in it (‘__’), that variable is actually present only in a submodel of the main model, from the Hierarchical Model Composition package, in the format submodelID__variableID. If the model is flattened, the variable will appear automatically.
Returns the number of floating species in the model.
Return a list of floating species sbml ids.
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of the rates of change of the floating species amounts. |
Return type: | numpy.ndarray |
Get the list of floating species amounts. If no arguments are given, this returns all floating species amounts.
Parameters: | index – an optional array of desired floating species indices. i.e. if this model has 4 floating species and we want the amounts for the last and first, we would use [3,0] for the index array. |
---|
get all the amounts:
>>> e.getFloatingSpeciesAmounts()
[15,2,3,20]
get amounts 3 and 0:
>>> getFloatingSpeciesAmounts([3,0])
[10,15]
Returns a vector of floating species concentrations. The order of species is given by the order of Ids returned by getFloatingSpeciesIds()
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of floating species concentrations. |
Return type: | numpy.ndarray |
Returns a vector of boundary species amounts. The order of species is given by the order of Ids returned by getBoundarySpeciesIds()
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of the boundary species amounts. |
Return type: | numpy.ndarray. |
given by the order of Ids returned by getBoundarySpeciesIds()
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of the boundary species amounts. |
Return type: | numpy.ndarray. |
Returns a vector of boundary species concentrations. The order of species is given by the order of Ids returned by getBoundarySpeciesIds()
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of the boundary species concentrations. |
Return type: | numpy.ndarray. |
given by the order of Ids returned by getBoundarySpeciesIds()
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of the boundary species concentrations. |
Return type: | numpy.ndarray. |
Returns a vector of boundary species Ids.
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | a list of boundary species ids. |
Returns a vector of compartment identifier symbols.
Parameters: | index (None or numpy.ndarray) – A array of compartment indices indicating which comparment ids to return. |
---|---|
Returns: | a list of compartment ids. |
Returns a vector of compartment volumes. The order of volumes is given by the order of Ids returned by getCompartmentIds()
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of compartment volumes. |
Return type: | numpy.ndarray. |
Return a vector of global parameter values. The order of species is given by the order of Ids returned by getGlobalParameterIds()
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of global parameter values. |
Return type: | numpy.ndarray. |
Get the model name specified in the SBML.
Returns the number of boundary species in the model.
Returns the number of compartments in the model.
Return type: | int |
---|
Returns the number of dependent floating species in the model.
Returns the number of global parameters in the model.
Returns the number of independent floating species in the model.
Returns the number of reactions in the model.
Returns the number of rules in the SBML model.
Returns a vector of reaction Ids.
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | a list of reaction ids. |
Returns a vector of reaction rates for the current state of the model. The order of reaction rates is given by the order of Ids returned by getReactionIds()
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of reaction rates. |
Return type: | numpy.ndarray |
Not sure what this does
Reset the floating species concentration to their initial conditions.
Use this to set the entire set of boundary species concentrations in one call. The order of species is given by the order of Ids returned by getBoundarySpeciesIds()
Parameters: |
|
---|
Sets a vector of compartment volumes.
If the index vector is not give, then the values vector treated as a vector of all compartment volumes to set. If index is given, then values should have the same length as index.
Parameters: |
|
---|
Use this to set the entire set of floating species amounts in one call. The order of species is given by the order of Ids returned by getFloatingSpeciesIds()
Parameters: |
|
---|
Use this to set the entire set of floating species concentrations in one call. The order of species is given by the order of Ids returned by getFloatingSpeciesIds()
Parameters: |
|
---|
Use this to set the entire set of global parameters in one call. The order of parameters is given by the order of Ids returned by getGlobalParameterIds()
Parameters: |
|
---|
Set the model time variable. NOt sure what this does.
Parameters: | time – time the time value to set. |
---|---|
Returns: | None |
Returns the stochiometric coefficient for the given species index and reaction index.
Frequently one does not need the full stochiometrix matrix, particularly if the system is large and only a single coefficent is needed.
Parameters: |
|
---|
Returns the current stoichiomentry matrix, a matrix where is the number of species which take place in reactions (floating species) and is the number of reactions.
this is a line with “quotes”
When the LLVM back end is used (default) this always returns the current state of the stochiometric coeffecients, so if any of these are determined by any rule, this will return the currect value.
Returns: | an n by m numpy ndarray of the stoichiometrix coeffecients. |
---|---|
Return type: | numpy.ndarray |
Returns the number of conserved moieties in the model.
Return type: | int |
---|
Returns a vector of conserved moiety identifier symbols.
Parameters: | index (None or numpy.ndarray) – A array of compartment indices indicating which comparment ids to return. |
---|---|
Returns: | a list of compartment ids. |
Returns a vector of conserved moiety volumes. The order of values is given by the order of Ids returned by getConservedMoietyIds()
Parameters: | index (numpy.ndarray) – (optional) an index array indicating which items to return. |
---|---|
Returns: | an array of conserved moiety values. |
Return type: | numpy.ndarray. |
Sets a vector of conserved moiety values.
Note This method currently only updates the conserved moeity values, it does not update the initial species condition from which the values were calculated.
If the index vector is not given, then the values vector treated as a vector of all values to set. If index is given, then values should have the same length as index.
Parameters: |
|
---|
RoadRunner provides a range of flexible ways of selecting values from a simulation. These values can not only be calculated directly via RoadRunner.getSelectionValue, but any of these selections can be used as columns in the simulate result matrix.
The SectionRecord.selectionType should be one of the constants listed here.
Most selection types only require the first symbol id, p1 to be set, however certain ones such as [???] require both p1 and p2.
species must have either a CONCENTRATION or AMOUNT modifer to distinguish it.