Mathworks SIMBIOLOGY 3 Reference

SimBiology
Reference
®
3
How to Contact The MathWorks
www.mathworks. comp.soft-sys.matlab Newsgroup www.mathworks.com/contact_TS.html T echnical Support
suggest@mathworks.com Product enhancement suggestions
bugs@mathwo doc@mathworks.com Documentation error reports service@mathworks.com Order status, license renewals, passcodes
info@mathwo
com
rks.com
rks.com
Web
Bug reports
Sales, prici
ng, and general information
508-647-7000 (Phone)
508-647-7001 (Fax)
The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site.
®
SimBiology
© COPYRIGHT 2005–20 10 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathW orks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern theuse,modification,reproduction,release,performance,display,anddisclosureoftheProgramand Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conflicting contractual terms or conditions. If this License fails to meet the government’s needs or is inconsistent in any respect with federal procurement law, the government agrees to return the Program and Docu mentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand
names may be trademarks or registered trademarks of their respective holders.
Patents
The MathWorks products are protected by one or more U.S. patents. Please see
www.mathworks.com/patents for more information.
Reference
Revision History
September 2005 Online only New for Version 1.0 ( Release 14SP3+) March 2006 Online only Updated for Version 1.0.1 (Release 2006a) May 2006 Online only Updated for Version 2.0 (Release 2006a+) September 2006 Online only Updated for Version 2.0.1 (Release 2006b) March 2007 Online only Rereleased for Version 2.1.1 (Release 2007a) September 2007 Online only Rereleased for Version 2.1.2 (Release 2007b) October 2007 Online only Updated for Version 2.2 (Release 2007b+) March 2008 Online only Updated for Version 2.3 (Release 2008a) October 2008 Online only Updated for Version 2.4 (Release 2008b) March 2009 Online only Updated for Version 3.0 (Release 2009a) September 2009 Online only Updated for Version 3.1 (Release 2009b) March 2010 Online only Updated for Version 3.2 (Release 2010a)
Function Reference
1
Modeling, Simulation, and Analysis Tools ............ 1-2
Contents
Project Opening and Saving
SBML Model Reading and Writing
Object Construction
Pharmacokinetic Modeling
Units and Unit Prefixes
............................... 1-6
Functions — Alphabetical List
2
3
........................ 1-4
.................. 1-5
......................... 1-7
............................ 1-8
Method Reference
Objects ........................................... 3-3
Abstract Kinetic Laws
Compartments
Configuration Sets
.................................... 3-5
.............................. 3-4
................................. 3-6
v
Events ............................................ 3-6
Kinetic Laws
Models
Parameters
Pharmacokinetic Modeling
Reactions
RepeatDose
Root
Rules
ScheduleDose
SimData
............................................ 3-8
.............................................. 3-14
............................................. 3-15
...................................... 3-7
....................................... 3-11
......................................... 3-13
....................................... 3-13
..................................... 3-15
.......................................... 3-16
......................... 3-12
vi Contents
Species
Units and Unit Prefixes
Variants
Using Object Methods
Constructing (Creating) Objects Using Object Methods Help for Objects, Methods, and Properties
........................................... 3-17
............................ 3-17
.......................................... 3-17
............................. 3-19
...................... 3-19
.............................. 3-19
............. 3-20
Methods — Alphabetical List
4
Property Reference
5
Abstract Kinetic Law .............................. 5-3
Compartments
Configuration Sets
Events
Kinetic Laws
Models
NMFileDef
Parameters
PKCompartment
PKData
PKModelDesign
............................................ 5-6
............................................ 5-8
........................................... 5-12
.................................... 5-4
...................................... 5-7
........................................ 5-9
....................................... 5-10
................................. 5-5
.................................. 5-11
................................... 5-13
PKModelMap
Reactions
RepeatDose
......................................... 5-15
...................................... 5-14
....................................... 5-16
vii
Root .............................................. 5-17
Rules
ScheduleDose
SimData
Species
Unit
Unit Prefix
Variant
Using Object Properties
............................................. 5-18
..................................... 5-19
.......................................... 5-20
........................................... 5-21
.............................................. 5-21
........................................ 5-22
........................................... 5-22
........................... 5-24
Entering Property Values Retrieving Property Values Help for Objects, Methods, and Properties
........................... 5-24
......................... 5-24
............. 5-25
viii Contents
Properties — Alphabetical List
6
Index
Function Reference
1
Modeling, Simulation, and Analysis Tools (p. 1-2)
Project Opening and Saving (p. 1-4) Save and open projects in MATLAB
SBML Model Reading and Writing (p. 1-5)
Object Construction (p. 1-6) Create SimBiology
Pharmacokinetic Modeling (p. 1-7) Tools for pharmacokinetic modeling
Units and Unit Prefixes (p. 1-8) Perform unit conversion and create
Modeling, simulation, and analysis tools
Export and import SBML models
®
objects
user-defined units
®
1 Function Reference
Modeling, Simulation, and Analysis Tools
sbioaccelerate
sbioconsmoiety
sbiodesktop
sbioensembleplot
sbioensemblerun
sbioensemblestats
sbiogetmodel
sbiogetnamedstate
sbiohelp
sbiolasterror
sbiolastwarning
sbionlinfit
ionlmefit
sb
bionlmefitsa
s
sbioparamestim
sbioplot
sbioreset
Prepare model object fo r accelerated simulations
Find conserved moieties in SimBiology model
Open SimBiology modeling and simulation GUI
Show results of ensemble run using 2-D or 3-D plots
Multiple stochastic ensemble runs of SimBiology model
Get statistics from ensemble run data
Get model object that generated simulation data
Get state and time data from simulation results
Help for SimBiology functions
SimBiology last error message
SimBiology last warning message
linear least-squares regression
Non
ng SimBiology models
usi
timate nonlinear mixed effects
Es
ing SimBiology models
us
stimate nonlinear mixed effects
E
ith stochastic EM algorithm
w
erform parameter es timation
P
Plot simulation results in one figure
Delete all model and simulation objects
1-2
Modeling, Simulation, and Analysis Tools
sbioselect
sbiosimulate
sbiosubplot
sbiotrellis
sbioupdate
simbiology
Search for objects with specified constraints
Simulate model object
Plot simulation results in subplots
Plot simulation results in trellis plot
Update SimBiology model version
Open SimBiology modeling and simulation GUI
1-3
1 Function Reference
Project Opening and Saving
sbioaddtolibrary
sbiocopylibrary
sbioloadproject
sbioremovefromlibrary
sbiosaveproject
sbiowhos
Add to user-defined library
Copy library to disk
Load project from file
Remove kinetic law, unit, or unit prefix from library
Save all models in root object
Show contents of project file, library file, or SimBiology root object
1-4
SBML Model Reading and Writing
SBML Model Reading and Writing
sbmlexport
sbmlimport
Export SimBiology model to SBML file
Import SB ML-formatted file
1-5
1 Function Reference
Object Construction
sbioabstractkineticlaw
sbiodose
sbiomodel
sbioroot
sbiovariant
Create kinetic law definition
Construct dose object
Construct model object
Return SimBiology root object
Construct variant object
1-6
Pharmacokinetic Modeling
Pharmacokinetic Modeling
sbiofitstatusplot
sbionlinfit
sbionlmefit
sbionlmefitsa
sbionmfiledef
sbionmimport
Plot status of sbionlmefit
Nonlinear least-squares regression using SimBiology models
Estimate nonlinear mixed effects using SimBiology models
Estimate nonlinear mixed effects with stochastic EM algorithm
NONMEM®file definition object for sbionmimport
Import NONMEM formatted data
1-7
1 Function Reference
Units and Unit Prefixes
sbioconvertunits
sbioregisterunitprefix
sbioshowunitprefixes
sbioshowunits
sbiounit
sbiounitcalculator
sbiounitprefix
Convert unit and unit value to new unit
Create user-defined unit prefix
Show unit prefixes in library
Show units in library
Create user-defined unit
Convert value between units
Create user-defined unit prefix
1-8
Functions — Alphabetical List
2
sbioabstractkineticlaw
Purpose Create kinetic law definition
Syntax abstkineticlawObj = sbioabstractkineticlaw('Name')
abstkineticlawObj = sbioabstractkineticlaw('Name',
'Expression')
abstkineticlawObj = sbioabstractkineticlaw(...'PropertyName', PropertyValue...)
Arguments
Name
Expression
Description abstkineticlawObj = sbioabstractkineticlaw('Name') creates an
abstract kinetic law object, with the name
abstkineticlawObj. Use the abstract kinetic law object to specify a
kinetic law definition.
Enteranameforthekineticlawdefinition.
Name must be unique in the user-defined
kinetic law library.
kineticlawObj.
Name is referenced by
The mathematical expression that defines the kinetic law.
Name and returns it to
2-2
The kinetic law definition provides a mechanism for applying a specific rate law to multiple reactions. It acts as a mapping template for the reaction rate. The kinetic law definition defines a reaction rate expression, which is shown in the property
Expression,andthespecies
and parameter variables used in the expression. The species variables are defined in the variables are defined in the
SpeciesVariables property, and the parameter
ParameterVariables property of the
abstract kinetic law object.
In order to use the kinetic law definition, it must be added to the user-defined library with the
sbioaddtolibrary function. To get the
kinetic law definitions in the user-defined library, use the command
get(sbioroot, 'UserDefinedKineticLaws').
abstkineticlawObj = sbioabstractkineticlaw('Name','Expression')
constructs a SimBiology abstract kinetic law object, abstkineticlawObj
sbioabstractkineticlaw
with the name 'Name' and with the expression 'Expression' and returns it to
abstkineticlawObj = sbioabstractkineticlaw(...'PropertyName', PropertyValue...)
name/property value pairs can be in any format supported by the function name-value cell array pairs).
abstkineticlawObj.
defines optional properties. The property
set (for example, name-value string pairs, structures, and
Method Summary
Property Summary
Additional command. abstkineticlawObj properties can be modified with the
set command.
delete (any object) Delete SimBiology object
display(anyobject) DisplaysummaryofSimBiology
get (any object) Get object properties
set (any object) Set object properties
Annotation
Expression
Name
Notes
ParameterVariables
Parent
SpeciesVariables
abstkineticlawObj properties can be viewed with the get
object
Store link to URL or file
Expression to determine reaction rate equation
Specify name of object
HTML text describing SimBiology object
Parameters in kinetic law definition
Indicate parent object
Species in abstract kinetic law
2-3
sbioabstractkineticlaw
Tag
Type
UserData
Examples 1 Create a kinetic law definition.
abstkineticlawObj = sbioabstractkineticlaw('ex_mylaw1', '(k1*s)/(k2+k1+s)');
2 Assign the parameter and species variables in the expression.
set (abstkineticlawObj, 'SpeciesVariables', {'s'}); set (abstkineticlawObj, 'ParameterVariables', {'k1', 'k2'});
3 Add the new kinetic l aw definition to the user-defined library.
sbioaddtolibrary(abstkineticlawObj);
sbioaddtolibrary
library. You can verify this using
adds the kinetic law definition to the user-defined
Specify label for SimBiology object
Display top-level SimBiology object type
Specifydatatoassociatewith object
sbiowhos.
2-4
sbiowhos -kineticlaw -userdefined
SimBiology Abstract Kinetic Law Array
Index: Library: Name: Expression: 1 UserDefined ex_mylaw1 (k1*s)/(k2+k1+s)
4 Use the new kinetic law definition when defining a reaction’s kinetic
law.
modelObj = sbiomodel('cell'); reactionObj = addreaction(modelObj, 'A + B <-> B + C'); kineticlawObj = addkineticlaw(reactionObj, 'ex_mylaw1');
sbioabstractkineticlaw
Note Remember to specify the SpeciesVariableNames and the
ParameterVariableNames in kineticlawObj to fully define the ReactionRate of the reaction.
See Also addkineticlaw, addparameter, addreaction, sbiomodel
2-5
sbioaccelerate
Purpose Prepare model object for accelerated simulations
Syntax sbioaccelerate(modelObj)
sbioaccelerate(modelObj, configsetObj) sbioaccelerate(modelObj, variantObj) sbioaccelerate(modelObj, doseObj) sbioaccelerate(modelObj, configsetObj, variantObj) sbioaccelerate(modelObj, configsetObj, doseObj) sbioaccelerate(modelObj, configsetObj, variantObj, doseObj)
Description Use the same arguments in sbioaccelerate that you will use in the
subsequent call to
sbioaccelerate(modelObj) prepares a model object (modelObj)for
accelerated simulation using its active configset, active variants and active dos es. A SimBiology model can contain multip le configsets with one being active at any given time. The active configset contains the settings that will be used to prepare the model for acceleration.
sbioaccelerate(modelObj, configsetObj) uses the configset
configsetObj. Aconfigsetobjectstoressimulation specific information.
sbiosimulate.
2-6
sbioaccelerate(modelObj, variantObj) uses the variant object or array
of variant objects
variantObj. A variant object’s settings supersede
model property-values.
sbioaccelerate(modelObj, doseObj) simulates modelObj using the
dose obje ct or array of dose objects
doseObj. A SimBiology Dose object
defines additions that are made to species amounts or parameter values.
sbioaccelerate(modelObj, configsetObj, variantObj), sbioaccelerate(modelObj, configsetObj, doseObj) uses the configset
configsetObj and variant object or variant array variantObj or dose
object or dose array assumed to be
sbioaccelerate(modelObj, configsetObj, variantObj, doseObj)
doseObj. N ote if the third argument is empty it is
variantObj.
sbioaccelerate
Input Arguments
modelObj
SimBiology model object.
configsetObj
Specify the configuration set object to use in the simulation. For more inform ation about configuration sets, see
object
variantObj
.
Configset
Specify the variant object to apply to the model during the simulation. For more information about variant objects, see
Variant object.
doseObj
Specify the dose object to apply to the model during the simulation. For more information about do se objects, see
object
and RepeatDose object.
ScheduleDose
Examples This example shows how to prepare a model for accelerated simulation.
% Create a SimBiology model from an SBML file.
m = sbmlimport('lotka.xml');
% Prepare the model for accelerated simulation.
sbioaccelerate(m);
% Simulate the model for different initial amounts of x.
x = sbioselect(m, 'type', 'species', 'name', 'x');
for i=1:10
x.initialAmount = i; sd(i) = sbiosimulate(m);
end
% Plot the results.
sbioplot(sd);
2-7
sbioaccelerate
See Also sbiosimulate
2-8
Purpose Add to user-defined library
Syntax sbioaddtolibrary (abstkineticlawObj)
sbioaddtolibrary (unitObj) sbioaddtolibrary (unitprefixObj)
Arguments
abstkineticlawObj
unitObj
unitprefixObj
Specify the abstract kinetic law object that holds the kinetic law definition. The ofthekineticlawmustbeuniqueinthe user-defined kinetic law library. referenced by information about creating see
sbioabstractkineticlaw.
Specify the user-defined unit to add to the library. For more information about creating
unitObj,seesbiounit.
Specify the user-defined unit prefix to add to the library. For more information about creating
sbiounitprefix.
sbioaddtolibrary
Name
Name is
kineticlawObj.Formore
kineticlawObj,
unitprefixObj,see
Description The function sbioaddtolibrary adds kinetic law definitions, units, and
unit prefixes to the user-defined library.
sbioaddtolibrary (abstkineticlawObj) adds the abstract kinetic law
object (
sbioaddtolibrary (unitObj) adds the user-defined unit (unitObj)to
the user-defined library.
sbioaddtolibrary (unitprefixObj) adds the user-defined unit prefix
(
The or unit prefix to the root object’s
abstkineticlawObj) to the user-defined library.
unitprefixObj) to the user-defined library.
sbioaddtolibrary function adds any kinetic law definition, unit,
UserDefinedLibrary property. These
2-9
sbioaddtolibrary
library components become available automatically in future MATLAB sessions.
Use the kinetic law definitions in the built-in and user-defined library to construct a kinetic law object with the method
To get a component of the built-in and user-defined libraries, use the commands
'UserDefinedLibrary'))
get(sbioroot, 'BuiltInLibrary') and (get(sbioroot,
.
To remove the library component from the user-defined library, use the function
sbioremovefromlibrary. You cannot remove a kinetic law
definition being used by a reaction.
Examples This example shows how to create a kinetic law definition and add it to
the user-defined library.
1 Create a kinetic law definition.
abstkineticlawObj = sbioabstractkineticlaw('ex_mylaw1', '(k1*s)/(k2+k1+s)');
addkineticlaw.
2-10
2 Assign the parameter and species variables in the expression.
set (abstkineticlawObj, 'SpeciesVariables', {'s'}); set (abstkineticlawObj, 'ParameterVariables', {'k1', 'k2'});
3 Add the new kinetic l aw definition to the user-defined library.
sbioaddtolibrary(abstkineticlawObj);
The function adds the ki netic law definition to theuser-defined library. You can verify this using
sbiowhos -kineticlaw -userdefined
SimBiology Abstract Kinetic Law Array
Index: Library: Name: Expression: 1 UserDefined mylaw1 (k1*s)/(k2+k1+s)
sbiowhos.
sbioaddtolibrary
4 Use the new kinetic law definition when defining a reaction’s kinetic
law.
modelObj = sbiomodel('cell'); reactionObj = addreaction(modelObj, 'A + B <-> B + C'); kineticlawObj = addkineticlaw(reactionObj, 'ex_mylaw1');
Note Remember to specify the SpeciesVariableNames and the
ParameterVariableNames in kineticlawObj to fully define the ReactionRate of the reaction.
See Also addkineticlaw, sbioabstractkineticlaw, sbioremovefromlibrary,
sbioroot, sbiounit, sbiounitprefix
2-11
sbioconsmoiety
Purpose Find conserved moieties in SimBiology model
Syntax [G, Sp] = sbioconsmoiety(modelObj)
[G, Sp] = sbioconsmoiety(modelObj, alg H = sbioconsmoiety(modelObj, alg,'p') H = sbioconsmoiety(modelObj, alg,'p', FormatArg) [SI, SD, L0, NR, ND] = sbioconsmoiety(modelObj,'link')
Arguments
G
Sp
modelObj
alg
H
p
FormatArg
SI
An m-by-n matrix, where m is the number of conserved quantities found and of species in the model. Each row of linear combination of species whose rate of cha nge over time is zero.
Cell array of species namesthatlabelsthecolumns of
G. If the species are in multiple compartments,
species names are qualified with the compartment name in the form For example,
nucleus.DNA, cytoplasm.mRNA.
Model object to be evaluated for conserved moieties.
Specify algorithm to use during evaluation of conserved moieties. Valid values are
'rreduce',or'semipos'.
Cell array of strings containing the conserved moieties.
Prints the output to a cell array of strings.
Specifies formatting for the output H. FormatArg should either be a C-style format string, or a positive integer specifying the maximum number of digits of precision used.
Cell array containing the names of independent species in the model.
)
n is the number
G specifies a
compartmentName.speciesName.
'qr',
2-12
sbioconsmoiety
SD
Cell array containing the names of dependent species in the model.
L0
Link matrix relating SI and SD. The link matrix L0 satisfies ND = L0*NR.Forthe'link' functionality, species with their
ConstantAmount properties set to true are treated
BoundaryCondition or
as having stoichiometry of zero in all reactions.
NR
Reduced stoichiometry matrices containing one row for each independent species. The concatenated
ND
matrix full stoichiometry matrix of
Reduced stoichiometry matrices containing one
[NR;ND] is a row-permuted version of the
modelObj.
row for each dependent species. The concatenated matrix full stoichiometry matrix of
[NR;ND] is a row-permuted version of the
modelObj.
Description [G, Sp] = sbioconsmoiety(modelObj) calculates a complete set of linear
conservation relations for the species in the SimBio lo gy model object
modelObj.
sbioconsmoiety computes conservation relations by analy zing
the structure of the model object’s stoichiometry matrix. Thus,
sbioconsmoiety does not include species that a re governed by algebraic
or rate rules.
[G, Sp] = sbioconsmoiety(modelObj, alg) provides an algorithm
specification. For
When you specify
on
QR factorization. From a numerical standpoint, this is the most
alg,specify'qr' , 'rreduce' ,or'semipos'.
'qr', sbioconsmoiety uses an algorithm based
efficient and reliable approach.
When you specify
'rreduce', sbioconsmoiety uses an algorithm
based on row reduction, which yields better numbers for smaller models. This is the default.
2-13
sbioconsmoiety
When you specify 'semipos', sbioconsmoiety returns conservation
relations in which all the coefficients are greater than or equal to 0, permitting a more transparent interpretation in terms of physical quantities.
Forlargermodels,the models, row reduction or the semipositive algorithm may be preferable. For row reduction and relations re turne d equals the row rank degeneracy of the model object’s stoichiometry matrix. The semipositive algorithm may return a different number of relations. Mathem atically s p eaking, this algorithm returns a generating set of vectors for the space of semipositive conservation relations.
H = sbioconsmoiety(modelObj, alg,'p') returns a cell array of strings
H containing the conserved quantities in modelObj.
H = sbioconsmoiety(modelObj, alg,'p', FormatArg) specifies
formatting for the output format string, or a positive integer specifying the maximum number of digits of precision used.
[SI, SD, L0, NR, ND] = sbioconsmoiety(modelObj,'link') uses a
QR-based algorithm to compute information relevant to the dimensional
reduction, via conservation relations, of the reaction network in
modelObj.
Examples Example 1
This example shows conserved moieties in a cycle.
1 Create a model with a cycle. For convenience u se arbitrary reaction
rates, as this will not affect the result.
QR-based method is recommended. For smaller
QR factorization, the num ber of con serv ati on
H. FormatArg should either be a C-style
2-14
lObj = sbiomodel('cycle');
mode
lObj.addreaction('a -> b','ReactionRate','1');
mode
lObj.addreaction('b -> c','ReactionRate','b');
mode
elObj.addreaction('c -> a','ReactionRate','2*c');
mod
sbioconsmoiety
2 Look for conserved moieties.
[g sp] = sbioconsmoiety(modelObj)
g=
111
sp =
'a' 'b' 'c'
Example 2
Explore semipositive conservation relations in the oscillator model.
modelObj = sbmlimport('oscillator');
sbioconsmoiety(modelObj,'semipos','p')
ans =
'pol + pol_OpA + pol_OpB + pol_OpC'
'OpB + pol_OpB + pA_OpB1 + pA_OpB_pA + pA_OpB2'
'OpA + pol_OpA + pC_OpA1 + pC_OpA2 + pC_OpA_pC'
'OpC + pol_OpC + pB_OpC1 + pB_OpC2 + pB_OpC_pB'
See Also “Moiety Conservation” in the SimBiology User’s Guide documentation
SimBiology method
getstoichmatrix
2-15
sbioconvertunits
Purpose Convert unit and unit value to new unit
Syntax sbioconvertunits(Obj,'unit')
Description sbioconvertunits(Obj,'unit') converts the current *Units property
on SimBiology object, the
*Units property to unit and updates the corresponding value
property. For example,
InitialAmount property value and the InitialAmountUnits property
value.
Obj can be an array of SimBiology objects. Obj must be a SimBiology
object that contains a unit property. The SimBiology objects that contain a unit property are compartment, parameter, and species objects. For example, if configured to 1 and InitialAmountUnits configured to mole,afterthe call to
InitialAmount
sbioconvertunits with unit specified as molecule, speciesObj
Obj to the unit, unit. This function configures
sbioconverunits on a speciesObj updates the
Obj is a species object with InitialAmount
is 6.0221e23 and InitialAmountUnits is molecule.
Examples Convert the units of the initial amount of glucose from molecule to
mole.
1 Create the species 'glucose' and assign an initial amount of 23
molecule
At the command pro mpt, type:
modelObj = sbiomodel('cell');
compObj = addcompartment(modelObj, 'C');
speciesObj = addspecies (compObj, 'glucose', 23, 'InitialAmountUnits', 'molecule')
SimBiology Species Array
2-16
.
Index: Compartment: Name: InitialAmount: InitialAmountUnits:
1 C glucose 23 molecule
sbioconvertunits
2 Convert the InitialAmountUnits of glucose from molecule to mole.
sbioconvertunits (speciesObj, 'mole')
3 Verify the conversion of units and InitialAmount value.
Units are converted from m olecule to mole.
get (speciesObj, 'InitialAmountUnits')
ans =
mole
The InitialAmount value is changed.
get (speciesObj, 'InitialAmount')
ans =
3.8192e-023
See Also sbioshowunits
2-17
sbiocopylibrary
Purpose Copy library to disk
Syntax sbiocopylibrary ('kineticlaw',’LibraryFileName’)
sbiocopylibrary ('unit',’LibraryFileName’)
Description sbiocopylibrary copies all user-defin ed kinetic law definitions to a
file.
sbiocopylibrary ('kineticlaw',’LibraryFileName’) copies all
user-defined kinetic law definitions to the file and places the copied file in the current directory.
sbiocopylibrary ('unit',’LibraryFileName’) copies all user-defined
units and unit prefixes to the file
LibraryFileName.sbulib.
To get the kinetic law definitions that are in the built-in and user-defined libraries, use the commands
get(sbioroot, 'BuiltInKineticLaws')
and get(sbioroot, 'UserDefinedKineticLaws').Toadda kinetic law definition to the user-defined library, use the method
sbioaddtolibrary.
LibraryFileName.sbklib
To add a unit to the user-defined library, use the
sbioregisterunit
function. To add a unit prefix to the user-defined library, use the
sbioregisterunitprefix function.
Examples Create a kinetic law definition, add it to the user-defined library, and
then copy the user-defined kinetic law library to a
1 Create a kinetic law definition.
abstkineticlawObj = sbioabstractkineticlaw('mylaw1', '(k1*s)/(k2+k1+s)');
2 Add the new a kinetic law definition to the user-defined library.
sbioaddtolibrary(abstkineticlawObj);
sbioaddtolibrary
library. You can verify this using
sbiowhos -kineticlaw -userdefined
adds the kinetic law definition to the user-defined
sbiowhos.
.sbklib file.
2-18
sbiocopylibrary
SimBiology Abstract Kinetic Law Array
Index: Library: Name: Expression:
1 UserDefined mylaw1 (k1*s)/(k2+k1+s)
3 Copy the user-defined kinetic law library.
sbiocopylibrary ('kineticlaw','myLibFile')
4 Verify with sbiowhos.
sbiowhos -kineticlaw myLibFile
See Also sbioaddtolibrary, sbioabstractkineticlaw, sbioregisterunit,
sbioregisterunitprefix, sbioremovefromlibrary
2-19
sbiodesktop
Purpose Open SimBiology modeling and simulati o n GUI
Syntax sbiodesktop
sbiodesktop(modelObj
Arguments
modelObj
Description sbiodesktop opens the SimBiology desktop, which lets you do the
following:
Build a SimBiology model b y representing reaction pathways and
entering kinetic data for the reactions.
Import or export SimBiology models to and from the MATLAB
workspace or from a Systems Biology Markup Language (SBML) file.
)
Model object or an array of model objects . Enter the variable name for a top-level SimBiolo gy model object. If you enter an array of model objects, the SimBiology desktop opens with each model object in a separate model session.
2-20
Modify an existing SimBiology model.
Simulate a SimBiology model through individual or ensemble runs.
View results from the simulation.
Perform analysis tasks such as sensitivity analysis, parameter and
species scans, and calculate conserved moieties.
Create and/or modify user-defined units and unit prefixes.
Create and/or modify user-defined kinetic laws.
sbiodesktop(modelObj) opens the SimBiolo gy desktop with a top-level
SimBiology model object ( SimBiology desktop, this command adds the model ( project. A top-level SimBiology model object has its property to the SimBiology root object. Thus, querying
modelObj). If there is a project o pen in the
modelObj)tothe
Parent set
sbioroot at the command
sbiodesktop
line shows you all models in the MATLAB workspace, including the models available in the desktop. Any changes you make to the model at the command line are reflected in thedesktopbecausebotharepointing to the same model object in the
Note The sbioreset command removes all models from the root object and therefore this command also removes all models from the SimBiology desktop.
Examples Create a SimBiology model in the MATLAB workspace, and then open
the GUI w ith the model.
modelObj = sbiomodel('cell'); sbiodesktop(modelObj)
See Also sbioroot, simbiology
Root object.
2-21
sbiodose
Purpose Construct dose object
Syntax doseObj = sbiodose('DoseName')
doseObj = sbiodose('DoseName', 'DoseType') doseObj = sbiodose(...’PropertyName', PropertyValue...)
Inputs
DoseName
DoseType
Name of the dose object.
Selects which type of dos e object to construct. Enter either
'schedule'creates a ScheduleDose object
and defines the dose with a time array, amount array, and rate array.
'repeat'creates a RepeatDose object and
defines the dose with a dose amount, number of dose repetitions, and the time between doses.
'schedule' or 'repeat'
Outputs
doseObj
ScheduleDose
or RepeatDose object.
Description doseObj = sbiodose('DoseName') constructs a S imBiology RepeatDose
object (doseOb j), assigns DoseName to the property Name, and assigns
[]to the property Parent.
doseObj = sbiodose('DoseName', 'DoseType') constructs either a
SimBiology
doseObj = sbiodose(...’PropertyName', PropertyValue...) defines
dose object properties. You can enter the property name/property value pairs in any format supported by the function name-value string pairs, structures, and name-value cell array pairs).
You can view additional modify
2-22
ScheduleDose object or RepeatDose object (doseObj).
set (for example,
doseObj properties with the get command and
doseObj properties with the set command.
Before you use a dose object in a simulation, you must add the object to a SimBiology model with the method
Examples Construct a repeat dose object:
1 In the MATLAB Command Window, enter:
doseObj1 = sbiodose('dose1', 'repeat');
2 Define a repeating dose:
doseObj1.Amount = 5; doseObj1.Repeat = 6; doseObj1.Interval = 24; doseObj1.TimeUnits = 'hour'; doseObj1.TargetName = 'Central.x';
Construct a schedule dose object:
sbiodose
adddose.
1 In the MATLAB Command Window, enter:
doseObj2 = sbiodose('dose2', 'schedule');
2 Define a dose schedule:
doseObj2.Time = [0 24 48]; doseObj2.Amount = [10 5 5]; doseObj2.TargetName = 'Central.Drug';
See Also Model object methods:
adddose — add a dose object to a model object.
getdose — get dose information from a model object.
removedose — remove a dose object from a model object.
ScheduleDose object and RepeatDose object methods:
2-23
sbiodose
copyobj — copy a dose object from one model object to another model
object.
get — view properties for a dose object.
set — define or modify properties for a dose object.
2-24
sbioensembleplot
Purpose Show results of ensemble run using 2-D or 3-D plots
Syntax sbioensembleplot(simdataObj)
sbioensembleplot(simdataObj, Names) sbioensembleplot(simdataObj, Names, Time)
= sbioensembleplot(simdataObj, Names)
FH
= sbioensembleplot(simdataObj, Names, Time)
FH
Arguments
simdataObj
Names
Time
FH
An object that contains simulation data. You can generate a
sbioensemblerun. All elements of simdataObj
simdataObj object using the function
must contain data for the same states in the same model.
Either a string or a cell array of strings.
Names may include qualified names such
as
'CompartmentName.SpeciesName' or
'ReactionName.ParameterName' to resolve
ambiguities. Specifying all states contained in
{} for Names plots data for
simdataObj.
A nu meric scalar value. If the specified Time is not an element of the time vectors in the function resamples
simdataObj as necessary
using linear interpolation.
Array of handles to figure windows.
simdataObj,then
Description sbioensembleplot(simdataObj) shows a 3-D shaded plot of time-varying
distribution of all logged states in the SimData array
sbioensemblerun function plots an approximate distribution created by
fitting a normal distribution to the data at every time step.
sbioensembleplot(simdataObj, Names) plots the distribution for the
data specified by
Names.
simdataObj.The
2-25
sbioensembleplot
sbioensembleplot(simdataObj, Names, Time) plots a 2-D histogram of
the actual data of the ensemble distribution of the states specified by
Names at the particular time point Time.
FH = sbioensembleplot(simdataObj, Names) returns an array of
handles
FH = sbioensembleplot(simdataObj, Names, Time) returns an array of
handles
Examples Thisexampleshowshowtoplotdatafromanensemblerunwithout
interpolation.
1 The project file, radiodecay.sbproj, contains a model stored in a
2 Change the solver of the active configuration set to be ssa.Also,
FH, to the figure window for the 3-D distribution plot.
FH, to the figure window for the 2-D histograms.
variable called
sbioloadproject('radiodecay.sbproj','m1');
adjust the
m1.Loadm1 into the MATLAB workspace.
LogDecimation property on the SolverOptions property
of the configuration set to reduce the size of the data generated.
cs = getconfigset(m1, 'active'); set(cs, 'SolverType', 'ssa'); so = get(cs, 'SolverOptions'); set(so, 'LogDecimation', 10);
3 Perform an ens em ble of 20 runs with no interpolation.
simdataObj = sbioensemblerun(m1, 20);
4 Create a 2-D distribution plot of the species 'z' at time = 1.0.
FH1 = sbioensembleplot(simdataObj, 'z', 1.0);
5 Create a 3-D shaded plot of both species.
2 = sbioensembleplot(simdataObj, {'x','z'});
FH
See Also sbioensemblerun, sbioensemblestats, sbiomodel
2-26
sbioensemblerun
Purpose Multiple stochastic ensemble runs of SimBiology model
Syntax simdataObj = sbioensemblerun(modelObj, Numruns)
simdataObj = sbioensemblerun(modelObj, Numruns,
Interpolation)
simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj) simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj,
Interpolation) simdataObj = sbioensemblerun(modelObj, Numruns, variantObj) simdataObj = sbioensemblerun(modelObj, Numruns, variantObj,
Interpolation) simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj,
variantObj) simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj,
variantObj, Interpolation)
Arguments
simdataObj
modelObj
Numruns
Interpolation
An object that contains simulation data generated by
sbioensemblerun. All elements of simdataObj
must contain data for the same states in the same model.
Modelobjecttobesimulated.
Integer scalar representing the number of stochastic runs to make.
String variable denoting the interpolation scheme to be used if data should be interpolated to get a consistent time vector. Valid values are (linear interpolation), 'zoh' (zero-order hold), or
'off' (no interpolation). Default is 'off'.If
interpolationison,thedataisinterpolatedto match the time vector with the smallest simulation stop time.
'linear'
2-27
sbioensemblerun
configsetObj
Specify the configuration set object to use in the ensemble simulation. For more information about
variantObj
configuration sets, see
Specify the variant object to apply to the model
Configset object.
during the ensemble simulation. For more information about variant objects, see
object
.
Variant
Description simdataObj = sbioensemblerun(modelObj, Numruns) performs a
stochastic ensemble run of the SimBiology model object ( returns the results in the SimData object (
simdataObj). The active
configset and the active variants are used during simulation and are saved in the output, SimData object (
sbioensemblerun uses the settings in the active configset on the
model object (
SolverType property of the active configset must be set to one of the
stochastic solvers:
modelObj) to perform the repeated simulation runs. The
'ssa', 'expltau',or'impltau'. sbioensemblerun
simdataObj).
generates an error if the SolverType property is set to any of the deterministic (ODE) solvers.
simdataObj = sbioensemblerun(modelObj, Numruns, Interpolation)
performs a stochastic ensemble run of a model object (modelObj), and interpolates the results of the ensemble run onto a common time vector using the interpolation scheme (
Interpolation).
modelObj), and
2-28
simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj)
performs an ensemble run of a model object (modelObj), using the specified configuration set (
simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj, Interpolation)
performs an ensemble run of a model object (modelObj),
using the specified configuration set (
configsetObj).
configsetObj), and interpolates
the results of the ensemble run onto a common time vector using the interpolation scheme (
Interpolation).
sbioensemblerun
simdataObj = sbioensemblerun(modelObj, Numruns, variantObj)
performs an ensemble run of a model object (modelObj), using the variant object or array of variant objects (
simdataObj = sbioensemblerun(modelObj, Numruns, variantObj, Interpolation)
performs an ensemble run of a model object (modelObj), using the variant object or array of variant objects ( interpolates the results of the ensemble run onto a common time vector using the interpolation scheme (
simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj, variantObj)
performs an ensemble run of a model object (modelObj), using the configuration set ( array of variant objects ( (
configsetObj) is empty, the active configset on the model is used for
variantObj). If the configuration set object
simulation. If the variant object (
Interpolation).
configsetObj), and the variant object or
variantObj) is empty, then no variant
(not even the active variants in the model) is used for the simulation.
simdataObj = sbioensemblerun(modelObj, Numruns, configsetObj, variantObj, Interpolation)
object (
modelObj), using the configuration set (configsetObj), and the
performs an ensemble run of a model
variant object or arrayofvariantobjects( the results of the ensemble run onto a common time vector using the interpolation scheme (
Interpolation).
variantObj).
variantObj), and
variantObj), a n d interpolates
Examples This example shows how to perform an ensemble run and generate a
2-D distribution plot.
1 The project file, radiodecay.sbproj, contains a model stored in a
variable called
sbioloadproject('radiodecay.sbproj','m1');
2 Change the solver of the active configset to be ssa.Also,adjust
the
LogDecimation property on the SolverOptions property of the
configuration set.
cs = getconfigset(m1, 'active'); set(cs, 'SolverType', 'ssa');
m1.Loadm1 into the MATLAB workspace.
2-29
sbioensemblerun
Tip The LogDecimation property lets y ou define how often the
simulation data is recorded as output. If your model has high concentrations or amounts of species, or a long simulation time (for example, the amount of data generated. Be aware that by doing so you might miss some transitions if your model is very dynamic. Try setting
LogDecimation to 10 or more.
3 Perform an ensemble of 20 runs with linear interpolation to get
a consistent time vector.
4 Create a 2-D distribution plot of the species 'z' at a time = 1.0.
so = get(cs, 'SolverOptions'); set(so, 'LogDecimation', 10);
600s), you can record simulation data less often to manage
simdata = sbioensemblerun(m1, 20, 'linear');
FH = sbioensembleplot(simdata, 'z', 1.0);
See Also addconfigset, getconfigset, sbioensemblestats,
sbioensembleplot, setactiveconfigset, SimData object
2-30
Purpose Get statistics from ensemble run data
Syntax [t,m] = sbioensemblestats(simDataObj)
[t,m,v] = sbioensemblestats(simDataObj) [t,m,v,n] = sbioensemblestats(simDataObj)
Arguments
t
m
simDataObj
v
n
Vector of doubles that holds the common time vector after interpolation.
Matrix of mean values from the ensemble data. The number of rows in time vector
t after interpolation and the number
m is the length of the common
of columns is equal to the number of species. The species order corresponding to the columns of can be obtained from any of the SimData objects in
simDataObj using sbiogetnamedstate.
A cell array of SimData objects, where each SimData object holds data for a separate simulation run. All elements of for the same states in the same model. When the time vectors of the elements of identical,
simDataObj is first resampled onto a
common time vector (see
Matrix of variance obtained from the ensemble data.
v has the same dimensions as m.
Cell array of strings that holds names whose mean and variance are returned in The number of elements in number of columns of in
n corresponds to the order of columns of m and v.
sbioensemblestats
m
simDataObj must contain data
simDataObj are not
interpolation below).
m and v,respectively.
n isthesameasthe
m and v. T he order o f names
2-31
sbioensemblestats
names
interpolation
Either a string or a cell array of strings.
names may include qualified names such
as
'CompartmentName.SpeciesName' or
'ReactionName.ParameterName' to resolve
ambiguities. If you specify empty
sbioensemblestats returns statistics on all time
courses contained in
simDataObj.
{} for names,
String variable denoting the interpolation method to be used if data is to be interpolated to get a consistent time vector. See of interpolation methods. Default is
resample for a list
'off'.If
interpolationison,thedataisinterpolatedto match the time vector with the smallest simulation stop time.
Description [t,m] = sbioensemblestats(simDataObj) computes the time-dependent
ensemble mean
sbioensemblerun.
[t,m,v] = sbioensemblestats(simDataObj) computes the
time-dependent ensemble mean data
simDataObj.
[t,m,v,n] = sbioensemblestats(simDataObj) computes the
time-dependent ensemble mean data
simDataObj. Eachcolumnofm or v describes the ensemble mean
or variance of some state as a function of time.
m of the ensemble data simDataObj obtained by running
m an d variance v for the e n semble run
m an d variance v for the e n semble run
Examples The project file, radiodecay.sbproj, contains a model stored in a
variable called
1 Load a SimBiology model m1 from a SimBiology project file.
sbioloadproject('radiodecay.sbproj','m1');
2-32
m1.Loadm1 into the MATLAB workspace.
sbioensemblestats
2 Change the solver of the active configuration set to be ssa.Also,
adjust the of the configuration set.
cs = getconfigset(m1, 'active'); set(cs, 'SolverType', 'ssa'); so = get(cs, 'SolverOptions'); set(so, 'LogDecimation', 10);
3 Perform an ens em ble of 20 runs with no interpolation.
simDataObj = sbioensemblerun(m1, 20);
4 Get ensemble statistics for all species using the default interpolation
method.
[T,M,V] = sbioensemblestats(simDataObj);
5 Get ensemble statistics for a specific species using the default
interpolation scheme.
LogDecimation property on the SolverOptions property
[T2,M2,V2] = sbioensemblestats(simDataObj, {'z'});
See Also sbioensemblerun, sbioensembleplot, sbiogetnamedstate, sbiomodel
2-33
sbioevent
Purpose Construct event object
Note sbioevent has been removed and produces an error. Us e
addevent instead.
Syntax eventObj = sbioevent(TriggerValue, EventFcnsValue)
eventObj = sbioevent(...’PropertyName', PropertyValue...)
Arguments
TriggerValue
EventFcnsValue
PropertyName
PropertyValue
Required property to specify a trigger condition. Must be a MATLAB expression that evaluates to a logical value.
A string or a cell array of strings, each of which specifies an assignment of the form
'objectname = expression',
where SimBiology object.
Property name for an event object from “Property Summary” on page 2-35.
Property value. For more information on property values, see the property reference for each property listed in “Property Summary” on page 2-35.
objectname is the name of a valid
Description eventObj = sbioevent(TriggerValue, EventFcnsValue) creates a
2-34
SimBiology event object, assigns a value ( property
EventFcns, and returns the object (eventObj).
During model simulation, an event is triggered and its evaluated when the an event to be used in a simulation, the event object must be added to a SimBiology model object with the
Trigger, assigns a value (EventFcnsValu e) to the property
Trigger transitions from false to true. In order for
copyobj function.
TriggerValue)forthe
EventFcns are
sbioevent
The preferred way to work with events is to add an event to a SimBiology model with the
For details on how events are handled during a simulation, see “Changing Model Component Values Using Events” in the SimBiology User’s Guide documentation.
eventObj = sbioevent(...’PropertyName', PropertyValue...) defines
optional properties. The property name/property value pairs can be any format supported by the function pairs, structures, and name-value cell array pairs).
addevent function.
set (for example, name-value string
Method Summary
Property Summary
copyobj (any object) Copy SimBiology object and its
children
delete (any object) Delete SimBiology object
display(anyobject) DisplaysummaryofSimBiology
object
get (any object) Get object properties
set (any object) Set object properties
Active
Annotation
EventFcns
Name
Notes
Parent
Tag
Indicate object in use during simulation
Store link to URL or file
Event expression
Specify name of object
HTML text describing SimBiology object
Indicate parent object
Specify label for SimBiology object
2-35
sbioevent
Trigger
Type
UserData
Examples 1 Create an event object.
eventObj = sbioevent('time>= 5', 'OpC = 200');
2 Get a list of properties for the event object.
get(eventObj)
MATLAB displays a list of ev ent properties.
Active: 1
Annotation: ''
EventFcns: {'OpC = 200'}
Name: ''
Notes: ''
Parent: [1x1 SimBiology.Model]
Tag: ''
Trigger: 'time >= 5'
Type: 'event'
UserData: []
Event trigger
Display top-level SimBiology object type
Specifydatatoassociatewith object
See Also addevent, copyobj, Event object
2-36
sbiofitstatusplot
Purpose Plot status of sbionlmefit
Syntax stop = sbiofitstatusplot(beta, stat us, state)
Description stop = sbiofitstatusplot(beta, status, state) initializes
or updates a plot with the f ixed effects,
status.fval, and the variance of the random effects, diag(status.Psi).
beta, the log likelihoo d
The function returns an output (
'OutputFcn' option of nlmefit.Forsbiofitstatusplot,thevalue
of
stop is always false.
Specify
optionstruc (options structure) argument, to obtain status information
about NLME fitting. Use function to use in the options structure.
Inputs beta
status
stop) to satisfy requirements for the
sbiofitstatusplot in the sbionlmefit function using the
sbiofitstatusplot or customize your own
The current fixed effects.
Structure containing several fields.
Field Value
inner
Structure describing the current status of the inner iterations within the ALT and LAP procedures, with the fields:
procedure
- 'PNLS', 'LME',or'none' when the
procedure is
'ALT'
- 'PNLS', 'PLM',or'none' when the
procedure is
state 'init', 'iter', 'done',or'none'
'LAP'
2-37
sbiofitstatusplot
state
Definitions Alt
Field Value
iteration — Integer starting from 0, or NaN
procedure 'ALT' or 'LAP'
iteration
fval
Psi
theta
mse
Either 'init', 'iter',or'done'.
Integer starting from 0
Current log-likelihood
Current random-effects covariance matrix
Current parameterization of Psi
Current error v ariance
2-38
Alternating algorithm for the optimization of the LME or RELME approximations
FO
First-order estimate
FOCE
First-order conditional estimate
LAP
Optimization of the Laplacian approximation for FO or FOCE
LME
Linear mixed-effects estimation
NLME
Nonlinear mixed effects
PLM
Profiled likelihood maximization
PNLS
Penalized nonlinear least squares
RELME
Restricted likelihood for the linear mixed-effects model
Examples Obtain status information for NLM E fitting:
% Create options structure with 'OutputFcn'. options.Options.OutputFcn = @sbiofitstatusplot; % Pass options structure with OutputFcn to sbionlmefit function. results = sbionlmefit(..., options);
See Also nlmefit | sbionlinfit | sbionlmefit
sbiofitstatusplot
How To • “Obtaining the Status of Fitting”
2-39
sbiogetmodel
Purpose Get model object that generated simulation data
Syntax modelObj = sbiogetmodel(simDataObj)
Arguments
simDataObj
modelObj
Description modelObj = sbiogetmodel(simDataObj) returns the SimBiology
model ( (
simDataObj). You can use this function to find the model object
associated with the specified SimData object when you load a project with several model objects and SimData objects.
If the SimBiology model used to generate the SimData object (
simDataObj) is not currently loaded, modelObj is empty.
modelObj) associated with the results from a simulation run
SimData object returned by the function
sbiosimulate or by sbioensemblerun.
Model object associated with the SimData object.
Example Retrieve the model object that generated the SimData object.
1 Create a model object, simulate, and then return the results as a
SimData object.
modelObj = sbmlimport('oscillator'); simDataObj = sbiosimulate(modelObj);
2 Get the model that generated the simulation results.
modelObj2 = sbiogetmodel(simDataObj) SimBiology Model - Oscillator
Model Components:
Models: 0 Parameters: 0 Reactions: 42
2-40
Rules: 0 Species: 23
3 Check that the two models are the same.
modelObj == modelObj2 ans =
See Also sbiosimulate
sbiogetmodel
1
2-41
sbiogetnamedstate
Purpose Get state and time data from simulation results
Note sbiogetnamedstate produces a warning and will be removed in
a future version. Use
Syntax [t,x] = sbiogetnamedstate(simDataObj)
[t,x] = sbiogetnamedstate(simDataObj,'Name') [t,x,Name] = sbiogetnamedstate(...)
Description sbiogetnamedstate returns state and time data from simulation
results. and state data associated with the simulation results ( and returns to returned by the
[t,x] = sbiogetnamedstate(simDataObj) returns the time
t and x respectively. simDataObj is a SimData object
t is an n-by-1 vector of time samples labeling the rows of x.
x is an n-by-m matrix, where n is the number of times the reactions
fired and column of
m is the number of states logged during simulation. Each
x defines the variation in the quantity of a species over
time.
selectbyname instead.
sbiosimulate function.
simDataObj)
[t,x] = sbiogetnamedstate(simDataObj,'Name') returns the state data
associated with the name and returns it to does not exist, you see a warning.
[t,x,Name] = sbiogetnamedstate(...) returns the names associated
with each column of
See Also sbiosimulate
2-42
Name from the SimData object (smDataObj),
x. Name can be a cell array names. If a name, Name,
x to Name.
sbiogetsensmatrix
Purpose 3-D sensitivity matrix from simulation results
Note sbiogetsensmatrix produces a warning and will be removed in
a future version. Use
Syntax [T,R,States,Inpfacs] = sbiogetsensmatrix(simDataObj)
[T,R,Outputs,Inpfacs] = sbiogetsensmatrix(imDataobj,
OutNames, InpFacNames)
Arguments
T
R
Outputs
Inpfacs
simDataObj
getsensmatrix instead.
Column vector of length m specifying time points for the sensitivity data in
R.
An m-by-n-by-p array of sensitivity data with times, outputs, and input factors labeling its first, second, and third dimensions respectively.
Contains names of the species states that label the second dimension of for the sensitivity of state factor
Inpfacs{j}.WhensimdataObj contains
R. R(:,i,j) isthetimecourse
Outputs{i} to the input
more than one element, the output arguments are cell arrays in which each cell contains data for the corresponding element of
simdataObj.
Contains names of the input factors that label the third dimension of for the sensitivity of states factor
Inpfacs{j}.
R. R(:,i,j) is the time course
Outputs{i} to the input
SimData object returned by sbiosimulate. Contains sensitivity data when sensitivity analysis is enabled.
2-43
sbiogetsensmatrix
OutNames
Specify outputs to get sensitivity data from
simDataObj. Can be an empty array, or a single
name, or a cell array of names. When an empty array is specified, returns the sensitivity data on
InpFacNames
all species states contained in
Specify input factors to get sensitivity data from
simDataObj. Can be an empty array, or a single
simDataObj.
name, or a cell array of names. When an empty array is specified, returns the sensitivity data for all input factors contained in
simDataObj.
Description [T,R,States,Inpfacs] = sbiogetsensmatrix(simDataObj) gets time
and sensitivity data from the SimData object by simulating a SimBiology model object using
sbiogetsensmatrix can only return sensitivity data that is contained
in
simDataObj.
The sensitivity data that is logged in
simDataObj is set at simulation
time by the active configuration set that is used during the simulation. Note that the sensitivity data
R returned by sbiogetsensmatrix may
be normalized, as specified at simulation time.
[T,R,Outputs,Inpfacs] = sbiogetsensmatrix(imDataobj, OutNames, InpFacNames)
gets sensitivity data for the outputs specified by OutNames
and the input factors specified by InpFacNames.
simDataObj generated
sbiosimulate.
See Also getsensmatrix , sbiogetnamedstate, sbiohelp, sbiosimulate
2-44
sbiohelp
Purpose Help for S imBiology functions
Syntax sbiohelp('FunctionName')
h = sbiohelp ('FunctionName')
Description sbiohelp('FunctionName') displays information for a SimBiology
function (
h = sbiohelp ('FunctionName') returns the help for the SimBiology
function
You can get general inform a t ion on the Si m B i ology software by specifying
FunctionName as 'sbio'. General information about a SimBiology object
can be returned by specifying
'AbstractKineticLaw', 'Compartment', 'CompileOptions', 'Configset', 'Event', 'ExplicitTauSolverOptions', 'ImplicitTauSolverOptions', 'KineticLaw', 'ODESolverOptions', 'Model', 'Parameter', 'PKData', 'PKCompartment', 'PKModelDeign', 'PKModelMap', 'Reaction', 'Root', 'Rule', 'RuntimeOptions', 'SensitivityAnalysisOptions', 'SimData', 'Species', 'SSASolverOptions', 'Library', 'Unit', 'UnitPrefix',or 'Variant'.
FunctionName).
FunctionName to h.
FunctionName as one of the fo llow ing:
Examples sbiohelp('addreaction')
sbiohelp addreaction sbiohelp reaction sbiohelp('sbioshowunits')
See Also MATLAB function help
2-45
sbiolasterror
Purpose SimBiology last error message
Syntax sbiolasterror
diagstruct
sbiolasterror([]) sbiolasterror(diagstruct)
Arguments
diagstruct
Description sbiolasterror or diagstruct = sbiolasterror return a SimBiology
diagnostic structure array containing the last error(s) generated by the software. The fields of the diagnostic structure are:
= sbiolasterror
The diagnostic structure holding Type, Message
,andMessage for the errors.
ID
Type
MessageID
Message
sbiolasterror([]) resetstheSimBiologylasterrorsothatitwillreturn
an empty array until the next SimBiology error is encountered.
sbiolasterror(diagstruct) will set the SimBiology last error(s) to those
specified in the diagnostic structure (
'error'
The message ID for the error (for example,
'SimBiology:ConfigSetNameClash')
The error message
diagstruct).
Examples This example shows how to use verify and sbiolasterror.
1 Import a model.
a = sbmlimport('radiodecay.xml')
SimBiology Model - RadioactiveDecay
Model Components:
Models: 0
2-46
sbiolasterror
Parameters: 1 Reactions: 1 Rules: 0 Species: 2
2 Change the ReactionRate ofareactiontomakethemodelinvalid.
a.reactions(1).reactionrate = 'x*y'
SimBiology Model - RadioactiveDecay
Model Components:
Models: 0 Parameters: 1 Reactions: 1 Rules: 0 Species: 2
3 Use the function verify to validate the model.
a.verify
??? Error using==>simbio\private\odebuilder>buildPatternSubStrings
The object y does not resolve on reaction with expression'x*y'.
Error in ==> sbiogate at 22
feval(varargin{:});
??? --> Error reported from Expression Validation :
The object 'y' in reaction 'Reaction1' does not resolve
to any in-scope species or parameters.
--> Error reported from Dimensional Analysis :
Could not resolve species, parameter or model object 'y'
during dimensional analysis.
--> Error reported from ODE Compilation:
Error using==>simbio\private\odebuilder>buildPatternSubStrings
The object y does not resolve on reaction with expression 'x*y'.
2-47
sbiolasterror
4 Retrieve the error diagnostic struct.
p = sbiolasterror
p=
1x3 struct array with fields:
Type MessageID Message
5 Display the first error ID and Message.
p(1)
ans =
Type: 'Error'
MessageID: 'SimBiology:ReactionObjectDoesNotResolve'
Message: 'The object 'y' in reaction 'Reaction1'
does not resolve to any in-scope species or parameters.'
2-48
6 Reset the sbiolasterror.
sbiolasterror([])
ans =
[]
7 Set sbiolasterror to the diagnostic struct.
sbiolasterror(p)
ans =
1x3 struct array with fields:
Type MessageID Message
See Also sbiolastwarning, verify
sbiolasterror
2-49
sbiolastwarning
Purpose SimBiology last warning message
Syntax sbiolastwarning
diagstruct
sbiolastwarning([]) sbiolastwarning(diagstruct)
Arguments
diagstruct
Description sbiolastwarning or diagstruct = sbiolastwarning return a S imB iology
diagnostic structure array containing the last warnings generated by thesoftware. Thefieldsofthediagnosticstructureare:
= sbiolastwarning
The diagnostic structure holding Type, Message
,andMessage for the warnings.
ID
Type
MessageID
Message
sbiolastwarning([]) resets the SimBiology last warning so that it
will return an empty array until the next SimBiology warning is encountered.
sbiolastwarning(diagstruct) will set the SimBiology last warn i ng s to
thosespecifiedinthediagnostic structure (
'warning'
The message ID for th e warning (for example,
'SimBiology:DANotPerformedReactionRate')
The warning message
See Also sbiolasterror, verify
diagstruct).
2-50
sbioloadproject
Purpose Load project from file
Syntax sbioloadproject('projFilename')
sbioloadproject ('projFilename','variableName') sbioloadproject projFilename variableName1 variableName2...
s=sbioloadproject (...)
Description sbioloadproject('projFilename') loads a SimBiology project
from a project file (
sbioloadproject assumes a default extension of .sbproj.
Alternatively, the command syntax is
sbioloadproject ('projFilename','variableName') loads only the
variable
sbioloadproject projFilename variableName1 variableName2... loads
the specified variables from the project.
s=sbioloadproject (...) returns the contents of projFilename in
a variable retrieved from the SimBiology project.
variableName from the project file.
s. s is a struct containing fields matching the variables
projFilename). If no extension is specified,
sbioloadproject projFilename.
You can display the contents of the project file using the command.
sbiowhos
See Also sbioaddtolibrary, sbioremovefromlibrary, sbiosaveproject,
sbiowhos
2-51
sbiomodel
Purpose Construct model object
Syntax modelObj = sbiomodel(’NameValue')
modelObj = sbiomodel(...’PropertyName', PropertyValue...)
Arguments
NameValue
PropertyName
PropertyValue
Description modelObj = sbiomodel(’NameValue') creates a model object and
returns the model object ( assigns a value (
modelObj = sbiomodel(...’PropertyName', PropertyValue...) defines
optional pro perties. The property name/property value pairs can be in any format supported by the function string pairs, structures, and name-value cell array pairs).
NameValue) to the property Name.
Required property to specify a unique name for a
model object. Enter a character string.
Property name for a Model object from “Property Summary” on page 2-54.
Property value. Valid value for the specified property.
modelObj). In the model object, this method
set (for example, name-value
Method Summary
2-52
Simulate
Add objects to a model object using the methods
addmodel, addparameter, addreaction, addrule,andaddspecies.
All SimBiology model objects can be retrieved from the SimBiology root object. A SimBiology model object has its the SimBiology root object.
addcompartment (model, compartment)
addconfigset (model) Create configuration set object
modelObj with the function sbiosimulate.
addkineticlaw,
Parent property set to
Create compartment object
and add to model object
sbiomodel
adddose (model) Add d os e object to model
addevent (model) Add event object to model object
addparameter (model, kineticlaw) Create parameter object and add
to model or kinetic law object
addreaction (model) Create reaction object and add to
model object
addrule (model) Create rule object and add to
model object
addvariant (model) Add variant to model
copyobj (any object) Copy SimBiology object and its
children
delete (any object) Delete SimBiology object
display(anyobject) DisplaysummaryofSimBiology
object
get (any object) Get object properties
getadjacencymatrix (model) Get adjacency matrix from model
object
getconfigset (model) Get configuration set object from
model object
getdose (model) Return S i mBiology dose object
getstoichmatrix (model) Get stoichiometry matrix from
model object
getvariant (model) Get variant from model
removeconfigset (model) Remove configuration set from
model
removedose (model) Add dose object to model
removevariant (model) Remove variant from model
reorder (model, compartment)
Reorder component lists
2-53
sbiomodel
set (any object) Set object properties
setactiveconfigset (model) Set active configuration set for
model object
verify (model, variant) Validate and verify SimBiology
model
Property Summary
Annotation
Compartments
Events
Models
Name
Notes
Parameters
Parent
Reactions
Rules
Tag
Type
UserData
Store link to URL or file
Array of compartments in model or compartment
Contain all event objects
Contain all model objects
Specify name of object
HTML text describing SimBiology object
Array of parameter objects
Indicate parent object
Array o f reaction objects
Array of rules in model object
Specify label for SimBiology object
Display top-level SimBiology object type
Specifydatatoassociatewith object
Examples 1 Create a SimBiology model object.
modelObj = sbiomodel('cell', 'Tag', 'mymodel');
2-54
2 List all modelObj properties and the current values.
get(modelObj)
MATLAB returns:
Annotation: ''
Models: [0x1 double]
Name: 'cell'
Notes: ''
Parameters: [0x1 double]
Parent: [1x1 SimBiology.Root]
Species: [0x1 double]
Reactions: [0x1 double]
Rules: [0x1 double]
Tag: 'mymodel'
Type: 'sbiomodel'
UserData: []
sbiomodel
3 Display a summary of modelObj contents.
modelObj
SimBiology Model - cell
Model Components:
Models: 0 Parameters: 0 Reactions: 0 Rules: 0 Species: 0
See Also addcompartment, addconfigset, addevent, addkineticlaw, addmodel,
addparameter, addreaction, addrule, addspecies, copyobj, get, sbioroot, sbiosimulate, set
2-55
sbionlinfit
Purpose Nonlinear least-squares regression using SimBiology models
Syntax results = sbionlinfit(modelObj, pkModelMapObject, pkDataObj,
Beta0)
results = sbionlmefit(modelObj, pkModelMapObject,
pkDataObject, Beta0,'ParameterName',ParameterValue)
results = sbionlinfit(modelObj, pkModelMapObject, pkDataObj,
Beta0, ...)
[results, SimDataI] = sbionlinfit(...)
Description
Note This function requires nlinfit in Statistics T oolbox™ (Version
7.0 or later).
results = sbionlinfit(modelObj, pkModelMapObject, pkDataObj, Beta0)
modelObj and returns estimated results in the r esu lts structure.
results = sbionlmefit(modelObj, pkModelMapObject, pkDataObject, Beta0,'ParameterName',ParameterValue)
comma-separated parameter name/value pairs that are accepted by
nlinfit. In addition, lets you specify a transformation function for each
of the estimated parameters using
performs least-squares regression using the SimBiology model,
accepts one or more
ParamTransform.
Input Arguments
2-56
results = sbionlinfit(modelObj, pkModelMapObject, pkDataObj, Beta0, ...)
See
nlinfit in the Statistics Toolbox User’s Guide for information on
lets you supply additional arguments accepted by nlinfit.
the accepted properties.
[results, SimDataI] = sbionlinfit(...) returns simulations of
the SimBiology model,
modelObj, using the estimated values of the
parameters.
modelObj
SimBiology model object used to fit observed data.
pkModelMapObject
sbionlinfit
PKModelMap object that defines the roles of the model components
in the estimation. For more information, see
pkDataObj
PKData object that defines the data to use in fitting, and the roles
of the data columns used for estimation. For more information, see
PKData object.
Beta0
A vector of initial estimates for the f ix ed effects. The length of
modelMapObject.Estimated. The final estimates for the fixed
effects defined in
Beta0 must equal at least the length of
Beta0 are log transformed in the results.
For more information on specifying initial estimates, see “Setting Initial Estimates” in the SimBiology documentation.
Parameter Name/Value Pairs
This section contains a partial list of supported name/value pairs. For a complete list, see
nlinfit in the Statistics Toolbox documentation.
PKModelMap object.
ParamTransform
A vector of values specifying a transformation function f() for each of the estimated parameters:
estimate = f(Beta). Each
element of the vector must be one of the following integer codes specifying the transformation f or the corresponding value of estimate:
0 – estimate = Beta
1 log(estimate) = Beta (default for all parameters).
2 – probit(estimate) = beta
3 logit(estimate) = beta
For more information, see “Specifying Parameter Transformations” in the SimBiology documentation.
2-57
sbionlinfit
Output Arguments
results
A structure with the following fields:
estimate — Fitted coefficients
beta — Fitted coefficients in transformed space
R —Residuals
J —Jacobianofthemodel
COVB — Estimated covariance matrix for the fitted coefficients
mse — Estimate of the error of the variance term
SimDataI
SimDataI contains simulation results for individuals.
See Also PKData object | PKModelDesign object | PKModelDesign object |
PKModelMap object | Model object | sbionlmefit | nlinfit
2-58
Purpose Estimate nonlinear mixed effects using SimBiology models
Syntax results = sbionlmefit(modelObj, pkModelMapObject,
pkDataObject, Beta0)
results = sbionlmefit(modelObj, pkModelMapObject,
pkDataObject, Beta0,'ParameterName',ParameterValue) ... = sbionlmefit(..., optionStruct) [results, SimDataI, SimDataP] = sbionlmefit(...)
Description
Note This function requires nlmefit in Statistics Toolbox (Version
7.0 or later).
results = sbionlmefit(modelObj, pkModelMapObject, pkDataObject, Beta0)
SimBiology model,
results structure.
results = sbionlmefit(modelObj, pkModelMapObject, pkDataObject, Beta0,'ParameterName',ParameterValue)
comma-separated parameter name/value pairs that are accepted by
nlmefit.SpecifyParameterName inside s ingle quotes.
performs nonlinear mixed effects estimation using the
modelObj and returns estimated results in the
accepts one or more
sbionlmefit
... = sbionlmefit(..., optionStruct) where optionStruct lets you
construct a names accepted by
struct that contains field names that are the parameter
nlmefit and field values that are the associated
parameter values.
SimBiology software contains a function (
sbiofitstatusplot)thatyou
can specify in the options structure. This function lets you monitor the status of fitting.
[results, SimDataI, SimDataP] = sbionlmefit(...) returns
simulation data of the SimBiology model,
modelObj, using the estimated
values of the parameters.
2-59
sbionlmefit
Input Arguments
modelObject
SimBiology model object used to fit observed data.
pkModelMapObject
PKModelMap object that defines the roles of the model components
used for estimation. For more information, see
object
pkDataObject
PKData object that defines the data to use in fitting and the roles
of the columns used for estimation.
.
pkDataObject must define
PKModelMap
target data for at least two groups. For more information, see
PKData object.
Beta0
A vector of initial estimates for the fixed effects. The first P elements of Beta0 correspond to the fixed effects for each of the
P elements of modelMapObject.Estimated.Additional
elements correspond to the fixed effects for covariate factors. The first
P elements of Beta0 are transformed as specified by the
ParamTransform nlmefit option (log transformed by default).
For more information on specifying initial estimates see in the SimBiology documentation.
optionStruct
2-60
A struct that can contain fields and values where the field names are the parameter-names accepted by
nlmefit and the field
values are the associated parameter-values.
Parameter Name/Value Pairs
This section contains a partial list of supported name/value pairs. For a complete list, see
FEGroupDesign
nlmefit in the Statistics Toolbox documentation.
Specify the design matrix for each of the groups. See “Specifying the Covariate Model” in the SimBiology documentation.
ParamTransform
Specify how the parameters are distributed. The available distributions are: Parameter Transformations” in the SimBiology documentation.
none, log, probit,andlogit.See“Specifying
sbionlmefit
Output Arguments
Default:
See nlmefit in the Statistics Toolbox documentation for information on all the accepted properties including
ParamTransform.
The following parameter name/value pairs are not supported:
FEConstDesign
FEObsDesign
FEParamsSelect
REConstDesign
REGroupDesign
REObsDesign
Vectorization
Jacobian
results
A structure with the following fields:
A
log
FEGroupDesign,and
results structure containing
- estimate — Estimates for the fixed effects.
- phiP — Estimated parameter values for the population
- phiI — Estimated parameter values for individuals
- beta — Esti m ates for the fixed effects in transformed s pace
as specified in the
ParamTransform option.
2-61
sbionlmefit
- psi — Estimated covariance matrix of the random effects
- stats — Structure with statistics such as AIC, and BIC.
For a complete list see documentation.
- b — Estimated random effects for each group in
observedData
SimDataI
SimDataI contains the data from simulating the model using the
estimated parameter values, for individuals.
SimDataP
SimDataP contains the data from simulating the model using the
estimated parameter values, for the population.
See Also PKData object | PKModelDesign object | PKModelMap object |
Model object | sbiofitstatusplot | sbionlinfit | sbionlmefitsa
| nlmefit
nlmefit in the Statistics Toolbox
How To • “Fitting Pharmacokinetic Model Parameters at the Command Line”
2-62
sbionlmefitsa
Purpose Estimate nonlinear mixed effects with stochastic EM algorithm
Syntax results = sbionlmefitsa(modelObj, pkModelMapObject,
pkDataObject, Beta0) results = sbionlmefitsa(modelObj, pkModelMapObject,
pkDataObject, Beta0,'ParameterName',ParameterValue) ... = sbionlmefitsa(..., optionStruct) [results, SimDataI, SimDataP] = sbionlmefitsa(...)
Description
Note This function requires nlmefitsa in Statistics Toolbox (Version
7.0 or later).
results = sbionlmefitsa(modelObj, pkModelMapObject, pkDataObject, Beta0)
Expectation-Maximization (SAEM) algorithm for fitting p opulation data w ith the SimBiology model, results in the
estimations using the Stochastic Approximation
modelObj and returns the estimated
results structure.
results = sbionlmefitsa(modelObj, pkModelMapObject, pkDataObject, Beta0,'ParameterName',ParameterValue)
accepts one or more
comma-separated parameter name/value pairs that are accepted by
nlmefitsa.SpecifyParameterName inside single quotes.
... = sbionlmefitsa(..., optionStruct) lets you construct a struct
that contains field names that are the parameter names accepted by
nlmefitsa and field values that are the associated param eter values.
SimBiology software contains a function (
sbiofitstatusplot)thatyou
can specify in the options structure. This function lets you monitor the status of fitting.
[results, SimDataI, SimDataP] = sbionlmefitsa(...) returns
simulation data of the SimBiology model,
modelObj, using the estimated
values of the parameters.
2-63
sbionlmefitsa
Input Arguments
modelObject
SimBiology model object used to fit observed data.
pkModelMapObject
PKModelMap object that defines the roles of the model components
used for estimation. For more information, see
object
pkDataObject
PKData object that defines the data to use in fitting and the roles
of the columns used for estimation.
.
pkDataObject must define
PKModelMap
target data for at least two groups. For more information, see
PKData object.
Beta0
A vector of initial estimates for the fixed effects. The first P elements of Beta0 correspond to the fixed effects for each of the
P elements of modelMapObject.Estimated.Additional
elements correspond to the fixed effects for covariate factors. The first
P elements of Beta0 are transformed as specified by the
ParamTransform nlmefit option (log transformed by default).
For more information on specifying initial estimates see in the SimBiology documentation.
optionStruct
2-64
A struct that can contain fields and values where the field names are the parameter names accepted by
nlmefitsa and the field
values are the associated parameter v alu es.
Parameter Name/Value Pairs
This section contains a partial list of supported name/value pairs. For a complete list, see
ErrorModel
nlmefitsa in the Statistics Toolbox documentation.
Specify the error term. The available error models are:
sbionlmefitsa
constant
proportional
combined
exponential
See “Specifying an Error Model” in the SimBiology documentation.
Default:
FEGroupDesign
Specify the design matrix for each of the groups. S ee in the SimBiology documentation.
ParamTransform
Specify parameter transformations. The available transformations are: Transformations” in the SimBiology documentation.
Default:
See nlmefitsa in the Statistics Toolbox documentation for information on all the a ccepted properties including
ParamTransform and ErrorModel.
The following parameter name/value pairs are not supported:
FEConstDesign
FEObsDesign
FEParamsSelect
REConstDesign
constant
none, log, probit,andlogit. See “Specifying Parameter
log
FEGroupDesign,
REGroupDesign
REObsDesign
2-65
sbionlmefitsa
Vectorization
Jacobian
Output Arguments
results
A structure with the following fields:
A
results structure containing
- estimate — Estimates for the fixed effects.
- phiP — Estimated parameter values for the population
- phiI — Estimated parameter values for individuals
- beta — Esti m ates for the fixed effects in transformed s pace
as specified in the
ParamTransform option.
- psi — Estimated covariance matrix of the random effects
- stats — Structure with statistics such as AIC, and BIC.
For a complete list see documentation.
nlmefitsa in the Statistics Toolbox
- b — Estimated random effects for each group in
observedData
SimDataI
SimDataI contains the data from simulating the model using the
estimated parameter values, for individuals.
SimDataP
SimDataP contains the data from simulating the model using the
estimated parameter values, for the population.
See Also PKData object | PKModelDesign object | PKModelMap object |
Model object | sbiofitstatusplot | sbionlinfit | sbionlmefit
| nlmefit
2-66
How To
sbionlmefitsa
2-67
sbionmfiledef
Purpose NONMEM file definition object for sbionmimport
Syntax nmdefObj = sbionmfiledef
nmdefObj = sbionmfiledef('PropertyName', PropertyValue)
Description nmdefObj = sbionmfiledef creates an NONMEM file definition object.
The NONMEM file definition object contains properties for specifying the NONMEM data items such as group, time, and dependent variable. The NONMEM file definition object lets you configure the properties to the column heading or the index of the column. Use the NONMEM file definition object in conjunction with the import NONMEM formatted files for use in fitting.
nmdefObj = sbionmfiledef('PropertyName', PropertyValue)
accepts one or more comma-separated property name/value pairs. Specify interpretations for NONMEM formatted files see “Support for Importing NONMEM F ormatted Files” in the SimBiology documentation.
PropertyName inside single quotes. To see the default
sbionmimport function to
Tips • Use sbionmfiledef with sbionmimport if you want to apply
NONMEM interpretation of headers, and the data file has column header labels different from the table shown in “Support for Importing NONMEM Formatted Files”
Input Arguments
2-68
Use
Filename
Property Name/Value Pairs
CompartmentLabel
sbionmimport if the data file has column header labels identical
to the table shown in “Support for Importing NONMEM Formatted Files”.
If Filename extension is .xls or .xlsx it is assumed to be an Excel
sbionmfiledef file reads the file using the dataset constructor.
®
file, otherwise it is assumed to be a text file.
sbionmfiledef
Identifies the column in the NONMEM formatted file that contains the compartment. Specify the header name as a
string
the
or specify the index number of the header. During import
sbionmimport function uses the information in the column
to interpret which compartment receives a dose or measured an observation. The
EventIDLabel property specifies whether the
value is a dose or an observation.
char
Default:
ContinuousCovariateLabels
''
Identifies the column in the NONMEM formatted file that contains continuous covariates. Specify the header name as a
char string or specify the index number of the header.
Default:
DateLabel
{}
Identifies the column in the NONMEM formatted file that contains the date. Specify the header name as a
char string
or specify the index number of the header. During import the
sbionmimport function uses the information in the column to
interpret time information for each dose, response and covariate measurements.
Default:
DependentVariableLabel
''
Identifies the column in the NONMEM formatted file that contains observations. S pecify the header name as a or specify the index number of the header. During import the
sbionmimport function uses the information in the column to
interpret date and time information for each dose and response.
char string
Default:
''
2-69
sbionmfiledef
DoseLabel
Identifies the column in the NONMEM formatted file that contains the dosing information. Specify the header name as a
char string or specify the index number of the header.
Default:
DoseIntervalLabel
''
Identifies the column in the NONMEM formatted file that contains the time between doses. Specify the header name as a
char string or specify the index number of the header.
Default:
DoseRepeatLabel
''
Identifies the column in the NONMEM formatted file that contains the number of times (excluding the initial dose) that the dose is repeated. Specify the header name as a
char string or
specify the index number of the header.
Default:
EventIDLabel
''
Identifies the column in the NONMEM formatted file that contains the event identification specifying whether the value is a dose, observation, or covariate. Specify the header name as a
char string or specify the index number of the header.
2-70
Default:
GroupLabel
''
Identifies the column in the NONMEM formatted file that contains the Group ID. Specify the h eader name as a or specify the index number of the header.
char string
sbionmfiledef
Default: ''
MissingDependentVariableLabel
Identifies the column in the NONMEM formatted file that contains information about whether a row contains an observation event ( or specify the index number of the header.
0), or not (1). Specify the header name as a char string
Output Arguments
Default:
RateLabel
''
Identifies the column in the NONMEM formatted file that contains the rate of infusion. Specify the header name as a
string
Default:
TimeLabel
or specify the index number of the header.
''
Identifies the column in the NONMEM formatted file that containsthetimeordateofobservation. Duringimportthe
sbionmimport function uses this information to interpret when
a dose was given, an observation or covariate measurement recorded. Specify the header name as a
char string or specify
the index number of the header.
Default:
Type
''
Identifies the object as 'NMFileDef',(Read-only).
nmdefObj
Defines the meanings of the file column headings. It contains properties for specifying data items such as group, time and date.
TimeLabel and DependentVariableLabel must be specified.
char
2-71
sbionmfiledef
Examples Configure a NONMEM file definition object and import data from a
NONMEM formatted file.
% Configure a NMFileDef object.
def = sbionmfiledef; def.CompartmentLabel = 'CPT'; def.DoseLabel = 'AMT'; def.DoseIntervalLabel = 'II'; def.DoseRepeatLabel = 'ADDL'; def.GroupLabel = 'ID'; def.TimeLabel = 'TIME'; def.DependentVariableLabel = 'DV'; def.EventIDLabel = 'EVID';
filename = 'C:\work\datafiles\dose.xls'; ds = sbionmimport(filename, def);
See Also sbionmimport
How To • “Importing Data at the Command Line”
• “Importing Data into the SimBiology Desktop”
2-72
sbionmimport
Purpose Import NONMEM formatted data
Syntax simbioDataset = sbionmimport('Filename')
simbioDataset = sbionmimport (nmds) simbioDataset = sbionmimport('Filename', nmdefObj) simbioDataset = sbionmimport('Filename', nmdefObj,
'ParameterName', ParameterValue) simbioDataset = sbionmimport(nmds, nmdefObj) [simbioDataset, PKDataObj] = sbionmimport(...)
Description simbioDataset = sbionmimport('Filename') or simbioDataset
= sbionmimport (nmds)
assumes that the file is configured to use the following default values for column headers:
EVID, ID, II, MDV, RATE, TIME. See “Support for Importing NONMEM
Formatted File s ” in the SimBiology documentation for m ore information on each of the headers.
simbioDataset = sbionmimport('Filename', nmdefObj) imports a
NONMEM formatted file named data set,
simbioDataset, using the meanings of the file column
headings defined in the NONMEM file definition object (
converts a N ON ME M formatted file, and
ADDL, AMT, CPT, DATE , DAT1, DAT2,orDAT3, DV,
Filename, into a SimBiology formatted
nmdefObj).
simbioDataset = sbionmimport('Filename', nmdefObj, 'ParameterName', ParameterValue)
accepts one or more
comma-separated parameter name/value pairs that are accepted by the
dataset function. If dataset requ ires additional information to read
the file such as the delimiter, specify these as property value pairs in
sbionmimport.Seedataset in the Statistics Toolbox documentation for
a list of supported property value pairs.
simbioDataset = sbionmimport(nmds, nmdefObj) converts a
NONMEM formatted
dataset array (nmds), into a SimBiology
formatted data set.
[simbioDataset, PKDataObj] = sbionmimport(...) returns a
PKData object,
PKDataObj properties show the labels specified in simbioDataset.
PKDataObj containing the data set simbioDataset.The
2-73
sbionmimport
Input Arguments
Output Arguments
Filename
If extension of Filename is .xls or .xlsx, sbionmimport assumes it to be an Excel file. Otherw ise is a text file. sbionmimport reads the file using the dataset constructor.
nmds
nmds is an NONM EM formatted dataset object, in other words a
NONMEM formatted file imported using the For more information see dataset in the Statistics Toolbox documentation.
nmdefObj
nmdefObj defines the m eanings of the file column headings. nmdefObj is a NONMEM file definition object created using the
sbionmfiledef function. It contains properties for specifying
data items such as group, time, and date. You must specify the
TimeLabel and the DependentVariableLabel properties.
simbioDataset
The SimBiology formatted data set uses a separate column for each dose and observation. The
simbioDataset contains a list of warnings that occurred while
constructing
(simbioDataset, 'Description')
simbioDataset. To view the warnings enter: get
sbionmimport assumes Filename
dataset command.
Description property of
.
PkDataObj
The PKData object defines the data to use in fitting and the roles of the columns used for estimation. For more information, see
PKData object.
See Also sbionmfiledef
How To • “Importing Data at the Command Line”
2-74
• “Importing Data into the SimBiology Desktop”
sbionmimport
2-75
sbioparamestim
Purpose Perform parameter estimation
Syntax [k, result]= sbioparamestim(modelObj, tspan, xtarget,
species_array, parameter_array)
[...]= sbioparamestim(..., species_array, parameter_array,
k0)
[...]= sbioparamestim(..., species_array, parameter_array,
k0, method)
Arguments
k
result
tspan
xtarget
Vector of estimated parameter values. For all optimization methods except parameters are constrained to be greater than or equal to zero.
struct
with fields that provide information
about the progress of optimization.
An n-by-1 vector representing the time span of the target data
xtarget.
An n-by-m matrix, where n is the number of time samples and
m is the number of states you would
like to match during the simulation. States can only be spec ies varying with time. You cannot use time varying (nonconstant) parameters. The number of rows of the number of rows of
xtarget mustbethesameas
tspan.
'fminsearch' the
2-76
sbioparamestim
species_array
parameter_array
Either an array of species objects or a cell array of names of species in
modelObj whose amounts
should be matched during the estimation process. The length of the
species_array
must be the same as the number of columns in
xtarget. If there are species with duplicate
names in d ifferent compartments, either use qualified names to identify the species correctly or use an array of species objects to identify the species correctly. the order of the specie s in
sbioparamestim assumes that
species_array is
thesameastheorderusedtospecifycolumns of
xtarget. For example, a qualified name for
aspeciesnamed named
comp2 is comp2.sp1.
sp1 that is in a compartment
Either an array of parameter objects or a cell array of names of parameters in
modelObj whose
values should be estimated. If you do not specify
parameter_array, sbioparamestim estimates
all the parameters in the model. When a vector of parameter initial values (
sbioparamestim takes the initial values from
modelObj. When there are parameters with
k0) is not specified,
duplicate names, use either parameter objects or qualified parameter names to identify the right parameter object. For example, for a parameter named named
reaction1 and at the kinetic law level,
the qualified nam e is
param1 used in a reaction
reaction1.param1.
2-77
sbioparamestim
k0
method
Array of doubles that holds initial values of parameters to be estimated. The length of same as that of specify
k0, sbioparamestim ignores any initial
parameter_array.Whenyou
k0 is
values specified in active variants attached to the model. If left unspecified,
sbioparamestim
takes initial values for parameters from the model (
sbioparamestim uses any initial values specified
in the active variants. See
modelObj) or, if there are active variants,
Variant object for
more information about variants.
Either a string or a cell array. If it is a
string, it must be the nam e of the optimization
algorithm to be used during the estimation process. Valid values are
'lsqcurvefit', 'lsqnonlin', 'fmincon', 'patternsearch', 'patternsearch_hybrid', 'ga',or'ga_hybrid'.
'fminsearch',
If it is a cell array, it must have two elements: thefirstoneisthenameoftheoptimization method as described before and the second element is a MATLAB
optimset, gaoptimset,orpsoptimset.
struct as returned by
sbioparamestim uses the cell array option to
specify user-defined optimization options.
Note that
'fminsearch' is an unconstrained
optimization method and this could result in negative values for parameters.
Description [k, result]= sbioparamestim(modelObj, tspan, xtarget,
estimates parameters of the
species_array with the target state
2-78
species_array, parameter_array)
SimBiology model object (
modelObj), specified in parameter_array,
so as to match species given by (
xtarget), whose time variation is given by the time span tspan.
modelObj must be a top-level SimBiology model. A top-level SimBiology
model object has its If the Optimization Toolbox™ product is installed, uses lsqnonlin for parameter estimation. If the Optimization Toolbox product is not installed,
[...]= sbioparamestim(..., species_array, parameter_array, k0)
lets you specify the initial values of parameters.
[...]= sbioparamestim(..., species_array, parameter_array, k0, method)
lets you specify the optimization m ethod to use.
Examples Example 1
Given a m odel and some target data, estimate all of its parameters withouthavingtospecifyanyinitialvalues. This is the simplest case. Estimate all of its parameters using the default method.
1 Load a model from the project, gprotein_norules.sbproj.The
project contains two models, one for the wild-type strain (stored in variable Load the G protein model for the wild-type strain.
sbioparamestim
Parent property set to the SimBiology root object.
sbioparamestim
sbioparamestim uses fminsearch.
m1), and one for the mutant strain (stored in variable m2).
sbioloadproject gprotein_norules m1;
2 Store the target data in a var
Gt = 10000; tspan = [0 10 30 60 110 210 300 450 600]'; Ga_frac = [0 0.35 0.4 0.36 0.39 0.33 0.24 0.17 0.2]'; xtarget = Ga_frac * Gt;
3 Store all model parameters in an array.
p_array = sbioselect(m1,'Type','parameter');
4 Store the species that should match target.
Ga = sbioselect(m1,'Type','species','Name','Ga'); % In this example only one species is selected.
iable.
2-79
sbioparamestim
5 Estimate the parameters.
% To match more than one targeted species data % replace with selected species array.
[k, result] = sbioparamestim(m1, tspan, xtarget, Ga, p_array)
k=
0.1988
0.0000
0.0045
6.2859
0.0040
0.9726
0.0000
0.1164
result =
2-80
fval: 8.7248e+005 residual: [9x1 double] exitflag: 2
iterations: 2
funccount: 27 algorithm: 'large-scale: trust-region reflective Newton'
message: [1x77 char]
Example 2
Estimate parameters specified in p_array and species specified in
sp_array using different algorithms. This example uses the data from
“Example 1” on page 2-79 .
[k1,r1] = sbioparamestim(m1, tspan, xtarget, Ga, p_array, ...
{}, 'fmincon');
[k2,r2] = sbioparamestim(m1, tspan, xtarget, Ga, p_array, ...
{}, 'patternsearch');
[k3,r3] = sbioparamestim(m1, tspan, xtarget, Ga, p_array, ...
sbioparamestim
{}, 'ga')
Example 3
Estimate parameters specified in p_array, species specified in
sp_array, and change default optimization options to use user-specified
options. This example uses the data from “Example 1” on page 2-79.
myopt1 = optimset('Display','iter'); [k1,r1] = sbioparamestim(m1, tspan, xtarget, ...
sp_array, p_array, {},{'fmincon', myopt1});
myopt2.Tolmesh = 1.0e-4; [k2,r2] = sbioparamestim(m1, tspan, xtarget, ...
sp_array, p_array, {},{'patternsearch', myopt2});
myopt3.PopulationSize = 50; myopt3.Generations = 20; [k3,r3] = sbioparamestim(m1, tspan, xtarget, ...
sp_array, p_array, {},{'ga', myopt3});
Reference Tau-Mu Yi, Hiroaki Kitano, and Melvin I. Simon. PNAS (2003) vol.
100, 10764–10769.
See Also SimBiology functions sbiomodel, sbiogetnamedstate
MATLAB function optimset
Global O p timization Toolbox functions gaoptimset, psoptimset
2-81
sbioparameter
Purpose Construct parameter object
Note sbioparameter has been removed and produces an error. Use
addparameter instead.
Syntax parameterObj = sbioparameter(Obj, NameValue)
parameterObj = sbioparameter(Obj, NameValue, ValueValue) parameterObj = sbioparameter(...’PropertyName', PropertyValue...)
Arguments
Obj
NameValue
Model object or kinetic law object.
Property for a parameter object. Enter a unique character string. Since objects can use this property to reference a parameter, a parameter object must have a u n iq u e name at the level it is created. For example, a kinetic law object cannot contain two parameter objects named
kappa. However, the model object that contains
the kinetic law object can contain a parameter object named object.
kappa along with the kinetic law
ValueValue
You can use the function object with a s pecific
For information on naming parameters, see
Name.
Value of a parameter object. Enter a number.
sbioselect to find an
Name property value.
Description parameterObj = sbioparameter(Obj, NameValue) constructs a
2-82
SimBiology parameter object, enters a value ( required property
To use a parameter object ( theobjecttoaSimBiologymodel,orkinetic law object with the method
Name, and returns the object (parameterObj).
paramaterObj) in a simulation, you must add
NameValue)forthe
sbioparameter
copyobj.Youcanusetheaddparameter method to simultaneously
create and assign a parameter to a model or kinetic law object.
parameterObj = sbioparameter(Obj, NameValue, ValueValue) creates
a parameter object, assigns a value ( assigns the value (
ValueValue) to the property Value and returns the
parameter object to a variable (
parameterObj = sbioparameter(...’PropertyName', PropertyValue...)
defines optional properties. The property name/property value pairs can be in any format supported by the function name-value string pairs, structures, and name-value cell array pairs).
Copy a SimBiology parameter object to a SimBiology model or kinetic law object with the method
copyobj. Remove a parameter object from a
model or kinetic law object with the method
NameValue) to the property Name,
parameterObj).
set (for example,
delete.
Method Summary
View additional parameter object properties with the Modify additional parameter object properties with the You can find help for
PropertyName FunctionName
commandandhelpforfunctionswiththesbiohelp command.
parameterObj properties with the help
get command.
set command.
copyobj (any object) Copy SimBiology object and its
children
delete (any object) Delete SimBiology object
display(anyobject) DisplaysummaryofSimBiology
object
get (any object) Get object properties
rename (compartment, parameter, species)
Rename object and update expressions
set (any object) Set object properties
2-83
sbioparameter
Property Summary
Annotation
ConstantValue
Name
Notes
Parent
Tag
Type
UserData
Value
ValueUnits
Examples 1 Construct a parameter object.
parameterObj = sbioparameter('kappa', 1); % View the help for the parameter object's Value property. help(parameterObj, 'Value')
Store link to URL or file
Specify variable or constant parameter value
Specify name of object
HTML text describing SimBiology object
Indicate parent object
Specify label for SimBiology object
Display top-level SimBiology object type
Specifydatatoassociatewith object
Assign value to param ete r object
Parameter value units
2-84
2 View parameter object properties.
get(parameterObj)
MATLAB returns:
Annotation: ''
ConstantValue: 1
Name: 'kappa'
Notes: ''
Loading...