PottersWheel
PottersWheel
Opens the main user interface and initializes PottersWheel.
This can also be achieved with the command pw.
See also
pc
pc
Opens the configuration dialog.
See also
pe
pe
Opens the PottersWheel Equalizer.
See also
pw
pw
Switches to the main PottersWheel interface.
Initializes PottersWheel if not yet done.
See also
pwAdaptFitToLevelOfHistoryStorage
fit = pwAdaptFitToLevelOfHistoryStorage(fit)
Reduces the size of a fit depending on the current
level of history storage for a single fit as specified in
config.optimization.levelOfHistoryStorage
See also
pwAdaptInstructions
instructionsOut = pwAdaptInstructions(model, instructionsIn)
Adapts a custom instruction struct (see pwAddInstructions)
to a struct that can be used in conjunction with the given model.
Let the given instructions be a struct array of length n and
1 <= i <= n:
instructionsIn(i):
.t
.name
.stimuli.uID = pwGetDrivingFunction(...)
Which leads to the fields:
.uTimes
.uValues
.u2Values
.uType
.referenceXID
The returned instruction struct has n stimuli,
each comprising d driving functions.
The quantity d is defined by the number of driving functions of the
given model. Let 1 <= i <= n and 1 <= j <= d:
instructionsOut:
.stimuli(i).t
.stimuli(i).name
.stimuli(i).drivingFunctions(j).uTimes
.uValues
.u2Values
.uType
.referenceXID
See also
pwAddA
m = pwAddA(m, lhs, reactants, parameters, signature, type, timePoint, ...
description, ID, name, designerProps, classname, targetType, ...
compartment, valueType)
or: m = pwAddA(m, lhs, rhs, [], [], type)
Adds an algebraic equation to a model, equivalent to a rule in SBML.
Currently, explicit equations (assignments) and start value assignments are supported.
Implicit equations like a+b+c=0 are not yet supported.
Arguments for pwAddA
lhs string Left hand side of the assigned quantity, usually an ID
reactants ID array Used variables either from x or u (or y for start value assignments)
This field is named reactants because the placeholders
r1, r2, etc. are used within the signature in order to
refer to the first, second, etc. variable of the "reactants".
parameters ID array Used parameters either from k or s
signature string The right hand side expression using placeholders
r1, r2, ... and k1, k2, ... for the variables and parameters.
type string 'assignment' or 'startValueAssignment'
timePoint float Time when the start value assignment should be applied.
If not specified, the integration start time is used.
description string
ID string ID of the equation, usually the lhs.
name string
designerProps cell array Layout information internally used in the model designer.
classname string
targetType string 'species', 'parameter', or 'compartment'
compartment string
valueType string 'concentration','amount'. Default: 'concentration'
Description
PottersWheel supports explicit algebraic equations, which are evaluated before
every integration step. The assigned quantities can be used as modifiers or
parameters in the reactions.
Apart from assignments which are fulfilled throughout the integration,
startValueAssignments are applied only once, usually before integration starts.
The list of variables is interpreted similarly as in the reactions paragraph:
r1 in the rule signature corresponds to the first reactant
and k2 to the second parameter. Variables can be dynamic
variables x, driving inputs u and already assigned
quantities a. Parameters can be dynamic parameters k.
The timePoint can be specified to define the exact time when the
assignment should be executed. This is only possible for type 'startValueAssignment'.
If no timePoint is given, the assignment if always executed at integration start
(in most cases 0).
Alternative syntax:
As a shortcut, expressions like
m = pwAddA(m, 'Stat_cyt', 'Stat + pStat + pStatDimer')
are allowed, i.e., the right hand side is specified directly and
not via a list of variables and parameters and a ruleSignature.
However, it is recommended to use the normal syntax.
Important: The shortcut can only be applied if all elements of
the right hand side are already defined. Therefore please put
pwAddA below pwAddU, pwAddK, pwAddK, etc.
Fitting
Since the algebraic rule determines the value of the parameter or modifier,
it is not possible to fit the same quantity.
Difference to SBML
The notation used within PottersWheel is closer to the mathematical
representation of the dynamical system. The SBML notation is closer
to the biochemical representation.
In PottersWheel, a dynamic variable 'x' is always part of the set of differential
equations and a dynamic parameter 'k' is always independent from all other parameters
and can potentially be fitted. Algebraic assignments 'a' are (algebraically)
calculated based on x, k, and other algebraic assignments.
In SBML, a species is either determined by the
differential equations, a rate rule, or an algebraic equation. A parameter is
either free or determined by an algebraic equation.
Compatibility is ensured by specifying the 'targetType' of an algebraic equation
in PottersWheel. If the target type is not specified, it is guessed by the following
approach: If the lhs appears as a dynamic variable x or driving input u, the target
type is set to 'species'. If it appears as a parameter in a reaction, it is a 'parameter'.
It is not allowed to use an assigned quantity as a parameter and a modifier in
the same model. The guessing can only be applied, if all reactions are known
before the assignment is added.
Examples
Example 1: Normal assignment
m = pwAddA(m, 'Stat_cyt', {'Stat','pStat','pStatDimer'}, {}, 'r1+r2+r3');
Example 2: Time dependent equation
It is possible to use t in the signature, e.g. for time dependent compartment
sizes like
m = pwAddA(m, 'NucleusSize', {}, {'InitialNucleusSize', 'GrowthRate'}, 'k1 + k2*t');
The parameters 'InitialNucleusSize' and 'GrowthRate' are
normal parameters and can be fitted.
Example 3: Start value assignment
m = pwAddA(m, 'Stat', {'Stat_obs'}, {'scale_Stat_obs'}, 'r1/k1', 'startValueAssignment');
This sets the value of Stat to Stat_obs/scale_Stat_obs at t=0 and
forces the trajectory through the first measured data point.
See also
pwAddC
m = pwAddC(m, ID, size, outside, spatialDim, name, unit, constant,
designerProps, classname, description)
Adds a compartment to the model, defined essentially by its ID and
the size which can be a number or the name of a parameter.
Arguments for pwAddC
m struct A model struct
ID ID Compartment ID
size float/string Size of the compartment
outside ID ID of the embracing compartment
spatialDim integer Dimension of the compartment
name string
unit string
constant integer constant size of compartment (1 yes, 0 no)
designerProps array [x y z w h r g b isVisible]
classname string E.g. 'cytoplasm' or 'nucleus'
description string
Description
Chemical reactions depend on the concentration of their reactants and products.
If a molecule enters a different compartment, e.g. the nuclues, the concentration
decrease in the cytoplasm may differ from the concentration increase in the
nucleus. Hence, handling the compartment volume is a crucial aspect for the
modeling of chemical reaction networks.
PottersWheel treats all x variables as concentrations!
Therefore, all plotted x trajectories are concentrations,
even if the start value for a variable was given as an amount.
If a system has two or more compartments, a reaction A -> B
with rate constant k, A being in compartment c1 and B in c2
leads to the following flux and change for the concentrations A and B:
v = (k * A) * c1 % flux (amount)
dA/dt = - v /c1 % concentration change
dB/dt = v /c2
Please open the dynamically generated ODE C file to see how PottersWheel
processed the reactions of your system.
Instead of a numeric value for the compartment size a parameter name
can be specified. This is useful if the compartment size should
be fitted.
Currently, only the ID and size information are processed within
PottersWheel. However, the other arguments are exported to SBML files.
See also
pwAddConstraint
m = pwAddConstraint(m, lhs, operator, rhs, reactants, parameters, lambda)
Adds constraints concerning system trajectory or parameter values
to the model, which will penalize the optimization function
if not fullfilled.
Argument Type Description
---------------------------------------------------------------------------------
lhs string Mathematical expression using placeholders ri, ki.
operator string '==', '<', '>'
rhs string Mathematical expression using placeholders ri, ki.
reactants ID Array Used variables.
parameters ID array Used parameters.
lambda float Weighing factor.
---------------------------------------------------------------------------------
Description
During optimization, all free parameters are calibrated to decrease
the distance between model trajectory and experimental
data. Lower and upper limits for the fitted parameter values can
be specified. However, sometimes more qualitative or
soft constraints exist, e.g. the maximum of player A should
not exceed 30% of the maximum of player B. These constraints
can be specified within the model definition file:
m = pwAddConstraint(m,'max(r1)', '<', '0.3 * max(r2)', {'A','B'}, {}, 100);
The weighing factor lambda determines how important the
constraint is compared to the residuals between data and model. If lambda
is small, the constraint may be violated in order to allow a better
fit of the data.
The chi-square value is increased by d^2, where d = constraint * lambda.
In the above example, the absolute values of max(A) and
max(B) influence the probability, that the constraint is fulfilled or
not. In order to avoid this, it is more suitable to specify it as follows:
pwAddConstraint(m, lhs, operator, rhs, reactants, parameters, lambda);
m = pwAddConstraint(m,'max(r1)/max(r2)', '<', '0.3', {'A','B'}, {}, 100);
Example
m = pwAddConstraint(m, 'k1', '==', 'r1(t==0)', {'A'}, {'A_0'}, 100);
This forces A to go through A_0 at t==0.
See also
pwAddData
[namesObservation, namesDataSet] = ...
pwAddData(filename, tryAutomatic, showPlots, namesObservation, namesDataSet)
pwAddData(dataSet, tryAutomatic, showPlots, namesObservation, namesDataSet)
Adds a data file from harddisk or a data set from Matlab workspace
to the currently selected models.
filename string Data file (xls or txt)
It is recommended to use
Microsoft Excel 5.0/95 Workbook xls files.
Then, no Excel has to be installed, but the
internal Matlab xls reader is able to open the file.
dataSet struct Alternative call to use a matrix
of the working space. See pwGetDataSet.
tryAutomatic bool If true (default) saved mappings of observables
names to data set columns are reused.
showPlots bool If true (default) the loaded data is displayed.
The figures are arranged automatically depending on
config.data.arrangeFigures
namesObservation string array
namesDataSet string array
In order to avoid the mapping dialog between model
observation and header names in the external data
file, the mapping can be specified as a string
cell array.
Supported file types
Please use Excel-95 or ASCII text files if the Excel-COM server is not available.
Else any Excel file is supported, including xlsx and csv.
Data matrix
The data matrix should contain one column with the time points.
The column name should start with "xCol-", e.g. "xCol-Time-min"
or just with "Time", e.g. "Time-min".
If the data file comprises multiple stimulations, please use
the column "parCol-Stimulus" or "Stimulus" to distinguish the stimulations
from each other: If in some row the value of the stimulus column is 5,
then all entries in this row belong to stimulus 5.
If you have only one stimulus, the stimulus column can be neglected.
Standard deviations
If available, the standard deviation can be specified in columns
with the prefix "stdCol-" before the name of the corresponding column.
E.g. main column "Erk" and standard deviations in "stdCol-Erk".
Important: If you want to use the standard deviations as given in the
data file, please specify this either in the configuration dialog or via:
config = pwGetConfig;
config.data.yStdCalculation = 2;
pwSetConfig(config);
Model-data mapping
May ask the user to map file columns to observation functions.
If tryAutomatic = true (default), PottersWheel checks for saved
mat files describing the connection between the current observation
and the data file. If you pressed 'Save' in the same mapping
dialog earlier, the connection mat file will be reused.
Recommendations
It is recommended to use only the following characters inside the file:
A-Za-z_,0-9 #.'-[]():
In ASCII files, columns have to be separated by a tabulator.
The filename should contain only [a-zA-Z0-9] and the underscore _.
Example
# Test file with experimental data.
# Stimulation with Epo.
# Experiment: Adam Smith.
# Two stimulations: 1 Continuous, 2 Pulse (5 min). Both with dose 6.
# Two observations: A and B
#
# Driving functions:
# MCode drivingFunctions(1).name = 'Epo';
# MCode drivingFunctions(1).stimuli(1)=pwGetDrivingFunction('steps',[-1 0], [0 6]);
# MCode drivingFunctions(1).stimuli(2)=pwGetDrivingFunction('steps',[-1 0 5],[0 6 0]);
#
# parCol-Stimulus xCol-Time A_obs B_obs
1 0 11.707 0.38078
1 3 4.17596 3.51887
1 6 1.71684 6.62109
1 9 1.83223 6.56341
1 12 1.34706 6.32869
2 0 13.707 0.58078
2 3 5.17596 4.51887
2 6 2.71684 7.62109
2 9 2.83223 7.56341
2 12 2.34706 7.32869
Alternavtively since PW 2.0.55:
# PottersWheel Data Format 2.0.55
#
# Header Name Stimulus Type Time points Values
# Input Epo 1 steps -1;0;5 0;6;0
# Input Epo 2 steps -1;0 0;6
#
# Stimulus Time A_obs B_obs
1 0 11.707 0.38078
1 3 4.17596 3.51887
1 6 1.71684 6.62109
1 9 1.83223 6.56341
1 12 1.34706 6.32869
2 0 13.707 0.58078
2 3 5.17596 4.51887
2 6 2.71684 7.62109
2 9 2.83223 7.56341
2 12 2.34706 7.32869
See also
pwAddDataFromDb
pwAddDataFromDb(dbFile, experiment, stimulations, useRegExp)
Adds one experiment from a PottersWheel database file to the
currently selected model.
dbFile Optional: Name of the database file. Compare pwDbCreate.
If empty, a selection GUI will be shown.
experiment Optional: Name of the experiment to be added.
If empty, a selection GUI will be shown.
stimulations Optional: String array of stimulations to be added.
If empty, a selection GUI will be shown.
If stimulations = 'all', all stimulations will be added.
useRegExp Boolean. If true, the elements of the stimulations string array
are treated as regular expression patterns. All stimulations are
added where one (or more) pattern matches.
Default: false
Description
Each PottersWheel database (PWDB) consists of a set of experiments.
Each experiment comprises a set of stimulations.
The present function allows to add one experiment to the
currently selected model(s) with all or only a subset of corresponding
stimulations. The used stimulations are specified in the
array <stimulationNames>.
See also
pwAddDataFromLibrary
pwAddModelDataLibrary(dataFile, targetFolder)
Adds a data set from the data library by copying it into
the targetFolder and adding it to the currently
selected model in PottersWheel.
The data file must be specified including file extension.
If no targetFolder is specified, a folder selection dialog opens.
See also
pwAddDynamicalParameters
pwAddDynamicalParameters(filename)
Adds dynamical parameters saved in filename to the
currently selected models.
filename Matlab function returning k, kMin, kMax.
Description
Several sets of parameter values may be attached to one model,
representing e.g. different states or fits of the system.
The currently used parameter set to simulate synthetic data
or as initial guess for the next fit can be specified in the
IDSO dialog (see pwIDSO). Please note that PottersWheel distinguishes
between parameter values for simulation and fitting.
Search path
1. Current folder
2. ../IDSO
3. IDSO folder as specified in the configuration
Example
function [k, kMin, kMax] = myValues()
k.StatProd = 0.4;
kMin.StatProd = 0;
kMax.StatProd = 100;
k.StatDeg = 0.9;
kMin.StatDeg = 0;
kMax.StatDeg = 100;
See also
pwAddE
m = pwAddE(m, variables, parameters, trigger, assignment, ID);
m = pwAddE(m, trigger, assignment);
Adds an event to a model, where an assignment is applied
when a trigger fires.
ATTENTION
The function pwAddE is currently reconstructed.
Please try to use driving inputs, injections, or a startValueAssignment,
if you have time dependent events. These possibilities are described below.
Or contact support at potterswheel dot de.
Description
As with pwAddA, a short and long version of pwAddE exists.
In the second, shorter version, trigger and assignment are specified
directly using the IDs of the involved players and parameters.
In the longer version, first the players, then the parameters are listed.
In this case, the trigger and assignment should contain r1, r2, ...
and k1, k2, as in reaction rate signatures.
Examples
m = pwAddE(m, {'Erk', 'Mek'}, {}, 'r2 >= 10', 'r1 = 0');
m = pwAddE(m, 'Mek >= 10', 'Erk = 0');
For time-dependent events it is strongly recommended to use
either driving input functions or a startValueAssignment with custom time-point.
I.e., instead of
m = pwAddE(m, {'Erk'}, {}, 't >= 10', 'r1 = 5');
please use either:
If Erk is externally specified and jumps from 0 to 5 at time-point 10
(Erk is not produced or reduced within the ODE, i.e. does not appear as a product or reactant):
m = pwAddU(m, ID, uType, uTimes, uValues);
m = pwAddU(m, 'Erk', 'steps', [0 10], [0 5]);
If Erk is a parameter or an x variable and should be set to 5 a time-point 10
(Erk may be produced or reduced within the ODE):
m = pwAddA(m, lhs, reactants, parameters, ruleSignature, type, timePoint)
m = pwAddA(m, 'Erk', {}, {}, '5', 'startValueAssignment', 10);
If Erk is an x variable and should increase by 5 at time-point 10
(Erk may be produced or reduced within the ODE):
m = pwAddU(m, 'Erk', 'injection', [0 10], [0 5]);
See also
pwAddF
m = pwAddF(m, ID, rhs, numberOfArguments)
PottersWheel supports user defined functions, which can be used within
the differential equations or the reaction rate signatures.
Arguments for pwAddF
ID ID function name
rhs string body of the function
numberOfArguments integer number of arguments (default 1)
Description
The right hand side (rhs) may contain expressions 'arg1', 'arg2', etc.
to use the first, second, etc. argument. In addition, all dynamic
variables (x), dynamic paramters (k), rules (a), or inputs (u)
may be used.
Allowed mathematical functions within the right hand side
are all functions supported by math.h of the C language, e.g.
sin, cos, exp, log, and sqrt.
x^y will be replaced by pow(x, y).
x^2 will be replaced by x*x, etc.
Example
% Sum of two values
m = pwAddF(m, 'sum', 'arg1 + arg2', 2);
% Could be used within the reaction kinetics as
'r1 * sum(r2, r3)'
See also
pwAddFunction
m = pwAddFunction(m, ID, rhs, numberOfArguments)
Obsolete. Please use pwAddF instead.
See also
pwAddInstructions
pwAddInstructions(filename)
Add an instructions file to the currently selected models.
Description
The instructions file is constructed as a Matlab function
and contains for each stimulation a list of time points and
driving functions for all required driving inputs. Additional
driving inputs are ignored. Also a custom name can be specified
which will be displayed in figure legends to distinguish all
plotted stimulations.
Search path
1. Current folder
2. ../IDSO
3. IDSO folder as specified in the configuration
Example
function instructions = getInstructions()
% pwGetDrivingFunction(uType, uTimes, uValues)
instructions = [];
instructions(end+1).t = [0:10 15:5:60];
instructions(end).stimuli.TGFb = pwGetDrivingFunction('steps', [-100 0], [0 1]);
instructions(end).name = 'TGF, continuous stimulation'; % custom name
instructions(end+1).t = [0:10 15:5:40];
instructions(end).stimuli.TGFb = pwGetDrivingFunction('steps', [-100 0 10], [0 1 0]);
instructions(end).name = 'TGF, 10-min pulse';
instructions(end+1).t = [0 1 2 3 4 5 6 7 8 9 10 12 14 16 18 20 40 50 60 70 90];
instructions(end).stimuli.TGFb = pwGetDrivingFunction('steps', [-100 0 20], [0 1 0.5]);
instructions(end).name = 'TGF, 20-min pulse';
See also
pwAddK
m = pwAddK(m, ID, value, type, minValue, maxValue, unit, name, description)
Adds a dynamical parameter to a model.
Similar like for the dynamic variables, the value, fitting type
and limits can be specified for the dynamic parameters.
Arguments for pwAddK
m struct Model struct
ID ID
value float Default 0.1
type string fit setting type: 'global' (default), 'local', 'fix'
minValue float minimal value during fitting
maxValue float maximal value during fitting
unit string
name string descriptive name
description string
See also
pwAddModel
ok = pwAddModel(filenames, useMatIfUpToDate, arguments)
ok = pwAddModel(m)
Adds one or more models to the list of avaible model
data couples. The model can either be reaction or ODE based.
filenames Single filename or cell array of filenames
If no file is specified, a file selection dialog opens.
If no file extension is specified, .m is assumed.
useMatIfUpToDate true or false (default)
If true and a modelID.mat file exists which is younger
than the modelID.m file, the mat file will be loaded.
arguments Cell array of arguments that will be passed to the
model.
m Alternatively, a model struct m can be passed to the
pwAddModel function. The struct m should have been
initialized using pwGetEmptyModel and modified using
pwAddX, pwAddR, pwAddY, etc.
ok True, if all models could be loaded successfully.
Description
The model search path is:
1. Current working folder
2. ../Models
3. Model folder as specified in the configuration
Avoid to load mat files, if mother/daughter models
are used, because changes in the daugther model do
not change the time stamp of the mother model file, hence
an old mat file will be loaded.
Passing arguments
Since each model is a Matlab function, it is possible to pass function
arguments. This can be used e.g. to define different variants of a model
within the same file. The value of the passed variable will define
which is used. It is recommended to change also the model ID depending
on the used variant.
Examples
% Model example header with a passed argument 'inhibitor'.
% If no inhibitor is specified, the user can select it from a list.
function m = getModel(inhibitor)
m = pwGetEmptyModel();
if ~exist('inhibitor','var') || isempty(inhibitor)
inhibitors = {'Inhibitor1', 'Inhibitor2', 'Inhibitor3'};
i = General_GUISelectItems(inhibitors, 'Please select one inhibitor');
inhibitor = inhibitors{i};
end
% Adding a model
pwAddModel('M1')
pwAddModel({'M1', 'M2'});
See also
pwAddModelFromLibrary
pwAddModelFromLibrary(model, targetFolder)
Adds a model from the library by copying it into
the targetFolder and loading it into PottersWheel.
Use targetFolder = '.' to copy the model into the current folder.
If no targetFolder is specified, a folder selection dialog opens.
See also
pwAddModelsFromFolder
pwAddModelsFromFolder(directoryname, useMatIfUpToDate, recursively)
Adds all PottersWheel model definition files from a folder,
which is either specified directly or selected in a dialog.
recursively Default: false
If true: Adds also models from subfolders, sub-subfolders, etc.
See also
pwAddODE
m = pwAddODE(m, lhs, rhs)
Adds one ordinary differential equation to the model.
lhs Left hand side. Must be the ID of a species, e.g. 'R'.
The initial value of the species and other
properties must be specified using pwAddX.
rhs Right hand side. The differential equation for the given species,
e.g. '- R_act*R*L + R_deact*pR'
Note
PottersWheel must be able to determine the class of each token of the
right hand side, e.g. dynamic variable x, dynamic parameter k,
driving input u, or algebraic expression a. Since the right hand side
is specified as a string, all elements must be specified explicitely
using pwAddX, pwAddK, pwAddU, or pwAddA.
Piecewise definition
PottersWheel supports the function
piecewise(value1, condition1, value2, condition2, ..., defaultValue)
with an arbitrary number of value/condition pairs and one required default value.
The conditions should be specified using the functions
| less than | lt(value1, value2) |
| greater than | gt(value1, value2) |
| equals | eq(value1, value2) |
| greater or equal | ge(value1, value2) |
| less or equal | le(value1, value2) |
| and | and(bool1, bool2) |
| or | or(bool1, bool2) |
Examples:
Returning a value of 1 for a > 5, else 0:
piecewise(1, gt(a, 5), 0)
Returning b for c < d, e for f >= g, else h:
piecewise(b, lt(c, d), e, ge(f, g), h)
It is recommended to reduce the maximum integration step size,
in order to accurately detect the event, when a different branch
of the piecewise function should be evaluated.
Please note that model integration and parameter calibration may be hampered
when using piecewise functions, due to the non-analytic properties at
the switches. Also, the Jacobian matrices for integration and calibration
can not be determined, effecting e.g. the results of the profile likelihood
estimation.
Examples
m = pwAddODE(m, 'R', '- R_act*R*L + R_deact*pR'); % recommended syntax
or
m = pwAddODE(m, 'd(R)/dt = - R_act*R*L + R_deact*pR'); % supported old syntax
See also
pwAddObservations
pwAddObservations(filename)
Adds an observation to the currently selected models.
The observation file is constructed as a Matlab function and contains
a list of observation functions defined similarly as in a model definition
file.
Search path
1. Current folder
2. ../IDSO
3. IDSO folder as specified in the configuration
Example
function y = getObservations()
y = pwGetY('Stat');
y(end+1) = pwGetY('pStat + 2 * pStat_pStat', 'total_pStat');
y(end+1) = pwGetY('Stat + pStat + 2 * pStat_pStat', 'total_Stat');
See also
pwAddP
m = pwAddP(m, rhs, ID, unit, name, description)
Adds a derived parameter to a model.
Like derived variables, also derived parameters can be defined. This is
interesting for example if only the fraction of two parameters can
unambiguously be determined.
Arguments for pwAddP
m struct Model struct
rhs string Right hand side of the derived parameter, e.g.
'Stat_act / Stat_deact'
ID ID ID of the parameter, e.g. 'Stat_act_over_deact'
unit string (Currently ignored)
name string descriptive name
description string A description.
Description
The right hand side may contain IDs of dynamic parameters, dynamic variables,
and scaling parameters. Since the set of scaling parameters may change if
a new observation function is used for the model, pleas make only use of scaling
parameters if you are working with the default observation, i.e. with the
observation defined in the model definition file. Else, the behavior is not
defined!
Example
m = pwAddP(m, 'Stat_act / Stat_deact', 'Stat_act_over_deact');
See also
pwAddR
m = pwAddR(m, reactants, products, modifiers, type, ...
options, rateSignature, parameters, description, ...
ID, name, fast, compartments, parameterTrunks, designerPropsR,...
stoichiometry, reversible);
Adds a reaction to a model.
For each reaction the reactants, products, modifiers such as
enzymes, kinetic information and parameters are specified.
Additionally, an optionally reaction description, ID, name and
compartment information may be entered.
Arguments for pwAddR
1 reactants ID array IDs of the used reactants, e.g. {'Erk', 'Mek'}
Please follow the PottersWheel naming convention:
Basic species start with an upper case letter, e.g. Erk
Modifications are lower case prefixes, e.g. pErk
Bindings are denoted by an underscore, e.g. pMek_Erk
2 products ID array IDs of the products
3 modifiers ID array IDs of the modifiers
4 type string Type of the rate kinetics (see below):
'A', 'C', 'D', 'MM', 'MM2', 'Hill'
A automatic (see below)
C Custom
D Delay
MM Michaelis-Menten with Enzyme
MM2 Michaelis-Menten 2 with Vmax
Hill Sigmoidal kinetics
5 options integer
6 rateSignature string
7 parameters ID array
8 description string
9 ID ID If a reaction exists with the same ID,
the old reaction will be overwritten.
A warning will be shown if
config.model.warnWhenOverridingR is true.
10 name string
11 fast integer 1 yes, 0 no
12 compartments ID array
13 parameterTrunks string array
14 designerPropsR cell array Visualization properties (internal use):
{[x y z], [indR r g b w s1 s2 s3; ...],
[indP r g b w s1 s2 s3; ...],
[indM r g b w s1 s2 s3; ...]};
15 stoichiometry cell array Only required for fractional stoichiometry.
16 reservible boolean True, if the reaction is reversible.
Please note that actually only the rate signature
determines the reversibility of the reaction.
But for compatibility with SBML, this property
can be set explicitely. If left empty, the
reversibility will be set to false, if the
rate signature does not contain any minus sign.
Description
String arguments which may have more than one entry, e.g. the
reactants, are entered as string cell arrays, e.g.
{'Reactant1','Reactant2','Reactant3'}. This applies
also to the products, modifiers, parameters and compartments.
Reaction types are either determined automatically (A),
are predefined (MM, Hill), correspond to a delay (D) or
are customly specified by the user (C).
A simple irreversible reaction A -> B with mass action
kinetics and rate AtoB could be specified via
m = pwAddR(m, {'A'}, {'B'}, {}, 'C', [], 'k1 * r1', {'AtoB'});
Here, {} and [] are used for empty arguments.
The rate signature 'k1 * r1' reflects that the concentration of A is
decreased per time unit by the first parameter k1, which is AtoB, times
the first reactant r1, which is A. A reversible reaction A <-> B
could be entered as two irreversible reactions
A -> B and B -> A or via
m = pwAddR(m, {'A'}, {'B'}, {}, 'C', [], 'k1*r1 - k2*p1', {'AtoB','BtoA'});
introducing p1 as the placeholder for the first product, which is
B. The second parameter BtoA is used in the rate signature via k2.
In general, ri, pi, mi, ki, and ci are placeholders for the
i-th reactant, product, modifier, parameter, and compartment
of the current reaction. This way, the reaction kinetic is always
specified in a simple text book like format and does not change
from reaction to reaction as long as the underlying kinetics are the same.
For example a Michaelis-Menten reaction will have always the rate signature
'k1 * r1 * m1 / (k2 + r1)',
independent of the current reaction number. Only the used reactants, products, modifiers,
and parameters will be different for two different Michaelis-Menten reactions.
Note: Curly brackets for the ID lists are only required if
no or more than one ID appears in the list. Single IDs
can be specified directly, e.g. 'S' instead of {'S'}.
C (custom)
The rate signature is specified by the modeler using placeholders, e.g.
'k1 * r1'
for a rate which is proportional to the value of the first reactant.
A (automatic)
If the reaction type is set to 'A', the rate signature is automatically
determined based on the specified reactants, products, modifiers and parameters
using mass action kinetics. If two parameters are specified, the reaction
is assumed to be reversible. In detail:
No parameter given:
rateSignature = ProductOfAllReactantsAndAllModifiers.
One parameter:
rateSignature = k1 * ProductOfAllReactantsAndAllModifiers.
Two parameters:
rateSignature = k1 * ProductOfAllReactantsAndAllModifiers - k2 * ProductOfAllProducts.
The old reaction types MA (mass action) and E (enzymatic) are obsolete and deprecated.
MA: rateSignature = k1 * ProductOfAllReactants.
E: rateSignature = k1 * ProductOfAllReactants * m1.
MM (Michaelis-Menten)
E: Enzyme
S: Subtrate
v = k1 * E * S / (Km + S)
rateSignature = 'k1 * r1 * m1 / (k2 + r1)'
Hill
rateSignature = 'k1 * m1 * r1^k3 / (k2^k3 + r1^k3)'
The parameter k3 should be larger than 0.5 to avoid instabilities during integration.
A too large value may also hamper integration depending on the
overall system properties.
D (Delay)
The reaction A -> B is exploded into n reactions
A -> A1 -> A2 -> ... -> A_{n-1} -> B
with the same rate constant k1. The length of this linear
chain trick is given by the options field. Too large values
will make the system very stiff. Recommended values are in
the order of 5 to 15.
Rule-based modeling
Some models comprise combinatorial complexity, where reactions take place
in parallel without a certain order, e.g. a receptor with several binding
sites which are independent from each other. In order to avoid the
redundant and error-prone formulation of all single reactions, rule-based
modeling can be applied. Please see pwTutorial_Rule_based_modeling and
pwAddX for further details.
Naming convention
PottersWheel supports arbitrary IDs for reactants, products, and
modifiers (for example, enzymes), as long as only letters, numbers
and the underscore are used and the first character is not a
numerical value. However, in order to make use of several features
such as sub-reaction-networks and combinatorial complexity, the
following conventions are recommended:
- Basic species start with a capital letter, e.g. Erk and Mek
- Modifications are lower case prefixes, e.g. pErk and ppErk
- Species of a complex are separated by an underscore, e.g. pR_pR and Grb1_Grb2
Example
m = pwAddR(m, {'S'}, {'P'}, {}, 'C', [], 'k1 * r1 / (k2 + r1)', {'Vmax', 'Km'});
is equivalent to
m = pwAddR(m, {'S'}, {'P'}, {}, 'MM2', [], [], {'Vmax', 'Km'});
See also
pwAddRepository
ok = pwAddRepository(filename, showDialog)
Adds a PottersWheel repository from hard disk to the
current repository, which can also be used to merge repositories.
Default filename: 'pwRepository.mat'
Essentially couples and fits are added.
See also
See also
pwAddS
m = pwAddS(m, ID, value, fitSetting, minValue, maxValue, unit, name,
description, usedInTimeTransformation)
Adds a scaling parameter to a model.
Arguments for pwAddS
ID ID Should start with 'scale_'
value float Default 1
fitSetting string 'global', 'local' (default), or 'fix'
minValue float minimal value during fitting
maxValue float maximal value during fitting
unit string
name string descriptive name
description string
usedInTimeTransformation bool If true, the parameter is used in the
time transformation of the model.
See pwSetTimeTransformation.
Description
Often, the concentration of the observable players can not be measured directly,
but through a scaling factor as for example with Western Blotting. The scaling
parameters behave like dynamic parameters, but are related to a set
of observations and can be fitted separately.
All parameters which occur only in the observations should be
specified using pwAddS and not pwAddK in contrast to dynamic parameters.
Note: Each observation comprises implicitely a scaling parameter.
Please set this parameter to a value of 1 and fix it, if your data
contains absolute values without an unknown scaling.
Examples
m = pwAddS(m, 'scale_Stat_obs', 1.2, 'global', 0, 100);
For absolute data:
m = pwAddY(m, 'Erk', 'Erk_obs', 'scale_Erk_obs');
m = pwAddS(m, 'scale_Erk_obs', 1, 'fix');
See also
pwAddStartValues
pwAddStartValues(filename)
Adds start values saved in filename to the
currently selected models. The file has to be a
Matlab function returning x0, x0Min and x0Max.
Search path
1. Current folder
2. ../IDSO
3. IDSO folder as specified in the configuration
Example
function [x0, x0Min, x0Max] = myValues()
x0.Stat = 10;
x0Min.Stat = 0;
x0Max.Stat = 1000;
x0.pStat = 0;
x0Min.pStat = 0;
x0Max.pStat = 100;
See also
pwAddU
m = pwAddU(m, ID, uType, uTimes, uValues, compartment, name, ...
description, u2Values, alternativeIDs, designerProps, ...
classname, referenceXID, unit, formula)
Adds a driving input to a model.
Arguments for pwAddU
m struct Model struct
ID ID
uType string 'steps', 'linear', 'spline', 'logistic', 'injection'
or int 1 2 5 6 7
uTimes float vector time values
uValues float vector step values
compartment ID
name string descriptive name
description string
u2Values float vector second derivative if available (see below)
alternativeIDs cell array
designerProps matrix Visualization properties:
[x y z w h color isFlippedX isFlippedY isUpright;
...]
classname string Custom class name of the variable to define its shape
in the model designer and to group related variables.
For Systems Biology models (compare CellDesigner):
'protein.generic', 'protein.receptor',
'protein.ion_channel', 'protein.truncated',
'gene','rna' 'antisense_rna', 'phenotype',
'simple_molecule', 'drug', 'unknown', 'complex',
'ion', 'degraded'
referenceXID ID Only used for injection inputs:
x1(t) = x2(t) + uValues(t), where x1 is the variable with the
same ID as the driving input and x2 is given by the
referenceXID. Usually x1 and x2 denote the same variable (default),
corresponding to an increase of x1 by uValues(t) at time t.
However, in order to 'copy' the value of another variable,
it can be useful to have the flexibitiy to specify x2 separately.
Please use the formula 'u' (see below), if x1 should be
set to uValues(t), i.e. x1(t) = uValues(t).
unit string
formula string Only used for injection inputs. Examples:
'x + u' (default):
x1(t) is set to x2(t) + uValues(t)
'u':
x1(1) is set to uValues(t)
'x + u/2'
x1(t) is set to x2(t) + uValues(t)/2
'x/2'
x1(t) is set to x2(t)/2
'0'
x1(t) is set to 0.
Description
Some players like the ligand concentration may be controlled
externally and are represented in the model definition file as
driving inputs. Linear, step, and exponential interpolations are supported.
Alternatively, injections can be used if the player should take
part as a normal substance in the dynamic system, but is increased
at certain time points by a given amount - like an IV-bolus.
A step input corresponds to a 'piecewise' function, which can also
be used within PottersWheel. However, PottersWheel is optimized for
driving inputs, so the 'piecewise' function should be avoided if possible,
i.e. for all time-dependent piecewise expressions.
Cubic spline
Values (uValues) and second derivatives (uValues2) of the spline have to
be specified for all knots (uTimes) to define a cubic spline as described
in the Numerical Recipes, section 3.3 (Cubic spline interpolation).
v = value of spline
v2 = second derivative of spline
h = t[right] - t[left];'; % right and left are the indeces around time of interest tt
a = (t[right] - tt) / h;';
b = (tt - t[left]) / h;';
interpolated_value_at_tt = a * v[left] + b * v[right] + ...
((a*a*a - a) * v2[left] + ...
(b*b*b-b) * v2[right]) * (h*h) / 6.0;';
Example
A step input of ligand 'L' starting at t=-100 at level 0,
jumping at t=0 to 5 and decreasing at t=10 to level 2:
m = pwAddU(m, 'L', 'steps', [-100 0 10], [0 5 2]);
See also
pwAddV
m = pwAddV(m, ID, rightHandSide)
Adds a reaction rate the model m. Only allowed for ODE based models.
The ID of the reaction rate can be used within the right hand side in pwAddODE.
Arguments for pwAddV
ID The ID can be used in the right hand side of any ODE.
Example: 'V1'
rhs Right hand side of the rate.
Example: '- R_act*R*L'
Description
When dealing with e.g. chemical networks, the differential equations
exhibit a certain structure: the flux from one node to another corresponds
to a reaction rate v which is subtracted from the derivative of the first
node and added to the derivative of the second node.
When a complete network-based formulation is not feasible for a model,
it may still prove beneficial to condense the ODEs by introducing rate
variables instead of repeating their content explicitely in the derivative
of all involved species.
Examples
m = pwAddV(m, 'V1', 'R_act * R * L');
m = pwAddV(m, 'V2', 'R_deact * pR');
m = pwAddODE(m, 'R', '-V1 + V2');
m = pwAddODE(m, 'pR', '-V2 + V1');
instead of
m = pwAddODE(m, 'R', '-R_act * R * L + R_deact * pR');
m = pwAddODE(m, 'pR', '-R_deact * pR + R_act * R * L');
See also
pwAddX
m = pwAddX(m, ID, startValue, fitSetting, minValue, maxValue, unit, ...
compartment, name, description, typeOfStartValue, ...
designerProps, classname, explodePattern, removeAfterExplosion)
Adds a dynamic variable to a model.
The dynamic variables comprise all species that are part of the
left hand side of the differential equations. Essentially their
initial value, fitting type and limits have to be specified.
The arguments of pwAddX are properties of x which can also
be specified using pwSetX.
Arguments for pwAddX
1. m struct A model struct (see pwGetEmptyModel)
2. ID ID
3. startValue float initial value for integration (default 0)
4. fitSetting string 'global', 'local', 'fix'
5. minValue float minimal value during fitting
6. maxValue float maximal value during fitting
7. unit string
8. compartment ID
9. name string descriptive name
10. description string
11. typeOfStartValue string 'amount' or 'concentration' (default)
12. designerProps matrix Visualization properties:
[x y z w h color flipped1 flipped2 upright visible; ...]
13. classname string Custom class name of the variable to define its shape
in the model designer and to group related variables.
For Systems Biology models (compare CellDesigner):
'protein.generic', 'protein.receptor',
'protein.ion_channel', 'protein.truncated',
'gene','rna' 'antisense_rna', 'phenotype',
'simple_molecule', 'drug', 'unknown', 'complex',
'ion', 'degraded'
14. explodePattern bool If true (default), a pattern-based ID will
automatically be exploded into all matching
variables which are added to the model afterwards.
15. removeAfterExplosion bool If true (default), only the matching variables
will be added to the model, not the variable
with the original pattern-based ID.
Description
Not listed dynamic variables which appear in the list of reactions have
a default start value of 0 and are fixed during fitting. The default
compartment is the first specified compartment in the compartment section.
The default fit setting for non-vanishing players is 'local', else 'fix'.
Note that all x variables are treated as concentrations.
If the start value is given as an amount, the corresponding concentration
is calculated. All plotted x trajectories are also concentrations.
The protein classname is useful for visualization in the PW Model Designer
or to exchange the model with CellDesigner.
Rule based definition
If the model comprises a set of complexes, the 'or' symbol '|' is
supported in the variable ID as a shortcut to define multiple
x variables at once. E.g.
m = pwAddX(m, 'A_<B|C>_<D|E>', 1);
will be interpreted as
m = pwAddX(m, 'A_B_D', 1);
m = pwAddX(m, 'A_C_D', 1);
m = pwAddX(m, 'A_B_E', 1);
m = pwAddX(m, 'A_C_E', 1);
The explosion of pattern-based IDs can be controlled via the
explodePattern and removeAfterExplosion arguments.
Naming convention
PottersWheel supports arbitrary variable IDs as long as only letters,
numbers and the underscore are used and the first character is not a
numerical value. However, in order to make use of several features
such as sub-reaction-networks and combinatorial complexity, the
following conventions are recommended:
- Basic species start with a capital letter, e.g. Erk and Mek
- Modifications are lower case prefixes, e.g. pErk and ppErk
- Species of a complex are separated by an underscore, e.g. pR_pR and Grb1_Grb2
See also
pwAddY
pwAddY(m, rhs, ID, scalingParameter, errorModelRhs, noiseType, unit, name,
description, alternativeIDs, designerProps, classname)
Adds an observable to a model which connects a model to an
experimental measurement.
Arguments for pwAddY
rhs string Right hand side of the observation
May include x, k, a, s IDs.
ID ID
scalingParameter ID
errorModelRhs string Default: 'y * 0.1 + max(y) * 0.05'
noiseType string Currently only 'Gaussian' supported.
unit string
name string descriptive name
description string Description of the observation
alternativeIDs cell array Alternative IDs which will be used for
automatic mapping when adding external data.
designerProps only internal use
classname string
Description
Observables Y are functions of dynamical variables X, dynamical parameters K,
algebraic assignments A, and scaling factors S. They correspond to measurable
quantities in an experiment. The right hand side of the observation function
is specified as a mathematical expression of the IDs belonging X, K, and S.
Please note that one scaling parameter is already implicitely set as
discussed below. If you don't need a scaling factor, please use the
following approach:
m = pwAddY(m, rhs, ID, 'one');
m = pwAddS(m, 'one', 1, 'fix');
Scaling parameters
Example:
Experimentally measured is the total amount of phosphorylated Stat, i.e. pS + 2 * pS_pS.
Then the corresponding observable reads:
pwAddY(m, 'pS + 2 * pStat_pS', 'pS_obs');
PottersWheel automatically assumes the existence of a scaling parameter
between model observable and experimental measurements:
yMeasured = scalingFactor * yModel (general)
pS_obs_Measured = scale_pS_obs * pS_obs (example)
The name of the scaling factor is either set automatically to the observation
name with prefix 'scale_' or is specified by the user in the
scalingParameter argument:
pwAddY(m, 'pS + 2 * pStat_pS', 'pS_obs', 'scale_pS_obs');
Due to this behavior, it is usually not required to insert a scaling parameter into the
right hand side. In fact, if your measurments do not require a scaling parameter,
please fix the scaling to a value of 1 using pwAddS:
m = pwAddS(m, 'scale_pS_obs', 1, 'fix');
Additional scaling parameters can be used to fit unknown parameters which
only occur within the observation function. Therefore, scaling parameters
should rather be considered as 'observational parameters'.
Error model
Each data point will be weighted during model fitting depending on
its error bar, i.e. standard deviation. The standard deviation is
either calculated using an error model, estimated on a spline-based
approximation or given explicitly by the user in the data file (see pwAddData).
A default error model is always required, e.g. in order to simulate
synthetic data. To specify Gaussian noise with a standard deviation
of 10% relative to y plus 5% absolute (relative to max(y) over all y):
m = pwAddY(m, 'pS + 2 * pS_pS', 'pS_obs', 'scale_pS_obs', '0.1*y + 0.05*max(y)');
When using max(yAllStimuli)instead of max(y), the maximum of all
y values of all stimuli will be calculated.
Keywords
The keywords 'any_', 'only_', '_withAny_', and '_withOnly_' can
be used in the right hand side to automatically create observation functions.
The PottersWheel naming convention has to be used during modeling
(basic species start with a capital letter, modifications are lowercase
prefixes, complexes are bound using the underscore '_' character).
For example the expression 'any_S' will be replaced by a sum of all species
containing S, independent of their current modification state. Species with
two or more molecules of S get a multiplier, like 2 * pS_pS. Hence, in a
model comprising only S, pS and pS_pS, the following observation functions
are equivalent:
m = pwAddY(m, 'S + pS + 2 * pS_pS');
m = pwAddY(m, 'any_S');
If only a subset of species is required, make use of the only_pS or only_S
syntax. The first will be replace by the sum over all species containing pS, the
second by the sum over all species containing S (ignoring pS).
Equivalent are:
m = pwAddY(m, 'pS + 2 * pS_pS');
m = pwAddY(m, 'only_pS');
and
m = pwAddY(m, 'S');
m = pwAddY(m, 'only_S');
Finally, one is sometimes interested in species that are within a complex with other
species. You can control this using _withAny_ or _withOnly_. The expression
only_A_withAny_B will be replaced by the sum over all species with a B independent of
its modification and one or more unmodified A's. Similarly, any_A_withOnly_pB matches
all species containing pB and any modification of A. The multiplier is based in both
cases on A, i.e. the species A_A_pB enters the sum as 2 * A_A_pB.
When loading a model, the applied replacements are shown in the command window
and can be validated.
The approach is applicable also for derived variables.
See also
pwAddZ
pwAddZ(m, rhs, ID, unit, name, description, designerProps, classname)
Adds a derived variable to a model.
Arguments for pwAddZ
m struct Model struct
rhs string Right hand side of the derived variable
ID ID
unit string
name string descriptive name
description string
designerProps internal use only
classname string
Description
PottersWheel supports independent display and analysis of all dynamic
variables and all observables. Beyond, it is sometimes useful
to focus on a subset of dynamic variables or on interesting
function of variables, especially while working with large models.
For this, derived variables can be defined depending - similar as
observables - on the dynamic variables.
If no ID is given, the right hand side is used as ID. Example:
m = pwAddZ(m, 'pStat + 2 * pStatDimer', 'totalPStat');
m = pwAddZ(m, 'Stat');
The same abbreviations like only_pStat as for observables y
can be used.
The rhs may also contain IDs of reactions. Then, the time dependent
reaction rate is used, i.e. the flux.
TODO
Keywords Explode(...) and Flux(..., ...) exist as shortcuts.
TODO: Description.
See also
pwAnalysisOfFits
[K, K_org, parNames] = pwAnalysisOfFits([], percentage, [], [], [], minimumPValue)
Applies a fit sequence analysis and returns a matrix with parameter
values of the last fit sequence.
percentage: How many percent of the best fits should be used?
Default: 100%
minimumPValue: Tries to calculate a p value of every fit stating the probability, that
the model is sufficient to describe the data. Uses only fits that have
a higher or equal p Value as minimumPValue. Default: 0 (i.e. all fits are used)
K (n x p) matrix for the p fitted parameters of the n best fits
median is set to 1
K_org the same as K but with no rescaling
parNames String array with p names of the fitted parameters
See also
pwAnalysisOfFitsForDerivedParameters
[K, K_org, parNames] = ...
pwAnalysisOfFitsForDerivedParameters([], percentage, gop, minimumPValue)
Applies a fit sequence analysis and returns a matrix with values
for derived parameters of the last fit sequence.
percentage: How many percent of the best fits should be used?
Default: 100%
K (n x p) matrix for the p fitted parameters of the n best fits
median is set to 1
K_org the same as K but with no rescaling
parNames String array with p names of the fitted parameters
See also
pwAnalysisOfResiduals
pwAnalysisOfResiduals(nr)
Applies an analysis of residuals between model trajectory and measurements
for the current assembly, i.e. the currently combined model-data-couples.
nr:
1. Residuals against time
2. Residuals embedded
3. ACF
4. Histogram
5. QQ-Plot
6. Residuals against predicted values
7. Predicted against observed values
See also
pwAnalysisOfStandardDeviations
pwAnalysisOfStandardDeviations
Plots the standard deviations of the current fit
over the values of the model observables and applies a linear regression.
The result can be used to determine an error model.
See also
pwAppend
pwAppend
Appends the last analysis or fit to the current report.
See also
pwAppendFitHistoryOfRepository
ok = pwAppendFitHistoryOfRepository(filename)
Loads a PottersWheel repository from hard disk and appends all
available fits to the current working repository.
If no filename is given, the user can select the file from a dialog.
See also
pwArrange
pwArrange(mode, closeAll, nFigures)
Arranges all figures automatically.
mode: 1 (default) arranges figures for PottersWheel main GUI
2 for Equalizer
3 for InputDesigner
4 for ScatterMan
closeAll: (default = false)
nFigures: (default = number of figures currently used by pwDraw)
figures numeric array Handles of figures to be arranged.
If unspecified, all currently open figures
are arranged.
See also
ok = true: Before each fit sequence where QRNG
is needed, the QRNG index is set to 1.
(default)
ok = false: The current QRNG index is unchanged,
i.e. a fit sequence will start with
the current QRNG index.
See also
pwBenchmark
timePerIntegration = pwBenchmark(nIntegrations)
Creates a benchmark model and determines the time per system integration.
The same integration scheme is used as for parameter optimization.
See also
pwCalcFitGroupID
ID = pwCalcFitGroupID(fit)
Calculates the group ID of a fit.
Fits with the same group ID belong to the same fit group.
pwCalculateConstraints
[chisq, residuals] = pwCalculateConstraints(indCouples)
Calculates the constraint-based chisq value for couples specified by their
index in the combination list.
indCouples Position of a model-data-couple within the assembly
for which the penalty value of the constraints will be determined.
If no indCouples is given, the constraint-based chisq value for all
couples is determined, i.e. indCouples = 1:pwGetNumberOfFittedCouples()
chisq Penalty value which is added to the optimized chi-square value.
residuals For each constraint the residual is the non-squared contribution
to the penalty chisq value. This is similar to the residuals
between data and model.
Description
Without an output argument, a detailed list is displayed in the command window.
See also
pwCalculateDerivedParameters
[p, IDs] = pwCalculateDerivedParameters(iCouple)
Calculates the derived parameters of the combined couple i.
With no output argument, the derived parameters are listed
in the Matlab command window.
See also
See also
pwCalculateResiduals
residuals = pwCalculateResiduals()
Calculates residuals including weight for the currently
combined model-data couples. Does not comprise constraints.
Does not integrate the system.
t: time vector
y: univariate data vector of a smooth function
doPlotting: Plots the time course and the characteristic values
useSplines: Approximates the data y by a spline (default true)
percentageRecovery: percentage of maximum to define the recovery time (default: 20%)
characteristics: Struct with several fields
.peakAmplitude
.timeOfPeak
.recoveryTime
.signalDuration
.areaUnderCurve
.areaUnderFirstMomentCurve
.meanValue
.meanResidenceTime
.lastValue
category: See below.
Description
Most functions belong to one of four categories:
1. Monotonic increase from low to high level
2. Monotonic decrease from high to low level
3. Increase from low to high level and then decrease to second low level
4. Decrease from high to low level and then increase to second high level
We rule out cases 1 and 2 and determine the category 3 or 4
by investigating y(1) - y(2).
In cases 1 and 2 the peak belongs to the maximum value, i.e. at
t = 0 or t = end.
In case 4 the peak rather belongs to a minimum.
The spline based approach is slightly more accurate, because the
maximum and threshold crossings are determined based on the spline
and not the data points. This requires y to be a sufficently smooth
function, which may be a problem in dynamic systems with e.g.
pulsed input functions.
The approach is discussed e.g. in
'Principles behind the multifarious control of signal transduction'
by Hornberg et al., FEBS, 2004.
Implementation by Stefan Hengl and Thomas Maiwald.
See also
pwCheckArgument
pwCheckArgument(argument, tokens)
Checks whether an argument belongs to a cell array of tokens.
If not, an error message is issued.
pwCheckForStiffness
stiff = pwCheckForStiffness
Checks whether the current system is stiff.
The check is applied to all currently combined couples.
stiff: true -> The system is stiff (at least one couple).
false -> The system is not stiff.
See also
pwCheckSystem
pwCheckSystem
Checks the current PottersWheel installation and the
availability of external programs and toolboxes.
pwCleanUp
pwCleanUp(dialog, deleteConnections)
Removes all temporary files in the current folder,
that were created by PottersWheel.
dialog If true (default), a warning dialog is shown and
the cleaning up can be cancelled if the configuration
is set accordingly:
config.general.warningWhenCleaningUp = true
deleteConnections If true, the connection files which map external
data sheets from model observations are removed.
Default: false
! NOT YET IMPLEMENTED !
Attention
Each filename is compared with a list
of patterns which are as specific as possible.
However, if by accident you named non-temporary files
in a similar way, these file will be deleted as well.
See also
pwClear
pwClear(resetRand)
Clears PottersWheel, initializes a new PottersWheel session,
and opens the main user interface.
resetRand true or false
If true, the Matlab pseudo-random number is reseted.
If unspecified, the value config.general.resetRandInSessionStart
is used. Its default value is true.
Random numbers
Please note that reseting the random number generator will
lead to exactly the same simulated data as in a previous session.
This may affect e.g. Monte-Carlo simulations.
Matlab changed the random-number seed approach after Matlab 7.7.
Therefore the commands rand('state', 0) and randn('state', 0)
are executed for Matlab prior to version 7.7
and reset(RandStream.getDefaultStream) for higher versions.
Reseting the configuration
Clearing PottersWheel by default also resets the PottersWheel configuration.
In order to avoid a cleared configuration, set either
config.general.resetConfigInSessionStart = false
or save the current configuration using
pwSaveConfig
with the default filename 'pwConfigurationFile.mat'.
This configuration will automatically be used when calling
pwClear or starting a new PottersWheel session.
If both, a configuration file exists and the field
resetConfigInSessionStart is set to false,
the configuration saved in the file will be used.
See also
See also
pwCloseFigures
pwCloseFigures
Closes all figures except for the user interfaces.
Keywords: close
See also
pwCombine
pwCombine
Combines the currently selected model-data-couples
into an assembly, which will be used for fitting.
See also
pwCompareFiles
pwCompareFiles(file1, file2)
Compares two files using an external program.
pwCompareIntegrators
pwCompareIntegrators(nIntegrations, stiff)
Compare the integration performance for the currently selected couple(s)
based on all available integrators using nIntegrations.
stiff: true or false
If not specified, PottersWheel tries to detect the stiffness automatically.
pwCompareReactionNetworks
pwCompareReactionNetworks(model1, model2, ignoreParameterIDs,
ignoreRateSignatures, orderComplexes)
Compares the reaction networks of two models:
Collects equal reactions and shows reactions
which are present only in one network.
model1 By default the first selected model.
Else the index of the first model in the model repository list.
model2 By default the second selected model
Else the index of the second model in the model repository list.
ignoreParameterIDs If true, the number and names of parameters are ignored.
This is useful, if only the model structure should be compared.
Default: false
ignoreRateSignatures If true, the kinetic rate of each reaction is ignored.
Default: false
orderComplexes Each complex is ordered alphabetically by the
involved basic species, e.g. pC_qA is reordered to qA_pC.
A prerequisite is use of the PottersWheel naming convention
as described in pwAddX.
Default: false
Description
This function is also useful to identify whether a model imported or
created in two different ways is identical.
By setting ignoreParameterIDs, ignoreRateSignatures, and orderComplexes
to true, the model structure is compared in the least strict manner.
Example
% We compare example models M1 and M2
pwAddModel('M1');
pwAddModel('M2');
pwCompareReactionNetworks
% Output (reactants -> products, rate signature, parameters):
1 common reaction, 1 only in first network, 1 only in second network.
1 reactions only in M1:
pR --> R, k1*r1, R_deact
1 reaction only in M2:
pR --> iR, k1*r1, R_int
See also
pwCompile
pwCompile(forced, indCouples)
Compiles the selected models.
forced = true: Even models with uptodate compiled files are recompiled.
forced = false (default)
indCouples: indices of couples in the repository list.
Default: Currently selected couples.
See also
Description
On Linux and Mac systems, the Fortran integrators included in PottersWheel
should be compiled to match the system's C++ and Fortran libraries.
Unfortunately, Matlab supports only rather old compiler versions, e.g.
gcc and gfortran version 4.3 on Matlab R2011b, while the default compiler
e.g. on Ubuntu 11.10 is of version 4.6. Therefore some combinations of Matlab
and Linux distributions are not compatible by default and may require manual
installation of gcc and gfortran, which is not always straight forward.
Supported compilers are listed on:
http://www.mathworks.com/support/compilers/current_release/
http://www.mathworks.com/support/compilers/previous_releases.html
Four steps are usually required to setup mex compilation in Matlab.
They are explained below in more detail.
1. Installation of a compatible gcc and gfortran compiler including the
developer libraries (and not only the *.so dynamic libraries)
2. Executing "mex -setup" in the Matlab command window to create the file
mexopts.sh e.g. in /home/<username>/.matlab/<release>/mexopts.sh
3. Adapting the mexopts.sh file by e.g. changing gcc to gcc-4.3
4. Test the mex compilation
Unsupported combinations of Matlab and Linux
The mex compilation is a prerequisite to run PottersWheel and won't
work on the following systems without special administration knowledge:
- Ubuntu 11.10 with any Matlab Release (as of 2011-10-23).
Please let us know if you identified further failed combinations.
Step 1: Installation of gcc 4.3
This description assumes installation of Ubuntu Linux.
Please let us know the corresponding commands on other Linux distributions.
Please check whether gcc-4.3 is already installed by typing
"gcc" in a Linux terminal and pressing the tabulator key twice to
see a list of matched commands, e.g.
maiwald@ubuntu-11.04:~$ gcc
gcc gcc-4.5
To find out the version of a compiler type e.g. "gcc -v".
Continue with step 2 if gcc-4.3 is already installed.
a) On Ubuntu 10.10 and below, the following bash commands should install
the GNU Compiler Collection 4.3 and the GNU Standard C++ Library
(compare https://help.ubuntu.com/community/MATLAB and
http://joysofprogramming.com/install-gfortran-4-3-ubuntu):
$ sudo apt-get install gcc-4.3-multilib libstdc++6-4.3-dev
$ sudo apt-get install gfortran-4.3
Finished.
b) On Ubuntu 11.04 download the corresponding *.deb files of Ubuntu Maverick
from (compare http://ubuntuforums.org/showthread.php?t=1748408):
http://packages.ubuntu.com/maverick/gcc-4.3-multilib
http://packages.ubuntu.com/maverick/g++-4.3-multilib
http://packages.ubuntu.com/maverick/gfortran-4.3
Recursively follow all "=" dependent packages resulting in 8 deb files:
i386:
gcc-4.3-multilib_4.3.5-3ubuntu1_i386.deb
gcc-4.3_4.3.5-3ubuntu1_i386.deb
gcc-4.3-base_4.3.5-3ubuntu1_i386.deb
g++-4.3_4.3.5-3ubuntu1_i386.deb
g++-4.3-multilib_4.3.5-3ubuntu1_i386.deb
cpp-4.3_4.3.5-3ubuntu1_i386.deb
gfortran-4.3_4.3.5-3ubuntu1_i386
libstdc++6-4.3-dev_4.3.5-3ubuntu1_i386.deb
amd64:
cpp-4.3_4.3.5-3ubuntu1_amd64.deb
g++-4.3_4.3.5-3ubuntu1_amd64.deb
g++-4.3-multilib_4.3.5-3ubuntu1_amd64.deb
gcc-4.3_4.3.5-3ubuntu1_amd64.deb
gcc-4.3-base_4.3.5-3ubuntu1_amd64.deb
gcc-4.3-multilib_4.3.5-3ubuntu1_amd64.deb
gfortran-4.3_4.3.5-3ubuntu1_amd64.deb
libstdc++6-4.3-dev_4.3.5-3ubuntu1_amd64.deb
Change the current bash working directory to the folder with the
downloaded *.deb file and execute
$ sudo dpkg -i *.deb
Then a few broken links have to be corrected (shown only for amd64):
Broken links:
/usr/lib/gcc/x86_64-linux-gnu/4.3/libgcc_s.so -> /lib/libgcc_s.so.1
/usr/lib/gcc/x86_64-linux-gnu/4.3/libgomp.so -> ../../../libgomp.so.1
/usr/lib/gcc/x86_64-linux-gnu/4.3/libstdc++.so -> ../../../libstdc++.so.6
/usr/lib/gcc/x86_64-linux-gnu/4.3/libgfortran.so -> ../../../libgfortran.so.3
Correction (each command is one line, the 'f' option is to force
overwritting the existing links):
sudo ln -sf /lib/x86_64-linux-gnu/libgcc_s.so.1 \
/usr/lib/gcc/x86_64-linux-gnu/4.3/libgcc_s.so
sudo ln -sf /usr/lib/x86_64-linux-gnu/libgomp.so.1 \
/usr/lib/gcc/x86_64-linux-gnu/4.3/libgomp.so
sudo ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 \
/usr/lib/gcc/x86_64-linux-gnu/4.3/libstdc++.so
sudo ln -sf /usr/lib/x86_64-linux-gnu/libgfortran.so.3 \
/usr/lib/gcc/x86_64-linux-gnu/4.3/libgfortran.so
Finished.
c) On Ubuntu 11.10 both approaches will not work but lead to the following
error message (compare http://ubuntuforums.org/showthread.php?p=11378416):
dpkg: dependency problems prevent configuration of gcc-4.3:
libgcc1:i386 (1:4.6.1-9ubuntu3) breaks gcc-4.3 and is installed.
libgcc1 (1:4.6.1-9ubuntu3) breaks gcc-4.3 and is installed.
Please let us know if you have a working solution for this case.
d) Other Linux systems will be desrcribed in the future.
Please let use know how you got your system working.
Step 2: Creating a user specific mex options file
Please check whether the file mexopts.sh is already available in
/home/<username>/.matlab/<Release>/mexopts.sh
If not it has to be created. Open Matlab and type "mex -setup".
Then select "Template Options file for building gcc MEX-files".
Example:
mex -setup
Options files control which compiler to use, the compiler and link command
options, and the runtime libraries to link against.
Using the 'mex -setup' command selects an options file that is
placed in /home/thomas/.matlab/R2011b and used by default for 'mex'. An options
file in the current working directory or specified on the command line
overrides the default options file in /home/thomas/.matlab/R2011b.
To override the default options file, use the 'mex -f' command
(see 'mex -help' for more information).
The options files available for mex are:
1: /home/thomas/programs/matlab/bin/mexopts.sh :
Template Options file for building gcc MEX-files
0: Exit with no changes
Enter the number of the compiler (0-1):
1
/home/maiwald/programs/matlab/bin/mexopts.sh is being copied to
/home/maiwald/.matlab/R2011b/mexopts.sh
Step 3: Adapt the mexopts.sh file
Determine the mex extension of your Matlab installation by executing
the Matlab command
mexext
The result could be e.g. mexa64.
Open the file /home/<username>/.matlab/<release>/mexopts.sh in a
text editor of your choice, e.g. the matlab editor:
edit /home/<username>/.matlab/<release>/mexopts.sh
Find the section corresponding to your mex extension, i.e. where the
value of LDEXTENSION matches your mex extension.
Make the following changes:
CC='gcc-4.3'
CXX='g++-4.3'
FC='gfortran-4.3'
Save the file and test the mex compilation.
The current settings can be listes using
mex -v
Step 4: Test the mex compilation
Compile the test file 'pwMexTest.c' available in the PottersWheel toolbox
folder. If the test file is missing, just create it with the following content:
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
mexPrintf("The mex compiler seems to work on your system. Good!\n");
}
Execute the following two commands:
pwGoToToolboxFolder;
mex pwMexTest.c
When you then run pwMexTest, the following message should appear:
pwMexTest
The mex compiler seems to work on your system. Good!
Now, the Fortran compiler will be tested:
pwGoToToolboxFolder;
mex radau5Mex.c options.c radau5.f dc_lapack.f lapack.f lapackc.f
Calling then radau5Mex should produce an error message complaining
about an invalid number of arguments. If this is the case, please run
pwCompileFortranIntegrators
Else, go to the troubleshooting section.
Troubleshooting
We list common error messages and our corresponding recommendations:
GLIBXX_3.4.14 not found
Warning: You are using gcc version "4.5.2-8ubuntu4)". The version
currently supported with MEX is "4.3.4".
For a list of currently supported compilers see:
http://www.mathworks.com/support/compilers/current_release/
.../x86_64-linux-gnu/4.5.2/cc1: .../glnxa64/libstdc++.so.6:
version `GLIBCXX_3.4.14' not found (required by /usr/lib/libppl_c.so.2)
.../x86_64-linux-gnu/4.5.2/cc1: .../glnxa64/libstdc++.so.6:
version `GLIBCXX_3.4.11' not found (required by /usr/lib/libppl_c.so.2)
...
mex: compile of ' "pwMexTest.c"' failed.
Please install gcc-4.3 and/or correct the mexopts.sh
file as described above.
References
http://en.wikibooks.org/wiki/SPM/Installation_on_64bit_Linux
See also
pwCompleteModel
model = pwCompleteModel(model)
Completes a model struct, e.g. by calculating the ODE given a reaction
network using the PottersWheel chemical compiler. The initial model struct is
usually returned by a custom model definition file.
See also
pwConfidenceIntervals
ci = pwConfidenceIntervals(mode, parameterValues, nFits, criticalValue)
Determines the 95%-confidence intervals of all currently fitted
parameters.
Please note that since PW 2.1 we rather recommend using the Profile
Likelihood approach. See pwPleInit.
mode 0 Fisher-information based 95%-confidence-intervals (default)
This requires that you fitted with trustregion or marquardt
in normal parameter space.
1-3 Estimates the confidence intervals based on a fit-sequence:
1 (Data + Noise) Data is simulated based on original values plus Gaussian noise.
2 (Monte-Carlo) Data is simulated based on model values plus Gaussian noise.
3 (Bootstrap) Data points are redrawn with replacement.
This is done nFits times. The distribution of fitted parameter values
of the best 85% fits serves to estimate the confidence intervals.
The parameters are disturbed using config.optimization.strengthOfDisturbance.
4 The Hessian is approximated nummerically which requires repeated
integration of the system.
This setting is still in BETA.
parameterValues
Only for mode 4: If parameterValues are given, the Hessian is calculated at this
point in the parameter space. Else, the current parameter values of the
equalizer are taken.
Default: [] (empty)
nFits Number of fits for mode 1-3. Default: 100
criticalValue
Factor multiplied to the internally determined standard deviation
in order to calculate the confidence limits.
Default: 1.959964 corresponding to a 95% confidence limit:
qnorm((1 + 95)/2); -> 97.5 % quantile
Description
With no output argument, the confidence interval is plotted.
Else, the confidence intervals are returned for each parameter.
Since PW 2.0.44, the Profile Likelihood Estimation (pwPle) approach should
be used to determine confidence intervals in order to avoid
approximation errors for non-identifiable errors for mode 0 or 4.
See also
pwConfiguration
pwConfiguration
Opens the PottersWheel configuration dialog.
The 'Fields' menu contains all fields of the configuration
struct. Subfields are dynamically displayed using the
same names as required in command line usage (see below).
Changes to entries are affecting PottersWheel instantaneously.
Closing of the dialog is not necessary (but consequently
canceling is not possible either).
Use the File saving and opening menu to store preferred settings
for use e.g. in future sessions.
Within own programs or at the command line,
all configuration settings are accessible by using:
config = pwGetConfig;
config. ... % Make changes to config settings here
pwSetConfig(config);
This is especially useful, if you are working with PottersWheel
Macros, since all settings are documented in the same file
as the modeling, fitting, and analysis commands.
See also
pwConnectNames
mappedNames = pwConnectNames(names1, names2)
Opens a GUI to allows for mapping names2 against names1.
names1 Cell array of strings
names2 Cell array of strings which should be mapped to names1,
i.e. mappedNames{i} is a string of names2 which
corresponds to names1{i}.
mappedNames Cell array of mapped names.
Description
This function is primarily used to map columns of external data files
against observation functions in models, but it can also be used
for other mapping tasks.
Currently, the GUI labeling is adapted for the data column mapping task.
See also
pwConvertCustomFormatToPW
m = pwConvertCustomFormatToPW(inFile, outFile, opt, verbosity)
Converts a custom model file into a valid PottersWheel model definition file.
inFile File that will be converted.
outFile Created PottersWheel model definition file.
opt Struct or a string corresponding to a predefined setting.
See below for details.
verbosity 1: error messages (default)
2: also matched headers
3: also matched lines (good for debugging of custom regular expressions)
Predefined settings for opt:
'BNG' BioNetGen
'Numerica_Jacobian' Numerica Jacobian
'CellML_MatlabExport' CellML Matlab export using http://www.cellml.org/tools/downloads/pcenv
'SB_Toolbox' SB Toolbox model file (sbtoolbox)
Important ASCII characters
| 10 | Line feed \n |
| 12 | Form feed \f |
| 13 | Carriage return \r |
| 32 | Space |
| 34 | Quotation marks " |
| 44 | , |
| 91 | [ |
| 92 | \ |
| 93 | ] |
| 95 | _ |
| 123 | { |
| 125 | } |
Ascii characters
.AsciiCharToBeDeleted % Decimal representation of ASCII characters to be deleted
.AsciiCharToBeReplacedOld
.AsciiCharToBeReplacedNew
.AsciiCharReplaceIgnoreSection % no replacement in sections bounded by the given character
Normal expressions
.ToBeDeleted (cell array)
.ToBeReplacedOld (cell array)
.ToBeReplacedNew (cell array)
Regular expressions
.ToBeDeletedWithRegExp (cell array)
.ToBeReplacedOldRegExp (cell array)
.ToBeReplacedNewRegExp (cell array)
Object matching
| .parse(i) | Struct array with the following elements |
| .pattern | Regular expression with named fields. |
| The field names must be a subset of fields of |
| the given class. |
| .header | Expression after which lines are compared with pattern. |
| A new header terminates parsing of other elements |
| .footer | Expression after which lines are no longer compared with pattern. |
| Note that repetitions of header/footer sections are permitted. |
| The footer itself is not compared with the pattern, too. |
| Footers are optional. |
| .class | Model field classes |
| 'a', 'c', 'f', 'k', 'o', 'p', 'r', 's', 'u', 'v', 'x', 'y', 'z' |
| a) pwAddA, algebraic equation/assignment rule |
| c) pwAddC, compartment |
| f) pwAddUserFunction, user defined function |
| k) pwAddK, dynamic parameter |
| o) pwAddODE, ODE |
| p) pwAddP, derived parameter |
| r) pwAddR, reaction |
| s) pwAddS, scaling parameter |
| u) pwAddU, driving input |
| v) pwAddV, reaction rate |
| x) pwAddX, dynamic variable |
| y) pwAddY, observable |
| z) pwAddZ, derived variable |
| This field should not be mistaken with the classname of a variable. |
| .splitter | Cell array, where splitter{i} contains all delimiters |
| that are used to split matched field i into a cell arry. |
| Empty, if no field of pattern should be splitted. |
| If splitter{i} is empty, than field i is not splitted. |
| .command | If no class is specified, a custom Matlab command can be used, |
| e.g. to specify the ID of a model. Expressions in the command |
| which are identical to a named token in the regular expression |
| and which are embraced by <> are replaced, e.g. |
| pattern = '(?<ID>\w+)'; command = 'm.ID = ''<ID>'';' |
Description
This function provides a convenient and powerful way to map elements of a
custom model file structure to a PottersWheel model definition file.
Sections of the custom file are compared line by line with regular expressions
as specified in one or more 'parse' structs. Each section of the custom model
should start with a header and may end with a footer. The patterns of the
regular expressions should have named tags, e.g., (?<reactants>.+)
The names will be compared with the field names of PottersWheel
model definition classes, e.g. the ID and value fields of the class 'x',
the dynamic variables. The converter knows whether a field must be transferred
e.g. into a number or a string. If a field belongs to a string array, as
for example the reactants and products of a reaction, it will be splitted
using the delimiters given in parse(i).splitter.
Advanced usage
Several parse structs may share the same header and consequently different
patterns may be applied to the same section. If a line matches any footer
no matching is applied any more. The same holds if a new header is found
- then only matches are applied of the parse structs that correspond to the
new header.
Example
1. A custom model definition file
Reactions
A + B -> C; kf1
B <-> D; kf2, kr2
D -> A + E; kf3
Start values
A = 1
B = 0
C = 0
D = 0
E = 0
Parameters
k1 = 0.1
k2 = 0.5
k3 = 1
2. The corresponding parsing structs:
opt = [];
opt.parse(1).header = 'Reactions';
opt.parse(1).pattern = '(?<reactants>.+) (->|<->) (?<products>.+); (?<parameters>.+)';
opt.parse(1).class = 'r';
opt.parse(1).splitter = {'+', '+', ','};
opt.parse(2).header = 'Start values';
opt.parse(2).pattern = '(?<ID>.+) = (?<startValue>.+)';
opt.parse(2).class = 'x';
opt.parse(3).header = 'Parameters';
opt.parse(3).pattern = '(?<ID>.+) = (?<value>.+)';
opt.parse(3).class = 'k';
See also
See also
pwCopyDataFromLibrary
pwCopyModelDataLibrary(dataFile, targetFolder)
Copies a data set from the data library into
the specified folder
If no targetFolder is specified, the current folder is used.
The data file must be specified including file extension.
See also
pwCopyModelFromLibrary
pwCopyModelFromLibrary(modelName, targetFolder)
Adds a model from the library by copying it into
the specified folder. If not folder is given, the
model is copied into the current working folder.
See also
pwDataAndFits
pwDataAndFits
Shows the data and fits dialog where the currently used
data set and fit can be selected.
See also
pwDbAddExperiment
[success, message] = pwDbAddExperiment(dbFile, dataFile, expName)
Adds one experiment stored in the given dataFile with all included
stimulations to the PottersWheel database <dbFile>.
success True if experiment has been added.
message Error message if experiment could not be added.
dbFile Will be created if not available using pwDbCreate.
dataFile Excel or txt file (compare pwAddData).
expName If unspecified, the name of the data file.
See also
pwDbBrowser
pwDbBrowser
Opens a GUI which allows to navigate through PottersWheel
database files.
See also
pwDbCreate
pwDbCreate(dbFile)
Creates a PottersWheel database (PWDB) file which can be used to store
several experiments, each comprising a set of stimulations.
dbFile Filename of the PWDB file. It is recommended to use the ending "_pw.db".
If no file is specified, a save file dialog opens.
An existing file with the same name will be overwritten!
Description
When dealing with larger amounts of experimental data it might be convenient
to work with a single PottersWheel database file instead of a set of
xls or txt files.
Please use pwDbAddExperiment to successively add experiments to the PWDB.
See also
pwDbGetTags
[keys, values, accumulatedExpIDs] = pwDbGetTags(dbFile, expID)
Returns all available key-value pairs in all experiments of the given
PottersWheel database file.
dbFile String.
expID If unspecified, all experiments are used.
keys String array.
values String array.
accumulatedExpIDs Cell array of numeric arrays.
See also
pwDbRemoveExperiment
pwDbRemoveExperiment(dbFile, expName)
Removes experiment <expName> from PottersWheel database file <dbFile>.
See also
pwDbSelectExperiment
expName = pwDbSelectExperiment(dbFile)
Let the user select one experiment in the database corresponding
to the given database file <dbFile>.
expName Name of the selected experiment.
See also
pwDbSelectFile
dbFile = pwDbSelectFile(forSaving)
Opens an open file dialog to let the user select a PottersWheel
database file (PWDB).
forSaving If true, a file saving dialog is shown. Default: false
dbFile Will be empty "[]" if the open file dialog is cancelled.
See also
pwDbSelectStimulations
stimulations = pwDbSelectStimulations(dbFile, expName)
Let's the user select one or more stimulations from the experiment <expName>
in the database corresponding to the given database file <dbFile>.
dbFile Optional: Database file.
expName Optional: Name of the experiment
stimulations Array of selected stimulations.
See also
pwDbShowExperiments
[experiments, expIDs] = pwDbShowExperiments(dbFile, pattern)
Displays all experimentsin the database corresponding to the given
database file <dbFile>.
pattern Optional regular expression to filter a subset of experiments.
experiments Array of available experiment names.
See also
pwDbShowStimulations
stimulations = pwDbShowStimulations(dbFile, expName, pattern)
Displays all stimulations belonging to a given experiment <expName>
in the database corresponding to the given database file <dbFile>.
pattern Optional regular expression to filter a subset of stimulations.
stimulations Array of available stimulations.
See also
pwDelete
pwDelete(ind)
Deletes one or more couples in the model-data-couple list.
ind Index of the couple(s) to remove from the couple list.
Can also be 'all'.
If left empty, the currently selected couples are deleted.
See also
pwDeleteModelDataConnections
pwDeleteModelDataConnections
Deletes all *connected_to*.mat files in the
current working folder. This is useful to
re-map column names of data files to observables.
See also
pwDeleteOutliers
pwDeleteOutliers
Opens a GUI of the currently highest selected couple.
Outlier data points can be deleted manually by clicking with the mouse.
They will be replaced by a NaN value.
Use the function pwSaveDataSets to save the modified data set.
See also
pwDeleteStimuli
pwDeleteStimuli(indeces)
Deletes in all selected couples the stimuli as given in indeces.
pwDesigner
pwDesigner(modelIndex)
Opens the PottersWheel Model Designer for the given model index.
If no index is specified, the highest selected model is used.
See also
pwDesignerApplyCellDesignerLayout
pwDesignerApplyCellDesignerLayout(modelIndex, xmlFile)
Extracts positioning and coloring of a model given as an
CellDesigner SBML export and applies the design information
onto a model given by its index in the list of model-data-couples.
The species ID of the PottersWheel model is linked to the
'species' attribute in the CellDesigner file.
See also
pwDesignerApplyPottersWheelLayout
pwDesignerApplyPottersWheelLayout(targetModel, modelIncludingLayout)
Extracts positioning and coloring of a model given as a
PottersWheel model file and applies the design information
onto a target model given either by its index in the list of
model-data-couples or by a filename. In the second case, the
original file of the target model will be modified.
See also
See also
See also
pwDesignerAutomaticLayout
[xMin xMax yMin yMax] = pwDesignerAutomaticLayout(modelIndex, model, autoColor)
Creates an automatic layout for the current model in the designer
and returns its limits.
modelIndex Number of the model in the repository list. If not supplied,
the currently selected or highest model will be used.
mode 'graphviz' (default), 'circle', 'matrix', 'none'
autoColor true or false (default). If true, each species gets a
color automatically based on its corresponding basic species.
The default for automatic coloring is set to true when all
species are still painted with the default color.
Description
The layout will either be a circle or a full matrix of species or is
based on a graph calculated by the external program 'Graphviz' if available.
See also
pwDesignerChangeNetworkSize
pwDesignerChangeNetworkSize(modelIndex, factor)
Changes the network size of a model specified by its
index in the couple-list by the given factor.
factor Either a scalar or a vector with three entries,
one for each dimension x, y, and z.
See also
pwDesignerChangeSpeciesSize
pwDesignerChangeSpeciesSize(modelIndex, factor)
Changes the species size of a model specified by its
index in the couple-list by the given factor.
See also
pwDesignerGetLimits
[xMin xMax yMin yMax] = pwDesignerGetLimits(modelIndex)
Returns the limits of the specified model in the model designer.
See also
pwDesignerHighlightSpecies
pwDesignerHighlightSpecies(modelIndex, ID, tag)
Highlights a species in the PottersWheel model designer.
modelIndex Index of the model in the model repository.
If unspecified, the currently selected model is used.
ID ID of the species
tag Either 'A', 'U', 'X', 'Y', 'Z'
See also
pwDesignerOptimalSpeciesSize
pwDesignerOptimalSpeciesSize(modelIndex)
Changes the species size of a model so that the
complete species ID is visible.
pwDesignerRun
pwDesignerRun(modelIndex, saveFrames, rotation)
Animates the current time-course in the model designer.
saveFrames If true, the animation is saved as a movie
and can be saved into an animated gif using pwSaveFramesToAnimatedGif.
This requires the image processing toolbox.
rotation If true, the model is rotated in three dimensions during animation.
Default: false
See also
See also
pwDesignerShapeOfSpeciesClass
polygon = pwDesignerShapeOfSpeciesClass(x, y, z, w, h, classname)
Returns in polygon.x, .y, .z the shape of a species
given a classname, e.g., 'protein', 'receptor', etc.
The shapes and class names are based on the software CellDesigner.
pwDesignerTransformPositions
pwDesignerTransformPositions(modelIndex, translation, matrix)
Applies an affine transformation to all species and reaction positions.
A position is assumed to be a (2 x 1) vector,
the same holds for the translation vector.
pwDesignerUpdate
pwDesignerUpdate(modelIndex, bringToFront, fitToAxes)
Updates the PottersWheel Model Designer user interface.
Useful, e.g. if a new species has been added via command line
or a script.
bringToFront (default = true)
fitToAxes (default = false)
See also
pwDisturb
pwDisturb(strength)
Disturbes the currently fitted parameters either using
parNew = parOld * 10^(strength * eps)
with eps being normally distributed ~ N(0, 1)
or quasi random numbers.
strength If unspecified: config.optimization.strengthOfDisturbance
Quasi random numbers
In the case of
config.optimization.useQRNG = true
a call of pwDisturb will increase
config.optimization.indexQRNG
by 1 and calculate new parameter values based on a quasi
random number generator which will asympotically spread
parameter settings uniformly throughout the whole parameter
space for up to 40 parameters.
In order to start a new QRNG sequence just set
config.optimization.indexQRNG = 1;
In the case of a fit sequence, the QRNG index is automatically
reset for each fit sequence in case of
config.optimization.autoResetQRNG = true,
which is the default setting.
A variation of the QRNG approach is a uniform distribution
in logarithmic parameter space, i.e. on the magnitudes of the
parameters. For this, please use
config.optimization.useLogQRNG = true;
The used algorithm to calculate the quasi random numbers is
based on the SOBOL implementation of the GNU Scientific Library.
The corresponding source code is open source and can be obtained
under the terms of the GNU General Public License from the
PottersWheel developer team.
See also
pwDisturbedParameters
pwDisturbedParameters
Shows a GUI where the currently disturbed parameters can be
selected.
See also
pwDoseResponse
pwDoseResponse(inputID, responseIDs, doses, timepoints, do3D)
Simulates a dose response experiment with specified doses
at given time points.
Input arguments:
pwDraw
hSubplotsArray = pwDraw
Integrates and plots the currently combined couples.
Reuses the integration if no parameter of model has changed.
See also
pwDrivingInputTypeConversion
result = pwDrivingInputTypeConversion(inputType)
Converts a string or number specifying the type of a driving input
function into the corresponding number of string representation.
See also
pwDuplicate
pwDuplicate(n)
Appends n complete copies of the currently selected couples.
n is 1 by default.
pwEdit
pwEdit(indices)
Opens the currently selected models in the Matlab editor
or those specified by indices.
pwEnsureLocalMexFiles
pwEnsureLocalMexFiles
Checks whether all required and dynamically generated mex files
are in the current folder e.g. for the ODE or the observables.
Checks also if the specified integrator is available.
See also
pwEnsureValidConfig
config = pwEnsureValidConfig(config)
Checks a config struct and adds missing fields.
Important if old configs are used within new
PottersWheel versions.
Without any input argument, the current config is checked.
Without any output argument, the current config is overwritten.
See also
pwEqualizer
pwEqualizer
Opens the PottersWheel equalizer to change and to analyze
characteristics of the current fitting assembly.
Views
The equalizer comprises several views:
- Sliders
- Plotting (Pl)
- Phase space (PS)
- Sensitivities
- Fitting (FV)
- Fit sequence analysis (N)
- Single fit analysis (1)
Sliders
Eight pairs of sliders are available in th slider view to tune
selected parameters, with the left slider changing the
mantissa (fine tuning) and the right slider changing the
order of magnitude (coarse tuning). A parameter value can also be
entered directly into the textbox below the sliders.
The slider-pair on the left will be visible in each Equalizer view.
In order to keep parameters at a certain relationship, e.g.
a constant fraction of 3.0, a parameter equation can be applied, e.g.
kon = 3.0 * koff
If koff is changed, the value for kon is updated automatically and the
corresponding slider is set to its proper value. Please insert one equation
per line into the textbox on the right. To temporarilly turn off the
parameter equations, uncheck "Apply parameter equations".
Plotting
The plotting view allows to show and hide a subset of variable of each
class u (driving inputs), x (dynamic variables), y (observables),
z (derived variables), and 'a' (algebraic expressions).
Please select a couple and variable class. The use the arrow buttons
between the listboxes "Visible" and "Invisible" to shift the selected
variables between the two sets.
It is often useful to plot several species into one subplot, e.g. to
directly compare their absolute values over time. This can be done by
creating variable groups. Afer selecting the species of interest click
on 'Create group' and provide an optional group name to identify the group
in the list of groups on the right and to specify the subplot header.
If the fitted model complies to the PottersWheel naming convention,
groups can be generated automatically by selecting the action
'Automatic group creation for basic species' and pressing 'Start action'.
Especially in large models the information content of the plotted
trajectories benefits from hiding all single variables and plotting only
grouped ones.
In order to save or load a reasonable visualization setting select the
corresponding action and press 'Start action'. The generated file can
be copy-pasted into an existing model definition file in order to
start with a predefined visualization scheme from the beginning.
Not only variables but also stimuli can be made visible or invisible
Changes to the visualization setting take effect replotting the figures.
Phase space
The phase space view allows to create pairs of two variables which will
be plotted against each other, i.e. in a so-called phase space diagramm.
The pairs are defined separately for each combined couple.
Sensitivities
This view allows to plot the derivative of one variable x to a parameter k,
i.e. the sensitivity of x on k. This dependency is time-dependent and is
either approximated numerically or calculated during model integration by
suitable integrators based on analytical expressions. The latter approach
requires the CVODES integrator, the symbolic math toolbox, and the setting
config.integration.calcSensitivities = true
Fitting view
The fitting view allows to select an optimization strategy in normal
or logarithmic parameter space. The latter is recommended if you expect
model parameter to vary of orders of magnitude between each other or/and
during parameter calibration.
A single fit calibrates all non-fixed start values x0, dynamic parameters k,
and scaling (or observation) parameters s. Shortcut buttons exist to fit
only parameters from one of the three classes labeled 'x0', 'k', and 's'.
Fit sequences F2 and F3 with a specified number of fits 'n' and disturbance
strength 'd' can be run directly from the fitting view interface.
In this case calculation is accelerated by unchecking "Show fitting"
in order to avoid repetitive plotting of each fit.
Compare pwF2 and pwF3.
The boosted fit combines the trust region optimization with simulated
annealing in logarithmic and linear parameter space. This strategy is
a good starting point for a completely uncalibrated model. See pwFitBoost
for further information.
Which parameters are calibrated or stay fixed is usually defined in the
model definition files or the fit settings dialog. Temporarilly, parameters
may be fixed using the 'Set fixed pars' button.
Pressing the disturb button or running a fit sequence leads to varied
and refitted parameter values. The button 'Set disturbed pars.' allows
to define which parameters are disturbed. Compare pwDisturb and
pwSetFixedParameters.
A user-defined optimization function can be employed instead of the default
PottersWheel optimization strategy. This is done using the function
pwOptimizationSetUserFunction. By unchecking 'User fun', the user
optimization function may be quickly
turned off and on.
The following lists are used for fit-based analyses:
- Fit groups
- Fit sequences
- All fits
- Fits of analysis
Fit groups
Each fit is characterized by a fit group ID which represents
the fitted model-data-couples and set of calibrated parameters.
Additional fits under the same settings will receive the same
fit group ID. The list of fit groups displays the number of fits
in each group and their group ID. The function pwFitHistoryGetFits
may be used to access the fits group programmatically or to plot
an overview.
Fit sequences
Fits belonging to the same fit sequence are listed here characterized
by the time when the fit sequence started together with the number
of fits in the sequence.
All fits
To access an individual fit the list of all fits can be used.
Next to the start time of each fit, its chi-square value (CS)
is printed. One or more fits may be selected. When check-marking
the fields 'Direct plot' or 'Direct info', the system trajectories
or information of the fit are drawn or displayed, respectively,
when the fit gets selected.
Fits of analysis
When an analysis is carried out, e.g. a fit-sequence analysis
based on the best 50% of the fits with a minimum p-value of 0.01,
the resulting fits are displayed in the 'fits of analysis' list.
They can be saved into an xls or txt file using the menu
'Parameters | Save fits of analysis to file...'.
In the same fashion a set of fits may be loaded from a file
into the same list using the menu
'Parameters | Load fits of analysis from file...'.
Fit sequence analysis (N)
Several analyses exist to characterize subset of fit sequences:
- Linear fit sequence analysis
- Nonlinear Mean Optimal Transformation Approach (MOTA) analysis
- Scatter plots
- Multi-trajectories
Each analysis is applied to a subset of fits based on:
- Last fit sequence
- Selected fit sequence
- Selected fit group
- Selected fits
- Fits of (last) analysis
The subset is further constrained by
- Percentage of best fits
- A minimum p-value
- Percentage of included outliers
The subset of fits is ordered by the fit chi-square value.
By specifying a percentage of fits below 100, fits with the worst
fit quality are neglected.
A p-value is determined for each fit using a chi-square test for
N-#p degrees of freedom, where N is the number of fitted data points
and #p the number of calibrated parameters. All fits below the minimum
p-value are omitted.
It may be reasonable to determine the region in parameter
space where most of the fits are lying. Fits far away from this region,
i.e. outliers, should be excluded even if they have a similiar chi-square
value.
Multi-trajectories
The trajectories are displayed for each fit. Using the setting
config.optimization.levelOfHistoryStorage = 3;
when applying a fit allows to plot the saved trajectories
instead of fresh calculation. This is especially useful, if the
model trajectories are computationally expensive to be calculated.
Compare pwTrajectoriesOfManyParameterSettings.
See also
pwExcelToTextFile
pwExcelToTextFile(filename)
Converts an .xls file into a .txt file,
which is a valid PottersWheel data file.
Useful if data sets are used within Unix based
systems with restricted xls support.
pwExplodeSpecies
IDs = pwExplodeSpecies(pattern, allIDs)
Returns the IDs of all dynamic variables x of the highest currently
selected model which match the specified pattern.
Alternatively, the IDs can be specified in 'allIDs'.
See also
pwExploreFolder
pwExploreFolder(folder)
Opens a folder within a file explorer window.
folder Folder to be openend. If unspecified, teh current working directory
is opened.
Note
Supports:
Windows (Windows explorer)
Gnome (nautilus)
KDE (konqueror)
Mac (Finder)
See also
pwExportCouplesToLatex
pwExportCouplesToLatex([], [], bWithGraph, showDVI, showPDF)
Exports the currently selected couples to Latex and creates
a PDF.
pwExportCouplesToMatlab
filenames = pwExportCouplesToMatlab
Exports the currently selected couples to Matlab ODE files.
pwExportCouplesToPWODE
pwExportCouplesToPWODE
Exports the currently selected couples to an PottersWheel ODE
model definition file.
pwExportCouplesToSBML
pwExportCouplesToSBML(couples, includeLayout)
Exports the selected couples into SBML level 2.1 files.
couples struct Leave this field empty ([]) to export all
selected couples.
includeLayout bool If true, the generated SBML files will contain
CellDesigner compatible layout information.
Default: false
See also
pwExportCouplesToTXT
filenames = pwExportCouplesToTXT
Exports the currently selected couples into ascii text files.
pwExportCouplesToXPP
filenames = pwExportCouplesToXPP
Exports the currently selected couples to XPP ODE files.
pwExportModelToHTML
pwExportModelToHTML(m, filename, includeHeader, includeCSS,
includeJavaScript, imageSmallURL, imageLargeURL)
Exports model m to a html file given by <filename>.
m A model struct.
filename Target html file.
includeHeader If true (default), a html head is included.
includeCSS If true (default), cascading style sheets are included.
includeJavaScript If true (default), JavaScript functions are included,
e.g. to display tooltips.
imageSmallURL URL to a thumbnail of the model.
imageLargeURL URL to a normal sized picture of the model.
Note
If no model is specified, the highest selected model
in the couple-list is used.
See also
pwExportModelToMathematica
pwExportModelToMathematica
Export of a PottersWheel model to a Mathematica(R) file.
(Only basic models supported currently, e.g. no events or compartments.)
See also
pwExportModelToSBML
pwExportModelToSBML(model, sbmlFileName, includeLayout)
Exports a PottersWheel model to SBML, level 2, version 1.
Includes the original PottersWheel model in the notes element.
model struct
sbmlFileName string
includeLayout bool If true, the generated SBML file will include graphical
layout information compatible with the CellDesigner
software.
Default: false
See also
pwExportModelToSbToolbox2
pwExportModelToSbToolbox2
Export of a PottersWheel model to an SB Toolbox2 file.
(Only basic models supported currently, e.g. no events or compartments.)
See also
pwExtractCellDesignerInformation
design = pwExtractCellDesignerInformation(filename)
Extracts basic design information based on a CellDesigner SBML xml file
which is relevant for the PottersWheel model designer.
pwExtractRules
m2 = pwExtractRules(xPatterns)
Extracts reaction rules from the highest currently selected model
in order to reduce the complexity of the model formulation.
xPatterns Cell array of PottersWheel species patterns
defining all possible x variables.
m2 PottersWheel model struct with rule-based reactions if possible.
Can be saved to harddisk using pwSaveModel.
Example
pwClear;
pwAddModelFromLibrary('Schoeberl2002_EGF_MAPK_PWcurated', '.')
xPatterns = {};
xPatterns{end+1} = ...
'E_<o|R|iR|pR|ipR|idegR>_<o|R|iR|pR|ipR|idegR>_<o|Ga>_<o|Sh|aSh>_<o|G2>_<o|So>_<o|Rs>_<o|Gd|Gt>_<o|Pr>';
xPatterns{end+1} = '<o|Sh|aSh>_<o|G2>_<o|So>';
xPatterns{end+1} = '<o|Rf|iRf>_<o|Rs|iRs>_<Gd|aGt|Gt>';
xPatterns{end+1} = '<Me|iMe|pMe|piMe|ppMe>_<o|iaRf|aRf>_<o|Phs2|iPhs2>';
xPatterns{end+1} = '<Er|pEr|ppEr|piEr|iEr|ppiEr>_<o|ppMe|ppiMe>';
xPatterns{end+1} = '<Er|pEr|ppEr|piEr|iEr|ppiEr>_<o|Phs2|Phs3|iPhs2|iPhs3>';
m2 = pwExtractRules(xPatterns);
pwSaveModel(m2, 'newModel.m');
See also
pwF1
pwF1
Applies a single fit.
See also
pwF2
pwF2(n, strength, backupMinutes, dataMode, tMax, job, nNodes, randnState)
Find best of n fits.
Start each fit with parameter values before starting the fit sequence,
but disturb parameters with given strength (compare pwDisturb).
Arguments for pwF2
backupMinutes: Save repository every backupMinutes minutes.
If set to 0 (default), no backup is saved.
dataMode: 0 (default) Fitted data is unchanged.
1 (Gauss) Data is simulated based on original values plus Gaussian noise.
2 (Monte-Carlo) Data is simulated based on model values plus Gaussian noise.
3 (Bootstrap) Data points are drawn with replacement
from the set of all data points.
Compare pwSimulateNewRealization.
tMax Maximum time point for the function to run.
If empty, the function will not be stopped prematurely.
With tMax = datenum(2009,11,01,19,0,0),
the fit sequence will be interrupted if the current
time exceeds 7pm of November 1, 2009.
job A job object as described in the Parallel Computing Toolbox.
nNodes Number of nodes in the cluster to be used.
randnState If not empty, the state for randn will be set to randn('state', randnState)
for Matlab up to version 7.6 and else to
defaultStream = RandStream.getDefaultStream;
defaultStream.State = randnState;
See also
pwF3
pwF3(n, strength, backupMinutes)
Find best of n fits.
Start for fit i starts from best of the finished i-1 fits.
Disturb parameters with given strength and fit.
Arguments for pwF3
backupMinutes: Save repository every backupMinutes minutes.
If set to 0 (default), no backup is saved.
See also
pwF4
pwF4(n, strength)
Find best of n fits.
Fit i starts from fit i-1.
Disturb parameters with given strength and fit.
See also
pwF5
pwF5(parameterMatrix, backupMinutes, dataMode)
Applies n fits with n = size(parameterMatrix, 1).
Fit i starts from parameterMatrix(i,:).
Selects the best fit of the sequence.
The number and order of parameters (nPars = size(parameterMatrix, 2)) equals
the number and order of parameter names shown in the equalizer or using
the pwInfo command.
Arguments for pwF5
backupMinutes: Save repository every backupMinutes minutes.
If set to 0 (default), no backup is saved.
dataMode: 0 (default) Fitted data is unchanged.
1 Data is simulated based on original values plus Gaussian noise.
2 (Monte-Carlo) Data is simulated based on model values plus Gaussian noise.
3 (Bootstrap) Data points are drawn with replacement
from the set of all data points.
Compare pwSimulateNewRealization.
See also
pwFastIntegration
pwFastIntegration(b)
Sets fast integration for integrators 1, 2, and 5.
Sets the value of
config.integration.useFastIntegration
b true (default) or false
Requirements
Windows: Installed lcc.exe and fortran.exe to the same folder
Linux and Mac OS X: C and Fortran compiler.
See also
pwFastPlotting
pwFastPlotting(b)
b = true (default) or false
Plotting as used during fitting or when changing sliders in the
equalizer.
pwFileIsAModel
ok = pwFileIsAModel(filename)
Checks whether a given m-file is a PottersWheel model definition file.
See also
pwFit
[fittedPars, chisq] = pwFit
Fits the currently combined couples.
Description
If no custom optimization function is supplied, the Likelihood is maximized
which is equivalent for Gaussian errors to minimize the Chi-Square value
defined as
Chi-Square = sum_i ((yModel(i) - yData(i))/yStd(i))^2
for all available datapoints i.
See also
pwFitBoost
pwFitBoost(nFits)
nFits (default 1)
Combines nFits times a deterministic and stochastic optimization approach
to reduce the effect of local minima.
pwFitDeviation
[Dmean, Dmax, Dvector] = pwFitDeviation(parTrue, parFit)
Determines the mean and max deviation of fitted parameter values
compared to the true values. This approach is only possible
for simulated data.
Deviation for parameter i:
D(i) = 2^abs(log2(parFit(i) / parTrue(i)));
parTrue: Vector of true parameter values
parFit: Vector of fitted parameters
Dvector: Result for each fitted parameter
Dmean: Mean value over all fitted parameters
Dmax: Max value
If the true parameter is 0, it will be neglected (=> NaN)
See also
pwFitHistoryAppendManualFit
pwFitHistoryAppendManualFit(name)
Appends a manual fit, i.e. the current setting of the parameters in the
PottersWheel Equalizer, to the fit history.
If no name is specified, the user is prompted for a name.
The name can later be used, to identify a certain parameter setting.
See also
See also
pwFitHistoryDeleteFits
pwFitHistoryDeleteFits(percentage, fitGroup)
Deletes worst percentage of all fits of fit group fitGroup in the fit history.
fitGroup Number of fit group
If no fit group is given, the procedure is applied to all fit groups.
percentage Number between 0 and 100.
Percentage of fits to be deleted.
See also
pwFitHistoryGetFitGroups
[fitGroups, fitGroupsIDs, fitGroupsNFits, fitGroupsChisq, fitGroupsNPars, ...
fitGroupsNData, fitGroupsPositionInHistory] = pwFitHistoryGetFitGroups(fitHistory)
Returns groups of fits belonging to identical settings for
model, data, and fitted parameters in the fit history.
Optional:
fitHistory Array of fits. If unspecified, the fit history of the
current PottersWheel session is used.
fitGroups Cell array, where each cell contains all fits belonging
to the same fit group, i.e. fits with the same fitted
model, data, and parameters.
fitGroupsIDs Cell array of the unique IDs representing the fit groups
fitGroupsNFits Number of fits per group
fitGroupsChisq Cell array of the chi-square values, where fitGroupsChisq{i}(j)
is the chi-square value of fit j in fit group j.
Description
If no output argument is given, the fit groups are visualized by their
chi-square value plotted over fit number.
See also
pwFitHistoryGetFits
[fits, fitsUnconditioned] = pwFitHistoryGetFits(indFits, fitSequenceStartTime, ...
fitGroupID, percentageBestFits, minimumPValue, percentageIncludedOutliers)
Given either the indices in all fits, the fitSequenceStartTime or a fitGroupID,
this function returns all fits which are compliant to conditions,
e.g. having a certain p value or belonging to the best x% of the fits.
fitsUnconditioned contains all fits, independent of the
specified condition.
Unused arguments should be given as [].
If the first three arguments are empty,
the last fit sequence is used.
See also
pwFitHistoryMergeFitSequences
pwFitHistoryMergeFitSequences
Merges all related fits of the fit history
into fit sequences sharing the same fit sequence start time.
Description
Two fit sequences may belong to the same fit settings,
model and data sets: they belong to the same fit group.
Function like pwFitSequenceAnalysis work on the last
fit sequence unless specified otherwise.
The function pwFitHistoryMergeFitSequences merges all
fit sequences as far as possible, i.e. the number of
fit sequences will be the same as the number of fit groups.
This is done by assigning the earliest fit sequence start
time to all fits belonging to the same fit group.
See also
See also
See also
pwFitSequenceAnalysis
[stdValues, IDs] = pwFitSequenceAnalysis(percentage, minimumPValue, ...
useDerivedParameters, fits, percentageOutliers)
Analysis of fits including:
1. Chi square values
2. p values
3. Histograms
4. Boxplots
5. Correlation matrix
6. Significant correlations
7. Details of significant correlations
8. Principal component analysis
9. Biplot
10. Dendrogram
percentage: Fraction of best fits used for analysis.
Between 0 and 100 (default).
minimumPValue: Tries to calculate a p value of every fit stating the probability, that
the model is sufficient to describe the data. Uses only fits that have
a higher or equal p palue as minimumPValue. The calculated p value is
based on a chi-square test with N-#p degrees of freedom, where N is the
number of fitted data points and #p corresponds to the number of fitted
parameters.
Default: 0 (i.e. all best fits are used)
useDerivedParameters: true or false (default)
Use this flag if you want to analyse rather the derived parameters than the
original ones
fits: If empty, the fits of the last fit sequence are analyzed.
percentageOutliers: 0..100
The euclidian distance of each parameter to a common centre of gravity
can be used to include only a percentage of outliers. A value
of 90 corresponds to remove the 10% most extreme outliers.
Output:
stdValues: Standard deviation of fitted parameter values
See also
pwFitSequencePlots
stdValues = pwFitSequencePlots(K, IDs, chisqValues, pValues, percentage, ...
minimumPValue, modelIDs, dataIDs, K_true, Kstart, N, percentageOutliers)
Produces the same figures as pwFitSequenceAnalysis but based on saved
pwFitSequenceResults rather than on the last applied fit sequence.
See also
pwFitSequenceResults
[K, IDs, chisqValues, pValues, modelIDs, dataIDs, Kstart, ...
nTotalFits, Kcomplete, IDsComplete, Ktrue, N, indFitHistory]=...
pwFitSequenceResults(percentage, useDerivedParameters, fits)
useDerivedParameters: true or false (default)
Use this flag if you want to analyse rather the derived
parameters than the original ones
percentage: Returns only given percentage of best fits. Default: 100, i.e. all fits.
fits: Per default the fits of the last fit sequence are taken,
if not given directly.
K: Matrix of parameter values
Number of rows = number of fits
Number of columns = number of parameters
IDs: IDs of the paramters as cell array
chisqValues: Chi square values of all fits
pValues: p-values of all fits
modelIDs: IDs of all models used for the fits
dataIDs: IDs of all data sets used for the fits
Kstart: Matrix of parameter values at start of fitting
nTotalFits: Number of all fits (not only the best fits)
Kcomplete: Matrix K contains only parameters wich were fitted.
Kcomplete contains also temp. fixed parameters.
Ktrue: For simulated data the true parameter values.
N: Number of fitted data points (neglecting NaN values)
indFitHistory Indices of best fits in the fit history.
See also
See also
pwFixParameters
pwFixParameters
Opens a GUI to select the temporarilly fixed parameters during fitting.
See also
pwForcedCompilation
pwForcedCompilation
Compiles all selected models, even if the compiled mex files are uptodate.
pwGetA
a = pwGetA(lhs, reactants, parameters, signature, type, timePoint, ...
description, ID, name, designerProps, classname, targetType, ...
compartment, valueType)
Creates an algebraic equation (also called a rule).
Assignment and startValueAssignment equations are supported.
See also
pwGetAssemblyState
state = pwGetAssemblyState
Returns the state of the current assembly as a number.
If the assembly has not changed, e.g. all parameter values,
inputs and couples are the same, the re-integration is not required
for plotting.
pwGetBestFit
pwGetBestFit
Searches for the best fit in the last fit sequence.
This function assumes that the same model-data-couples
are combined as used in the last fit sequence.
The best fit is determined and its parameter values
transfered to all combined models.
The system is also integrated and plotted.
See also
pwGetC
c = pwGetC(ID, size, outside, spatialDimensions, name, unit, constant,
designerProps, classname, description)
Creates a compartment struct.
See also
pwGetChisqAndN
[chisq, NData, NPars, chisqDataPoints, chisqConstraints, residuals] = ...
pwGetChisqAndN(iCouple, iStimulus)
Returns the chi-square value and number of data points for
a given combined couple and stimulus of the last fit. If no couple is
specified, the total chi-square value is calculated.
Description
The chi-square value is the sum over the squared residuals
between model and data. Each residual is weighted with 1/standard deviation
(if weights are not changed by the user).
If the model(s) contain constraints, the chisq value is increased by
chisqConstraints. Use chisqDataPoints if you are interested in only
the chisq value based on the data points.
Returns also the number of fitted parameters.
NData may be smaller than the number of residuals belonging to the model
data distance, since NaN values in the data lead to a 0 residual and
are not counted by NData.
See also
pwGetChisqThreshold
threshold = pwGetChisqThreshold(dof, alpha)
Determines the chi-square threshold corresponding to the
specified degrees of freedom and significance threshold.
dof Degrees of freedom, e.g. number of data points (N) or
N - number of parameters (N - p).
alpha Significance threshold 0..1, e.g. 0.05 (default).
Description
If the chi-square value of a fit is below the calculated chi-square
threshold, the model can not be rejected as a wrong model.
If the chi-square value is larger, the model can be rejected:
Only in alpha*100 percent of the cases, the model produces
the measured (or more extreme) data.
See also
pwGetClassFields
[fieldNames, longClassName] = pwGetClassFields(className, allFields)
Returns the field names of a PottersWheel variable class.
className 'a', 'c', 'f', 'k', 'm', 'o', 'p', 'r', 's', 'u', 'v', 'x', 'y', 'z'
Not case-sensitive.
allFields If false, only fields are returned which are
specified by the user in a model definition file.
Default: false
fieldNames Cell array of field names
longClassName E.g. 'Reactions' and 'Dynamic variables' for 'r', and 'x'
See also
pwGetConfig
config = pwGetConfig
Returns the current configuration settings.
Example
config = pwGetConfig;
config.optimization.trustregion.maxIter = 100;
config.optimization.trustregion.TolX = 1e-6;
config.optimization.trustregion.TolFun = 1e-6;
pwSetConfig(config);
See also
pwGetConstraint
pwGetConstraint(lhs, operator, rhs, reactants, parameters, lambda)
See also
pwGetCurrentDataSet
dataSet = pwGetCurrentDataSet
Returns the currently active data set of the
highest selected couple.
pwGetCurrentDrivingFunction
df = pwGetCurrentDrivingFunction(iCouple, jStimulus, kDrivingFunction, combined)
Get driving function of couple i, stimulus j, and driving function k.
k can also be the ID of a driving input player.
Default values: i=1, j=1, k=1, combined=true
If combined==true, the currently combined couples are used.
Else, the currently active instructions (sampling + driving input) of model i
in the repository list is used.
See also
pwGetDataSet
dataSet = pwGetDataSet(matrix, colNames, ID)
Returns a minimal data struct which can be added to a model
using pwAddData(dataSet).
matrix Numeric matrix Rows correspond to time points
Columns correspond to the given column names
colNames String array Column names
ID String ID of the data set
Description
One column name of the matrix should have the prefix 'xCol-'
corresponding to the independent column, usually time.
(The 'x' should not be mistaken with the internal variables
of the dynamic system x.)
Example
Two observables and ten time points.
colNames = {'xCol-Time-min', 'pErk', 'pMek'};
matrix = zeros(10, 3);
t = 1:10;
matrix(:,1) = t;
matrix(:,2) = exp(-t*0.1);
matrix(:,3) = exp(-t*0.05);
ID = 'Simulated MAPK data';
dataSet = pwGetDataSet(matrix, colNames, ID);
See also
pwGetDefaultConfig
config = pwGetDefaultConfig
Returns the default configuration settings which are:
Linear fit sequence analysis
config.analyses.linearFitSequenceAnalysis.showFitStartInHistograms = true;
Displays also the initial guess for each parameter in the fitted parameter histograms
config.analyses.linearFitSequenceAnalysis.useLogXInHistograms = false;
Displays the fitted parameter histograms with a logscale x-axis
PLE - Profile Likelihood Estimation
config.analyses.PLE.useGUI = true;
If true, the PLE user interface opens when the PLE method is initialized using pwPLEInit.
config.analyses.PLE.confLevelInUnitsOfStd = 1;
Confidence level in units of standard deviations,
i.e. a value of 1 corresponds to a one sigma interval (68%).
config.analyses.PLE.maxNumSteps = 100;
The maximum number of steps by which the
parameter of interest is increased or decreased to estimate the PL.
config.analyses.PLE.minStepSize = 0.01;
Minimum step size in % for the parameter value.
config.analyses.PLE.maxStepSize = 50;
Maximum step size in % for the parameter value.
config.analyses.PLE.relChi2StepIncrease = 0.1;
The step length is set to achieve a certain increase in the Chi2 value.
This parameter defines the relative amount compared to the Chi2 threshold.
A value of 0.1 corresponds to a 10% increase.
config.analyses.PLE.steppingMode = 1;
1 direct steps
2 progressive steps
config.analyses.PLE.alphaChi2Test = 0.05;
Significance level alpha for chi-square test based chi-square threshold (mode 3)
config.analyses.PLE.thresholdMode = 1;
1 Use relative chi-square threshold for simultaneous confidence level
2 Use relative chi-square threshold for separate confidence levels
3 Use absolute chi-square threshold based on chi-square test
config.analyses.PLE.breakOnParLimits = false;
If true, a parameter is not increased over its minimum
or maximum limit as defined in the model definition file.
config.analyses.PLE.showIterations = true;
If true, progress of the Profile Likelihood estimation is visualized.
Data import settings
config.data.yStdCalculation = 1;
1 error model of observation
2 std given in file
3 estimation with csaps spline (Matlab)
4 estimation with mgcv spline (R)
5 csvspl
6 estimation with the splinefit algorithm
config.data.yStd_smoothness = 0.2;
Smoothness of csaps splines. 0 = straight line, 1 = interpolating spline
config.data.yStd_h = 2;
2*h + 1 numbers will be used for yStd calculation
config.data.yStdMinRelative = 0;
config.data.yStdMinAbsolute = 0;
config.data.uCalculation = 2;
1 linear interpolation
2 smoothing spline interpolation (csaps, mgcv, or csvspl1)
3 smoothing spline (csaps)
4 smoothing spline (mgcv)
5 smoothing spline (csvspl1)
config.data.setNegSplineValuesToZero = true;
If true, negative spline interpolation values are set to zero.
Uncheck this if your input function may be negative by intention.
config.data.columnsToBeIgnored = {};
config.data.automaticColumnMapping = true;
If true, PottersWheel tries to automatically map column names
between external files and model observables
or to load a saved connection file.
config.data.arrangeFigures = true;
If true, figures will be arranged automatically after loading external data.
Graphical model designer
config.designer.warningWhenIncludingModel = true;
If true, a warning message appears when a second model
is to be included into a model within the model designer
config.designer.animationTime = 5;
Duration of the system animation in real time (seconds)
config.designer.nRotations = 1;
Number of rotations in the 3D animation.
config.designer.nIntegrations = 1;
Number of integrations per animation.
config.designer.nFramesInGif = 70;
Number of frames in an animated gif.
config.designer.showLabels = true;
If true, a label is displayed for each species.
config.designer.grid = 10;
Species snap to this grid when moved manually.
Special folders
config.folders.models
Folder for models: Model search path:
1 Current folder
2 '../Models'
3 Folder as specified in the configuration
config.folders.data
Folder for data: Data search path:
1 Current folder
2 '../Data'
3 Folder as specified in the configuration
config.folders.IDSO
Folder: IDSO search path:
1 Current folder
2 '../IDSO'
3 Folder as specified in the configuration
config.folders.repository
Folder for repositories
config.folders.configuration
Folder for configurations
config.folders.report
Folder for reports
config.folders.lccFolder
Folder where the C compiler lcc has been installed.
Macro folder
config.folders.addMacrosFolderToPath = true;
If true, the folder ../Macros will be added temporarilly
to the Matlab path when starting a new PottersWheel session.
General settings
config.general.doBackup = true;
backup of old model files if automatically saving new ones
config.general.verbosity = 3;
1 Only error messages
2 Warnings also
3 Short information also
4 Long information also
5 Debug information also
6 Long debug information also
config.general.pause = 3;
Time period to pause Matlab when calling pwPause.
If negative, a pressed key is required to continue.
config.general.resetConfigInSessionStart = true;
If false, the configuration is not reseted
when clearing the PottersWheel session, e.g. using pwClear.
config.general.resetRandInSessionStart = true;
See pwClear
config.general.warningWhenCleaningUp = true;
Prompts the user to confirm deleting temporary files when calling pwCleanUp.
config.general.extendedCoupleList = false;
If true, the currently used IDSO is displayed in upper list
of the main user interface.
Graphviz model visualization
config.graph.pageSize = '';
E.g. 8.5, 11
config.graph.maxSize = '8, 10';
config.graph.rotate = [];
E.g. 90
config.graph.withRules = false;
Integration settings
config.integration.integrator = 1;
1 radau5
2 radau
3 seulex
4 dop853
5 dopri5
6 odex
7 ode45
8 ode15s
9 ode23
10 ode23s
11 ode23t
12 ode23tb
13 ode113
14 cvodes (See help pwInstallSundialsTB)
config.integration.useFastIntegration = false;
Applicable for integrators 1, 2, and 5.
Fast integration requires a Fortran compiler.
Change this setting _before_ pressing the combine button.
config.integration.useMexODE = true;
Developer setting. Should be left to true.
config.integration.calcJacobian = false;
Requires the symbolic math toolbox.
config.integration.useJacobian = false;
Using the jacobian of the ODE system usually improves integration accuracy and robustness.
Requires the symbolic math toolbox.
config.integration.useBandedJacobian = false;
Applicable for integrators 1-6.
config.integration.useJPattern = false;
Applicable for integrators 7-13.
config.integration.calcSensitivities = false;
Applicable for integrator 14 (CVODES).
Calculates the sensitivities of x and y depending on time for each fitted parameter.
This setting is independent of optimization.useJacobian
and only used to display the sensitivities.
config.integration.useBreakpoints = true;
Developer setting. Should be left to true.
config.integration.opt.AbsTol = 1e-006;
config.integration.opt.BDF = [];
config.integration.opt.Events = [];
config.integration.opt.InitialStep = [];
config.integration.opt.Jacobian = [];
config.integration.opt.JConstant = [];
config.integration.opt.JPattern = [];
config.integration.opt.Mass = [];
config.integration.opt.MassConstant = [];
config.integration.opt.MassSingular = [];
config.integration.opt.MaxOrder = [];
config.integration.opt.MaxStep = [];
config.integration.opt.NonNegative = [];
config.integration.opt.NormControl = [];
config.integration.opt.OutputFcn = [];
config.integration.opt.OutputSel = [];
config.integration.opt.Refine = [];
config.integration.opt.RelTol = 0.001;
config.integration.opt.Stats = [];
config.integration.opt.Vectorized = [];
config.integration.opt.MStateDependence = [];
config.integration.opt.MvPattern = [];
config.integration.opt.InitialSlope = [];
config.integration.opt.MaxNumSteps = 1500;
(CVODES) Maximum number of steps to reach the next output time
pwAddX)">
X (Dynamic variables, pwAddX)
config.model.xStartValue = 0;
Value of x at integration start, usually at t=0.
config.model.xType = 'local';
Fitting type fix, local, or global. If the start value is 0, the default setting is fix.
config.model.xMinValue = 1e-005;
config.model.xMaxValue = 100000;
config.model.xTypeOfStartValue = 'concentration';
concentration or amount
pwAddK)">
K (Dynamic parameters, pwAddK)
config.model.kValue = 0.1;
config.model.kType = 'global';
fix, local, or global
config.model.kMinValue = 1e-005;
config.model.kMaxValue = 100000;
pwAddY)">
Y (Observables, pwAddY)
config.model.yErrorModel = '0.1 * y + 0.05 * max(y)';
0.1 * y corresponds to 10% relative error.
0.05 * max(y) corresponds to 5% error relative to the maximum.
config.model.yNoiseType = 'Gaussian';
Currently, only a Gaussian error model is supported
config.model.yPrefixScalingParameter = 'scale_';
pwAddS)">
S (Scaling parameters, pwAddS)
config.model.sValue = 1;
config.model.sType = 'local';
fix, local, or global
config.model.sMinValue = 1e-005;
config.model.sMaxValue = 100000;
pwAddC)">
C (Compartments, pwAddC)
config.model.cID = 'cell';
config.model.cSize = 1;
config.model.cName = 'cell';
config.model.cSpatialDimensions = 3;
config.model.cConstant = true;
Autocorrections
config.model.splitReversibleReactions = false;
If true, reversible reactions are automatically split into one forward and one back-reaction.
config.model.reconstructNetwork = false;
If true, the reaction network is determined automatically for ODE based models.
Please note that the original ODEs will be removed for successful network reconstruction.
(Still in BETA phase! Please compare original ODEs and ODEs generated by new network.)
Miscellaneous
config.model.negativeParsPossible = false;
If true, mantissa sliders in the equalizer are displayed from -1 to 1 instead of 0 to 1
config.model.compileAddedModels = true;
If true, several C MEX files are created and compiled for each added model.,
e.g. for the ODEs. Compare pwForcedCompilation.
config.model.autoSaveToMatFile = false;
If true, the model struct is saved to a *.mat file
after loading a model definition into PottersWheel. Compare pwAddModel.
Export to txt
config.model.export.includeComments = true;
config.model.export.includeHeaders = true;
config.model.export.includeNameLists = false;
config.model.export.removeBlanks = false;
If true, blanks in formulas are removed.
config.model.export.fileExtension = '.txt';
config.model.export.commentPrefix = '';
Prefix for lines containing PottersWheel comments like model name and date of export.
config.model.export.kHeader = 'Parameters:';
config.model.export.kFormat = '%-10s = %g';
E.g. %s = %g may lead to k1 = 0.3
config.model.export.x0Header = 'Initial values:';
config.model.export.x0Format = '%-5s(0) = %g';
E.g. %s(0) = %g may lead to X(0) = 13.2
config.model.export.oHeader = 'ODEs:';
config.model.export.oFormat = 'd(%-10s)/dt = %s';
E.g. d(%s)/dt = %s may lead to d(X)/dt = -k1*X + k2*Y
General optimization / fit settings
config.optimization.method = 2;
1 fminsearch
2 trustregion
3 genetic algorithm
4 simulated annealing
5 smarquardt
6 ssmlsqnonlin
7 ssmdn2fb
config.optimization.stopErrorLevel = 2;
config.optimization.levelOfHistoryStorage = 1;
1 Only fitted parameter values
2 Parameters and fit settings
3 Parameters, settings and trajectories
config.optimization.fitInLogParameterSpace = false;
Useful if the parameters span several orders of magnitude.
config.optimization.updateSliders = true;
If true, the sliders in the equalizer will be updated during optimization.
config.optimization.calcJacobian = false;
Requires the symbolic math toolbox.
config.optimization.useJacobian = false;
Requires integrator 14 (CVODES) and the symbolic math toolbox.
config.optimization.storeJacobian = false;
If true and if useJacobian == true,
the Jacobian of the optimization is stored
and can be retrieved with pwGetStoredOptimizationJacobian
config.optimization.derivativeCheck = false;
Compares the analytically determined Jacobian with the numerical approximation.
config.optimization.userFunction = '';
Function: User supplied function which will be minimized. See help pwSetOptimizationUserFunction.
config.optimization.useUserFunction = false;
If true, the user defined optimization function will be used (if available).
config.optimization.fitInitFunction = '';
Function: User supplied function which be will called before a fit (pwFit) is executed.
config.optimization.useFitInitFunction = false;
If true, the user defined fit init fuction is active (if available).
Fit sequence analysis
config.optimization.numberOfFitsInSequence = 10;
config.optimization.strengthOfDisturbance = 0.2;
Quasi random number generator
config.optimization.useQRNG = false;
config.optimization.useLogQRNG = false;
config.optimization.indexQRNG = 1;
config.optimization.autoResetQRNG = true;
ASAMIN simulated annealing
config.optimization.asamin.limitAcceptances = 1000;
ASA default 10000.
The maximum number of states accepted before quitting. If set to 0, then no limit is observed.
config.optimization.asamin.limitGenerated = 2000;
ASA default 99999.
The maximum number of states generated before quitting. If set to 0, then no limit is observed.
config.optimization.asamin.limitInvalid = 1000;
ASA default 1000.
Limit of repetitive invalid generated states.
config.optimization.asamin.acceptedToGeneratedRatio = 0.0001;
ASA default 1e-6.
The least ratio of accepted to generated states.
config.optimization.asamin.costPrecision = 1e-018;
ASA default 1e-18.
Precision required of the cost function if exiting because of reaching maximumCostRepeat.
config.optimization.asamin.maximumCostRepeat = 5;
ASA default 5.
Maximum number of times that the cost function repeats itself,
within limits set by Cost_Precision, before quitting.
config.optimization.asamin.numberCostSamples = 5;
ASA default 5.
When > 0, the initial cost temperature is calculated as the
average of the absolute values of numberCostSamples sampled cost functions.
config.optimization.asamin.temperatureRatioScale = 1e-005;
ASA default 1e-5.
Guide to the expected cost temperature of convergence
within a small range of the global minimum.
config.optimization.asamin.costParameterScale = 1;
ASA default 1.
Ratio of cost:parameter temperature annealing scales.
config.optimization.asamin.temperatureAnnealScale = 100;
ASA default 100.
Guide to achieve the expected cost temperature sought by temperatureRatioScale
within the limits expected by limitAcceptances.
config.optimization.asamin.userInitialParameters = true;
ASA default false.
If true, then the first user's guess is used to calculate this first state,
which is reasonable in PW.
config.optimization.asamin.sequentialParameters = -1;
ASA default -1.
If > 0, some parameters will be adapted during optimization sequentially
rather than simultaneously.
config.optimization.asamin.initialParameterTemperature = 1;
ASA default 1.
The initial temperature for all parameters.
config.optimization.asamin.acceptanceFrequencyModulus = 100;
ASA default 100.
Frequency of testing for periodic testing and reannealing,
dependent on the number of accepted states.
config.optimization.asamin.generatedFrequencyModulus = 10000;
ASA default 10000.
Frequency of testing for periodic testing and reannealing,
dependent on the number of generated states.
config.optimization.asamin.reannealCost = 1;
ASA default 1.
If 0, reannealing of the cost temperature is bypassed.
If 1, default reannealing.
Check ASA documentation for other values.
config.optimization.asamin.reannealParameters = true;
ASA default true.
Permits reannealing of the parameter temperatures to be part of the fitting process.
Set to false for systems with very large numbers of parameters
to decrease the number of function calls.
config.optimization.asamin.deltaX = 0.001;
ASA default 0.001.
Fractional increment of parameters used to take
numerical derivatives when calculating tangents for reannealing.
Ignored settings
config.optimization.asamin.asaOutFile = 'asa.log';
Currently ignored, i.e. always asa.log is used.
config.optimization.asamin.randSeed = [];
Currently ignored. Use asamin ('set', 'rand_seed', value) to reset the asamin seed manually.
config.optimization.asamin.testInCostFunc = false;
Currently ignored.
config.optimization.asamin.useRejectedCost = false;
Currently ignored.
config.optimization.asamin.includeIntegerParameters = false;
Currently ignored.
Genetic algorithm
config.optimization.ga.MutationFcn = 'mutationadaptfeasible';
config.optimization.ga.Generations = 200;
config.optimization.ga.PopInitRangeMin = 0;
config.optimization.ga.PopInitRangeMax = 0.1;
config.optimization.ga.Display = 'off';
off, iter, diagnose, final
config.optimization.ga.PopulationSize = 200;
config.optimization.ga.CrossoverFraction = 0.8;
config.optimization.ga.EliteCount = 2;
config.optimization.ga.FitnessScalingFcn = 'fitscalingrank';
config.optimization.ga.HybridFcn = [];
config.optimization.ga.StallGenLimit = 50;
config.optimization.ga.StallTimeLimit = 60;
config.optimization.ga.iterationsBetweenPlots = 5;
config.optimization.ga.TolFun = 1e-005;
Line search
config.optimization.linesearch.maxIter = 1000;
config.optimization.linesearch.TolFun = 1e-007;
config.optimization.linesearch.TolX = 1e-007;
config.optimization.linesearch.iterationsBetweenPlots = 40;
config.optimization.linesearch.Display = 'off';
config.optimization.linesearch.MaxFunEvals = 4000;
Trust region
config.optimization.trustregion.maxIter = 200;
config.optimization.trustregion.TolFun = 1e-005;
config.optimization.trustregion.TolX = 1e-005;
config.optimization.trustregion.iterationsBetweenPlots = 5;
Less iterations between updated plotting figures require more CPU time.
config.optimization.trustregion.Display = 'off';
off, iter, notify, final
Showing options
config.plotting.showA = false;
To show trajectories of algebraic equations
config.plotting.showU = false;
To show trajectories of the driving input in a separate figure
config.plotting.showX = false;
To show trajectories of the dynamic variables
config.plotting.showY = true;
To show trajectories and measurements of the observables
config.plotting.showZ = false;
To show trajectories of derived variables
config.plotting.showPhaseSpace = true;
If true, displays user grouped variables in a phase space view
config.plotting.showSensitivities = true;
If true, displays time dependent sensitivities dx/dp or dy/dp
of user defined pairs between variables X/Y and parameters K/x0/S if available.
config.plotting.singleFigure = false;
config.plotting.overwrite = true;
config.plotting.menuBar = false;
Show the menu bar
config.plotting.toolBar = false;
Show the tool bar
config.plotting.showFitting = true;
config.plotting.showFittingInfo = true;
config.plotting.showFit = true;
config.plotting.showSimulation = true;
config.plotting.showIterations = true;
config.plotting.showParNamesInIterationPlot = true;
config.plotting.showTitle = true;
config.plotting.showLegend = true;
config.plotting.showXYLabels = true;
config.plotting.showModelInfo = true;
config.plotting.showParInfo = true;
config.plotting.showChisqValue = true;
config.plotting.showXTickLabel = true;
config.plotting.showYTickLabel = true;
config.plotting.showInputLegend = false;
config.plotting.showT0InStimDepView = false;
config.plotting.forceTimeDependentView = false;
config.plotting.maxLegendEntries = 20;
Maximum number of legend entries
Saving options
config.plotting.saveFit = false;
To automatically save the figure after a fit
config.plotting.saveFrames = false;
To store e.g. a fit into memory for later use of pwSaveFrames
config.plotting.savePNG = true;
config.plotting.savePNGsmall = true;
config.plotting.saveEPS = false;
config.plotting.savePDF = false;
config.plotting.saveTIFFEPS = false;
config.plotting.saveJPG = false;
config.plotting.saveFIG = false;
config.plotting.saveEMF = false;
Line style
config.plotting.plotType = 3;
1 no data
2 lines data to model
3 error bars
4 only data points
config.plotting.lineWidthInIterationsPlot = 1.5;
config.plotting.lineWidthU = 1.5;
config.plotting.lineWidthUData = 1;
config.plotting.lineWidthX = 1.5;
config.plotting.lineWidthY = 1.5;
config.plotting.lineWidthYData = 1;
config.plotting.lineWidthZ = 1.5;
config.plotting.lineWidthA = 1.5;
config.plotting.lineColorU = [0 0.7 0];
r g b values
config.plotting.lineColorUData = [0 1 0];
r g b values
config.plotting.lineColorX = [0 0 1];
r g b values
config.plotting.lineColorY = [1 0 0];
r g b values
config.plotting.lineColorYData = [0 0 1];
r g b values
config.plotting.lineColorZ = [0 0 1];
r g b values
config.plotting.lineColorA = [0 0 1];
r g b values
config.plotting.lineMarkerU = 'none';
. o x + * s d v ^ < > p h none
config.plotting.lineMarkerUData = '.';
. o x + * s d v ^ < > p h none
config.plotting.lineMarkerX = 'none';
. o x + * s d v ^ < > p h none
config.plotting.lineMarkerY = 'none';
. o x + * s d v ^ < > p h none
config.plotting.lineMarkerYData = '.';
. o x + * s d v ^ < > p h none
config.plotting.lineMarkerZ = 'none';
. o x + * s d v ^ < > p h none
config.plotting.lineMarkerA = 'none';
. o x + * s d v ^ < > p h none
config.plotting.lineStyleU = '-';
: -. -- none
config.plotting.lineStyleUData = '-';
: -. -- none
config.plotting.lineStyleX = '-';
: -. -- none
config.plotting.lineStyleY = '-';
: -. -- none
config.plotting.lineStyleYData = 'none';
: -. -- none
config.plotting.lineStyleZ = '-';
: -. -- none
config.plotting.lineStyleA = '-';
: -. -- none
Font sizes
config.plotting.fsTitle = 11;
FontSize
config.plotting.fsLegend = 9;
FontSize
config.plotting.fsXYLabels = 9;
FontSize
config.plotting.fsModelInfo = 9;
FontSize
config.plotting.fsParInfo = 9;
FontSize
config.plotting.fsChisqValue = 12;
FontSize
config.plotting.fsXTickLabel = 9;
FontSize
config.plotting.fsYTickLabel = 9;
FontSize
Miscellaneous
config.plotting.figureColor = [0.83137254901961 0.8156862745098 0.7843137254902];
config.plotting.legendColor = [0.83137254901961 0.8156862745098 0.7843137254902];
config.plotting.axesColor = [1 1 1];
config.plotting.textColor = [0 0 0];
config.plotting.nFine = 200;
Number of plotted points for each trajectory.
Value change takes effect immediately - no re-combination of couples required.
config.plotting.useGrayColors = false;
If true, PottersWheel uses gray colors (not yet fully implemented).
config.plotting.multiTrajectoryColors = {};
config.plotting.multiTrajectoryColors{1} = [0 0 0];
config.plotting.multiTrajectoryColors{2} = [0 0 1];
config.plotting.multiTrajectoryColors{3} = [0 0.666666666666667 1];
config.plotting.multiTrajectoryColors{4} = [0.333333333333333 0.666666666666667 0];
config.plotting.multiTrajectoryColors{5} = [0 1 0];
config.plotting.multiTrajectoryColors{6} = [1 0.749019607843137 0];
config.plotting.multiTrajectoryColors{7} = [1 0.333333333333333 0];
config.plotting.multiTrajectoryColors{8} = [0.784313725490196 0.117647058823529 0];
config.plotting.multiTrajectoryColors{9} = [0.666666666666667 0 0.5];
config.plotting.multiTrajectoryColors{10} = [0.333333333333333 0 0.5];
config.plotting.stimuliColors = {};
config.plotting.opacity = 1;
To adjust the opacity of trajectories between 0 and 1.
An opacity of 1 corresponds to a normal plot with no transparency.
Attention: Semi-transparent lines are computationally more expensive.
config.plotting.lineSmoothing = false;
If true, all trajectories are displayed with anti-aliased, i.e. smoothed lines.
config.plotting.distanceToScreenBottom = 34;
config.plotting.distanceToScreenTop = 0;
config.plotting.distanceToScreenLeft = 0;
config.plotting.distanceToScreenRight = 0;
config.plotting.nSignificantDigits = 4;
config.plotting.spread = 0;
Used to spread stimulations within the same plot
so that lines which are plotted onto each other are visible.
config.plotting.colormapName = 'jet';
jet hsv hot cool spring summer autumn winter gray bone copper pink lines
config.plotting.parameterIDsMode = 1;
1 IDs
2 Names
3 IDsAndNames
config.plotting.variablesIDsMode = 1;
1 IDs
2 Names
3 IDsAndNames
config.plotting.userFunction = '';
Function: User supplied function which will be used for additional figures.
See pwSetPlottingUserFunction.
pwSim)">
Simulating data (pwSim)
config.simulation.setNegativeValuesToZero = true;
If true, negative simulated data is set to zero.
Latex settings
config.report.referenceFile = [];
A bibtex reference file, e.g. created with JabRef.
config.report.bibstyle = 'alpha';
alpha, plain, natbib
config.report.paperSize = 'a4paper';
a4paper, letter
See also
See also
pwGetDrivingFunction
df = pwGetDrivingFunction(uType, uTimes, uValues, u2Values)
uType: 'steps', 'linear', 'exponential', 'spline', 'injection'
See also
pwGetDrivingFunctionCont
df = pwGetDrivingFunctionCont(value)
Short form to define a continuous stimulation in data files.
See also
pwGetDrivingFunctionPulse
df = pwGetDrivingFunctionPulse(value, timeStop)
Short form to define a pulsed stimulation in data files.
See also
pwGetDrivingFunctionsFromFile
stimuli = pwGetDrivingFunctionsFromFile(filename, inputType, colNameStimulusIDs,
colNameTime, colNameValues)
Reads a driving input function from a file or a data struct.
filename Either a string comprising the filename of an external xls or txt
file or a data struct returned by Data_ReadDataFile in order to
avoid multiple loading of the same file. See example below.
inputType 'steps', 'linear', 'injection', 'spline'. Compare pwAddU.
colNameStimulusIDs
Exact name of the column comprising the stimulus IDs which have
to start at 1 and must be contiguous. The stimulus ID
corresponds to a different experimental setting, e.g.
stimulation with a different dosage or a different patient.
colNameTime Exact name of the column comprising the time values.
colNameValues Exact name of the column comprising the values of the
driving input function (uValues).
Description
The shape of externally controlled variables is specified through
driving input functions (pwAddU). In an external xls or txt data file,
they are given in the MCode section using
pwGetDrivingFunction(uType, uTimes, uValues, u2Values)
(or, since PW 2.0.55, in a driving input section, compare pwAddData).
Example for an experiment consisting of two settings (stimuli) with
a continuous stimulation of 6 units and a pulsed stimulation of 7 units
and 5 minutes duration, both starting at t=0:
drivingFunctions(1).name = 'Drug';
drivingFunctions(1).stimuli(1) = pwGetDrivingFunction('steps', [-1 0], [0 6]);
drivingFunctions(1).stimuli(2) = pwGetDrivingFunction('steps', [-1 0 5], [0 7 0]);
In some cases, the external species can not be approximated by such a
parametrization, but is rather given by measured data-points.
Then, a linear or spline driving function can be used.
In order to avoid very long expressions like
drivingFunctions(i).stimuli(1) = pwGetDrivingFunction('linear', ...
[-1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3...], ...
to capture the whole measurement, the driving function may reside in a
separate file, say 'DrugInput.xls'. Since the file should contain the
information for all experimental settings, i.e. stimuli, we want to
extract the shape of the driving function for all stimuli at once.
It can be done via
drivingFunctions(1).name = 'Drug';
drivingFunctions(1).stimuli = pwGetDrivingFunctionsFromFile(...
'DrugInput.xls', 'linear', 'StimuliIDs', 'Time', 'DrugValues')
where 'DrugValues' is the name of the column in the file 'DrugInput.xls'
comprising the values of the external drug for the time-point and
stimuli number given in the columns 'Time' and 'StimuliIDs', respectively.
The specified column names are arbitrary but must match exactly the external
file column names. The file 'DrugInput.xls' could look like this:
StimuliIDs Time DrugValues
1 0 14.70
1 0.1 21.73
1 0.2 25.87
...
2 0 1.50
2 0.1 1.79
2 0.2 2.10
...
Terminology
Unfortunately, we are using the same plural 'driving functions' in two situations:
- Several species can be measured externally
- One species is measured under different settings, i.e. stimuli.
The plural 's' in 'pwGetDrivingFunctionsFromFile' refers to several
driving functions with the same name but for different stimuli.
Please see the example below.
Example
% In order to load data for different driving species, the function
% has to called several times, e.g.
drivingFunctions(1).name = 'Drug1';
drivingFunctions(1).stimuli = pwGetDrivingFunctionsFromFile(...
'DrugInput.xls', 'linear', 'StimuliIDs', 'Time', 'DrugValues1')
drivingFunctions(2).name = 'Drug2';
drivingFunctions(2).stimuli = pwGetDrivingFunctionsFromFile(...
'DrugInput.xls', 'linear', 'StimuliIDs', 'Time', 'DrugValues2')
% In order to avoid repeated reading of the external file, a data struct
% can be used:
dataStruct = Data_ReadDataFile('DrugInput.xls');
drivingFunctions(1).name = 'Drug1';
drivingFunctions(1).stimuli = pwGetDrivingFunctionFromFile(...
dataStruct, 'linear', 'StimuliIDs', 'Time', 'DrugValues1');
drivingFunctions(2).name = 'Drug2';
drivingFunctions(2).stimuli = pwGetDrivingFunctionFromFile(...
dataStruct, 'linear', 'StimuliIDs', 'Time', 'DrugValues2');
See also
pwGetE
event = pwGetE(reactants, parameters, trigger, assignment, ID)
Creates an event from a trigger like 't >= 0' and an assignement like
'Erk = 10'. The syntax behaves like for algebraic equations.
See also
pwGetEmptyModel
m = pwGetEmptyModel()
Returns an empty PottersWheel model struct m.
The following fields can be set by the user directly.
Other fields are set automatically, e.g. when calling
m = pwAddR(m, ...)
ID Allowed are 38 characters using [a-zA-Z0-9_].
name Name of the model with no character restriction.
path Relative path. Usually set automatically.
filename Usually set automatically when loading the model to
[ID, '.m']
description String.
authors String array, e.g. {'Frank Sinatra', 'Eddie Murphy'}
dates String array, e.g. {'2011-10-25', '2012-01-02'}
type Used PottersWheel type, e.g. 'PW-2-1-12'
keywords String array.
amountBasedRates True or false. See below for further details.
t Default time-points when simulating synthetic data.
tStart Start of integration, usually 0. Use a negative value to
reach a steady state level at t=0, e.g. m.tStart = -100.
tPlotStart Start of the plotting. If tStart is -100 one can force
the plotting to start at 0 by m.tPlotStart = 0.
tRealUnit String comprising the name of the unit used to specify the model,
e.g. 'seconds'.
tDisplayUnit String comprising the name of the unit used to disply trajectories,
e.g. 'minutes'.
tDisplayUnitOverRealUnit Factor defining the ratio between displayed and real
units, e.g. 60.
Description
Reactions can be added via
m = pwAddR(m, ...)
The same holds for other elements like
dynamic or derived variables, parameters, algebraic equations, etc.
Amount based rates
Biochemical processes often benefit from compartmentalization, e.g.
in order to increase locally the pH-value required to degrade waste products.
Therefore, many biochemical models comprise compartmental information,
essentially the volume of each compartment and the classification of each
species to exactly one compartment. As discussed in the SBML specifications
(see www.sbml.org), the kinetic rate of a reaction with reactants and products
in different compartments, has to be expressed in amount-based units per time
instead of concentration changes per time. This is due to the fact, that the
loss of a single molecule from a small into a 100 times larger compartment
results in a 100 times stronger concentration change in the smaller compartment.
The additional burden to determine the amount of a kinetic rate is usually
handled by multiplication with the size of the corresponding volume. Note
that in reversible reactions from compartment C1 to C2, in most cases the part
of the kinetic rate comprising reactants is multiplied with c1, the size of C1,
and the part comprising the products is multiplied with c2, e.g.
k1*r1*c1 k2*p1*c2
The question arises whether the modeling framework can take care of the
compartment size multiplication automatically, so that the user avoids
specifying redundant or repetitive information, as in a set of reactions all
taking place in the same compartment. At the same time, the readability of the
kinetic law would be improved and correspond closer to the expression in a
biochemistry textbook. In fact, PottersWheel is able to correct for the
compartment sizes automatically for most models which is called implicit
multi-compartment modeling. In the other cases, when importing an amount
based model, or to have full control, the compartment correction can be
turned off by the following line in the model definition file:
m.amountBasedRates = true;
Since SBML models are amount-based, an imported SBML model will comprise
the above line below the meta information paragraph corresponding to
explicit multi-compartment modeling.
Model families
If several model variants are under investigation, the concept
of model families should be applied, in order to avoid redundant model
paragraphs and copy-and-past errors. A core model is created which is
the same for all model variants. This model starts as usual with
m = pwGetEmptyModel;
Then, 'daughter'-models are derived using
m = motherModel;
where motherModel is the name of the mother model, e.g.
m = JakStatModel1;
Since PottersWheel models are structured as Matlab functions,
this approach ensures that changes to the mother model
are reflected also in all daughter models. Repeated derivation
is also possible.
Note
The Model Designer currently saves a daugther model into a full
model file.
See also
pwGetFieldtype
type = pwGetFieldtype(class, fieldname)
Returns the type of a field for a PottersWheel object class.
class a, c, k, o, r, s, u, v, x, y, z
fieldname Any field belonging to the specified class as described in
pwAddA, pwAddR, pwAddK, pwAddX, pwAddV, pwAddO, e.g.
class a: lhs, rhs
class c: reactants, products, modifiers, parameters
class k: ID, type, value, minValue, maxValue
class x: ID, type, startValue, minValue, maxValue
class v: ID, rhs
class o: lhs, rhs
class u: ID, uType
type Type of the specified field, given as one of the following strings:
stringCellArray, char, scalar, numericArray, numericCellArray, struct
Description
This function is useful to apply reflection-like programming strategies.
See also
pwGetFitParameterValuesByID
values = pwGetFitParameterValuesByID(IDs)
Returns the value for all parameters given as IDs
for the currently fitted parameters as given e.g. in the equalizer.
If an ID is not found, the value is set to NaN.
See also
pwGetFitParameters
[IDs, values] = pwGetFitParameters()
Returns IDs and values of the currently fitted parameters
as given e.g. in the equalizer.
See also
pwGetFitsOfAnalysis
fits = pwGetFitsOfAnalysis
Returns the struct array 'fits' which comprises all parameter
values and other calibration information.
The array corresponds to the list 'fits of analysis' in the
PottersWheel equalizer.
See also
pwGetFitsOfSelectedCouple
fits = pwGetFitsOfSelectedCouple
Returns a struct array with parameter values of all fits
available for the highest currently selected couple.
fits(i).fitID.timeStart => start time of fit
.timeEnd
.name
.dynamicParametersOfFit => k
.startValuesOfFit => x0
.observationOfFit => s
pwGetFixedParameters
IDs = pwGetFixedParameters
Returns a cell array of IDs of all currently temporarily fixed
parameters. Note that locally fitted parameters have a
suffix '_C1', '_C2', ... depending on the number of the
combined couple.
pwGetHandlerEqualizer
h = pwGetHandlerEqualizer
Use this function to customize the positioning of the
PottersWheel Equalizer interface.
If the Equalizer is still closed, h will be empty ([]).
Examples
% Get handler
h = pwGetHandlerEqualizer;
% Get all properties
get(h)
% Get width and height
p = get(h, 'Position');
width = p(3);
height = p(4);
% Change position
set(h, 'Position', [100 100 width height])
See also
pwGetHandlerMainGUI
h = pwGetHandlerMainGUI
Use this function to customize the positioning of the
PottersWheel main user interface.
Examples
% Get handler
h = pwGetHandlerMainGUI;
% Get all properties
get(h)
% Get width and height
p = get(h, 'Position');
width = p(3);
height = p(4);
% Change position
set(h, 'Position', [100 100 width height])
pwGetIDs
[kIDs, xIDs, sIDs] = pwGetIDs()
Returns the IDs of the highest selected model.
pwGetInfluencedSpecies
[influenced, notInfluenced] = pwGetInfluencedSpecies(species, modelIndex)
Determines all species that are influenced by a given species
in the given model, i.e. which has a non-zero sensitivity on
the given species based on the model structure.
If no model is specified, the highest currently selected model of the
couple-list is used.
See also
See also
pwGetInvolvedSpecies
species = pwGetInvolvedSpecies(i, modelIndex)
Determines all species that are involved in reaction i of the
given model (or currently selected model in the couple-list).
See also
pwGetK
k = pwGetK(ID, value, type, minValue, maxValue, unit, name, description, low, high)
Returns a dynamic parameter.
See also
pwGetKDialog
k = pwGetKDialog
Opens a dialog to specify properties of a dynamic parameter k
and returns a valid struct.
See also
pwGetListOfParameters
pwGetListOfParameters
Displays a list of parameters in a model definition compatible way.
The list can then be pasted into a model definition file.
See also
pwGetModelElement
elementValue = pwGetModelElement(elementName)
Returns the value of an element of the highest selected model.
Supported element names given as a string, e.g. 'r':
r reactions
x dynamic variables x
y observables y (only of default observation)
k dynamic parameters k
See also
pwGetModelPlottingConfig
p = pwGetModelPlottingConfig
Returns a struct for the highest selected model
which can be changed in a similar way as when using pwGetConfig
in order to change visualization settings like
visibility of single species or groups of species.
See also
pwGetModelState
state = pwGetModelState(model)
Returns the state of a model core as a number.
If the model is not changed in key properties,
the state will be the same and e.g. re-compilation
is not required.
pwGetNeighbourSpecies
[neighbours, notNeighbours] = pwGetNeighbourSpecies(species, modelIndex)
Determines all species that are neighbours of a given species
in the highest currently selected model of the couple-list.
A neighbour is reactant, product, or modifier in one or more
reactions in which the given species is involved.
See also
pwGetNumberOfCouples
n = pwGetNumberOfCouples()
Returns the number of available couples,
i.e. the number of couples in the repository list.
See also
pwGetNumberOfDataSets
N = pwGetNumberOfDataSets
Returns the number of available data sets for the highest selected couple.
pwGetNumberOfFittedCouples
n = pwGetNumberOfFittedCouples()
Returns the number of currently fitted couples,
that means the number of couples in the 'combination list'.
See also
pwGetNumberOfFittedDataPoints
N = pwGetNumberOfFittedDataPoints
Returns the number of fitted datapoints over all combined
couples and all observables ignoring NaN values.
pwGetP
p = pwGetP(rhs, ID, unit, name, description)
Creates a derived parameter p.
See also
pwGetParameterValues
[k, x0, s] = pwGetParameterValues()
Returns the parameter values of the highest selected model
of the current data set and fit.
See also
pwGetParameterValuesByID
values pwSetParameterValuesByID(IDs, forSimulation)
Gets the values of all parameters given as IDs
for the highest selected couples.
forSimulation true or false
If true: Uses the values for simulation.
If false (default): Refers to the current fit of
the currently selected data set.
See also
pwGetPlottingData
[matrix, IDs] = pwGetPlottingData(types, coupleNr, stimulusNr)
Returns the same data that is currently plotted with pwDraw.
types Cell array with one or more of the fields:
tFine time (high sampled)
xFine dynamic variables
yFine observations
zFine derived variables
uFine driving input functions
or
tForFit time (sampled as specified in model.t for simulations
or as given in the data set)
xForFit dynamic variables
yDataForFit observations (simulated or external data)
yDataStdForFit standard deviation of observations
residuals weighted distance between model and observations
yForFit observations calculated by the model
coupleNr number of the combined couple (default 1)
stimulusNr number of the stimulus (default 1)
matrix Matrix with length(tFine) or length(tForFit) rows
IDs Cell array with the column names of the matrix
Description
Note that the fine variables can not be combined with the
other variables, since the corresponding matrices have a different
number of rows.
The function pwGetPlottingData2 is the advanced version to
get the plotted data.
Examples
Example 1:
x variables of couple 1, stimulus 1 with high sampling
[matrix, IDs] = pwGetPlottingData({'tFine', 'xFine'}, 1, 1);
time = matrix(:,1);
values = matrix(:, 2:end);
Example 2:
[matrix, IDs] = pwGetPlottingData({'tForFit', 'yForFit', 'yDataForFit'});
returns a matrix with the fitted data points (assume 3 observables):
- First colum are the time points
- Columns 2 - 4 are values of the model
- Columns 5 - 8 are the original data points
In 'IDs' the names of the columns are saved.
In order to get the fine sampled curve:
[matrix, IDs] = pwGetPlottingData({'tFine', 'yFine'});
See also
pwGetPlottingData2
couples = pwGetPlottingData2
Returns all data which is currently available for plotting purposes
ordered by couples and stimuli.
% IDs
couples(i).modelID
couples(i).dataID
couples(i).kIDs
couples(i).sIDs
couples(i).uIDs
couples(i).xIDs
couples(i).yIDs
couples(i).zIDs
couples(i).aIDs
% Parameters and start values
couples(i).k
couples(i).s
couples(i).x0
% Visibility (as set in the equalizer)
couples(i).plotting.visible.a.indices
couples(i).plotting.visible.u.indices
couples(i).plotting.visible.x.indices
couples(i).plotting.visible.y.indices
couples(i).plotting.visible.z.indices
couples(i).plotting.visible.stimuli.indices
% Trajectories for fine sampling (Fine) or experimental sampling (ForFit)
% for each stimulus couples(i).stimuli(j):
tForFit Sampling of experiment
tFine Fine sampling (n may be changed in config.plotting.nFine)
aForFit Left hand side values of algebraic equations
aFine
uForFit Driving input u
uFine
u0 Value of driving input u at first time point
xForFit Dynamic variable x given by model at sampling time points
xFine Dynamic variable x given by model for fine sampling
yForFit Observable y given by model at sampling time points
yDataForFit Externally given data - the measurements
yDataStdForFit Standard deviation of the external data
yFine Observable y given by model for fine sampling
y0 Mean value of external data for first time point
zForFit Derived variable z
zFine
Desciption
The similar function pwGetPlottingData returns data calculated for plotting
depending on a couple and stimulus number and specified IDs
as a single matrix with IDs for the column names.
This second version, pwGetPlottingData2, on the other hand returns
all data at once. The output variable is a struct array that can
be used for custom plotting or calculation.
x0, y0, u0 belong to the first time-point used for integration
and not necessarilly to the zero time-point t=0.
See also
pwGetPlottingDataForStimDepView
[uniqueTimepoints, stimuliValues, data, IDs] = pwGetPlottingDataForStimDepView(iCouple, type)
Returns plotting data for stimulus dependent view.
iCouple Index of the couple of interest in the currently combined couples.
(Not to be mistaken with its index in the repository list of
available couples)
Default: 1
type Either 'u', 'x', 'y', or 'z'.
Data will be returned for this variable type.
uniqueTimepoints Unique subset of tForFit timepoints for which stimulus
dependent data will be returned
stimuliValues Cell array with v = stimuliValues{iT} being the values of
all stimuli for uniqueTimepoint(iT), e.g. the available
doses at a certain time-point for a dose-response experiment.
data Cell array with d = data{iT} being a matrix of
values where d(i,j) is the value at time iT of the j-th plotted
species of the selected variable type for stimulus j,
i.e. at stimulusValues{iT}(j).
IDs Cell array with ID = IDs{j} being the ID of the
j-th plotted species
See also
pwGetQRNGIndex
index = pwGetQRNGIndex()
Returns the currently used index of the
quasi random number generator.
See also
pwGetR
reaction = pwGetR(reactants, products, modifiers, type, options, ...
rateSignature, parameters, description, ID, ...
name, fast, compartments, parameterTrunks, designerPropsR, ...
stoichiometry, reversible);
Creates and returns a reaction struct.
See also
pwGetRateSignature
rateSignature = pwGetRateSignature(reaction)
Returns the explicit rate signature of a reaction.
This can be useful, if a reaction has not a custom
reaction type ('C'), but e.g. an automatic one ('A').
See also
pwGetReactionAutoID
ID = pwGetReactionAutoID(r)
Returns an automatic ID for a reaction r
calculated e.g. if the user does not supply a
reaction ID. It is based on the reactants,
products, modifiers, parameters, rate signature,
compartments, and stoichiometry.
See also
pwGetRule
pwGetRule has been replaced by pwGetA in PottersWheel 2.0.
It is recommended to use the new function, however
pwGetRule will always be available as a wrapper to pwGetA.
See also
pwGetS
s = pwGetS(ID, value, type, minValue, maxValue, unit, name, description,
usedInTimeTransformation, low, high)
Creates a scaling value struct.
See also
pwGetSelectedModel
model = pwGetSelectedModel
Returns the model of the highest selected couple.
pwGetSmallParsForFit
p = pwGetSmallParsForFit
Returns the currently fitted parameter values.
Temporarilly fixed parameters are neglected,
therefore 'small' parsforfit.
pwGetStimulusField
values = pwGetStimulusField(iCouple, jStimulus, fieldname)
Returns the values of a certain field of the specified stimulus
and couple from the repository list.
Possible fields:
t
y
yStd
See also
pwGetStoichiometricMatrix
[L, D, x0, n0, k, c] = pwGetStoichiometricMatrix(x0)
Returns the stoichiometric coefficients and kinetic and stochastic
rate constants as described in Ullah et al. for the highest selected model.
Note
This approach is only feasible for models where reseverible reactions
are modelled as a separate forward and backward reaction based on
mass action kinetics without modifiers and algebraic equations.
All reactions must take place in the same compartment.
Compare Ullah et al, IEE Proc.-Syst. Biol., Vol. 153, No. 2, March 2006
Deterministic modelling and stochastic simulation of
biochemical pathways using MATLAB
See also
pwGetStoredOptimizationJacobian
dcdp = pwGetStoredOptimizationJacobian
Returns the Jacobian matrix of the last optimization if
config.optimization.storeJacobian
is set to true.
Requires
config.optimization.useJacobian == true
pwGetU
u = pwGetU(ID, uType, uTimes, uValues, compartment, name, description,
u2Values, alternativeIDs, designerProps, classname, referenceXID, unit, formula)
Create a driving input struct.
Types: step, linear, exponential
See also
pwGetUDialog
u = pwGetUDialog
Opens a dialog to specify properties of a driving input u
and returns a valid struct.
See also
pwGetV
v = pwGetV(ID, rhs);
Creates a reaction rate.
See also
pwGetX
x = pwGetX(ID, startValue, type, minValue, maxValue, unit, compartment, ...
name, description, typeOfStartValue, designerProps, classname, ...
explodePattern, removeAfterExplosion, low, high)
Creates a dynamic variable.
See also
pwGetXDialog
x = pwGetXDialog
Opens a dialog to specify properties of a dynamic variable x
and returns a valid struct.
See also
pwGetY
y = pwGetY(rhs, ID, scalingParameter, errorModelRhs, noiseType, unit, name, ...
description, alternativeIDs, designerProps, classname)
Creates an observation function.
If no ID is given, the right hand side (rhs) is used as ID
with appending '_obs' and replacing symbols like '+' by '_plus_', etc.
See also
pwGetZ
pwGetZ(rhs, ID, unit, name, description, designerProps, classname)
Creates a derived variable.
See also
pwGoToToolboxFolder
pwGoToToolboxFolder
Changes the current directory to the folder where PottersWheel has been
installed.
Shortcut for:
cd(fileparts(which('pw')));
pwGoodnessOfFit
[LL, AIC, AICc, BIC, pValue1, pValue2] = pwGoodnessOfFit(chisq, N, p)
Calculates several measures describing the goodness of fit.
chisq Chi-Square value
N Number of fitted data points
p Number of fitted parameters
LL Log-Likelihood = - 0.5 * chisq - N/2 * log(2*pi)
AIC Akaike Information Criterion = - 2 * LL + 2 * p
AICc Corrected AIC = AIC + 2 * p * (p+1) / (N - p - 1)
BIC Bayesian Information Criterion = -2 * LL + p * log(N)
pValue1 pValue(N) = 1 - Cdf(chisq, N)
pValue2 pValue(N-p) = 1 - Cdf(chis, N-p)
Description
Cdf(.,f) denotes the cumulative density function of
a chi-square distribution with f degrees of freedom.
See also
pwGraph
pwGraph
Displays the graph of all selected models in an external window.
pwHomepage
pwHomepage
Open the PottersWheel homepage http://www.potterswheel.de
in the default browser.
Firefox 3.6 and Matlab 2007b: Only an empty page is shown.
pwIDSO
pwIDSO
Opens the IDSO dialog where
1. instructions
2. dynamic parameters
3. start values
4. observation functions
can be specified.
See also
pwIncludeFileInRepository
pwIncludeFileInRepository(filename, description)
Allows to include a file in a PottersWheel repository.
pwIncludeModel
m = pwIncludeModel(m, filenameModel2)
Includes a model given by a filename within
an existing model struct m.
Meta information will be ignored.
Included are:
Reactions, x, y, z, u, k, s, rules
See also
pwInfo
pwInfo
Prints information about the currently fitted parameter values.
The reset column usually corresponds to the parameter values as
given in the model definition file, if not changed e.g. using
pwSetResetValues.
The 'initial' column displays the initial guesses for each parameter
before the last fit.
Example
Parameter: Value: Reset: Min: Max: Fitted:
1 k1 0.0355431 0.0287277 1e-007 0.25 x
2 k2 58.2856 65.2553 1 10000 x
3 k3 39803 49189 1000 100000 x
See also
pwInfoPlotsFitting
pwInfoPlotsFitting(fast, small)
Plots information about the current or last fitting procedure:
- Chisq value / N
- Parameter values
- Deviation from true values (only for simulated data)
fast = true (default): fast plotting without legend etc.
false: legend on; line width as given in config.
See also
pwInitialize
pwInitialize(update)
Initializes and optionally updates PottersWheel.
pwInputDesigner
pwInputDesigner
Opens the input designer interface to change characteristics of
external driving input functions.
pwInputFunctionToString
s = pwInputFunctionToString(input)
Interpretes an input function and creates a human readable string s.
input should have the following fields:
input.uType
.uTimes
.uValue
s will be e.g. Cont 1 for a continuous stimulation of amplitude 1.
Keywords: Driving function, stimulus
See also
pwInstall
pwInstall
Installs the PottersWheel toolbox by setting the
Matlab path and compilation of C MEX files.
If the path is already set and you only update PottersWheel,
nothing has to be done. PottersWheel checks automatically
in the beginning of each session whether all C MEX files
are up-to-date and compiles if necessary.
pwInstallSundialsTB
pwInstallSundialsTB
Installls the Sundials Matlab toolbox in order to apply the
CVODES integrator (without parallel support).
Description
Please download version 2.4 of the Sundials Matlab toolbox from
https://computation.llnl.gov/casc/sundials/download/download.html
It is included in the suite sundials-2.4.0.tar.gz.
Unzip the suite using e.g. WinRar on Windows or
tar -xvf sundials-2.4.0.tar.gz
Start Matlab and set the working directory to
...\sundials-2.4.0\sundialsTB
Call pwInstallSundialsTB. The Matlab path is automatically updated.
On Linux, a dialog may open asking you to save pathdef.m into a
folder from where you start Matlab.
Note
This function is based on install_STB written by Radu Serban
and installs only the parts of the sundials toolbox which
are required for PottersWheel. Please use the original install_STB
for a customized or complete installation.
See also
pwIntegrate
pwIntegrate
Integrates the currently combined models.
See also
pwIntegrationTimeAlongFitTrajectory
elapsedTime = pwIntegrationTimeAlongFitTrajectory(stiff, nRepetitions, integrators)
Integration time depends on the current position in the parameter space.
Therefore a model may become stiff during optimization.
This function determines the integration time along the fitting trajectory.
stiff true or false (default)
intergrators(i).name (e.g. 'ode23', 'RADAU5', 'RADAU5 fast')
.mexODE (true, false)
elapsedTime(j, i) is the time needed for integration (including
some overhead...) of integrator i in iteration j
of the last fit.
See also
pwLRT
p = pwLRT(chisq1, numPars1, chisq2, numPars2)
Calculates the probability, that in comparison with model 2,
model 1 is sufficient to explain the data.
A small p value indicates, that model 2
should be preferred (which still may not be sufficient).
Model 2 must be an extension of model 1.
pwLicense
pwLicense
PottersWheel license file.
Please save this file in the PottersWheel toolbox folder.
pwListK
pwListK(alphabetically)
List the current values of the dynamical values K
in the same way as they appear in a model definition file.
This can be used to replace the dynamical paramters
in an existing model without replacing other elements.
alphabetically true or false (default)
If true, the parameters are displayed alphabetically.
Is applied to all combined models of the current fitting assembly.
See also
pwLoadConfigFromMFunction
pwLoadConfigFromMFunction(filename)
Loads the configuration from a valid PottersWheel configuration
file, which is constructed as a Matlab function returning a config struct.
It is ensured that missing fields are added by calling
pwEnsureValidConfig internally.
See also
pwLoadConfigFromMatFile
config = pwLoadConfigFromMatFile(filename)
If no output argument is specified, the config is directly
passed to the global PottersWheel configuration struct.
See also
pwLoadFitsFromFile
pwLoadFitsFromFile(filename)
Load fits from xls or txt file into the fits-of-analysis list
of the equalizer.
See also
pwLoadRepository
ok = pwLoadRepository(filename, showDialog)
Loads a PottersWheel repository from hard disk.
Default filename: 'pwRepository.mat'
See also
pwLogChangeFitParameter
pwLogChangeFitParameter(ID, exponent1, exponent2, n, oldValue)
Changes fitted parameter given by ID between
10^exponent1 * oldValue and
10^exponent2 * oldValue at
n steps.
After each step the system is integrated and plotted.
Default values: exponent1 = -1
exponent2 = 1
n = 10
ID = ID of first fitted parameter
oldValue = current value of fitted parameter
See also
pwMatch
[match, validPattern] = pwMatch(ID, simplePattern)
Returns true if the given ID is matched by the provided simple PottersWheel pattern.
This function can be used to test custom simple patterns.
Also returned is the valid regular expression corresponding to
the simple pattern.
See also
See also
pwModelDefinitionGUI
pwModelDefinitionGUI(modelIndex)
pwModelDefinitionGUI(modelFile)
pwModelDefinitionGUI(mdgFile)
pwModelDefinitionGUI(-1)
pwModelDefinitionGUI()
Opens the PottersWheel Model Definition GUI for
the given model index,
model file (*.m),
or model definition GUI file (*_mdg.mat).
If the model index is -1, a new model is created and opened.
If no argument is specified, the highest selected model of the main
PottersWheel window is opened.
modelIndex Number between 1 and pwGetNumberOfCouples, e.g. 2
Any number less or equal to 0 will open an empty model.
modelFile Path to a model *.m file, e.g. '../Models/M1.m'
mdgFile Path to a model definition GUI file, e.g. '../Models/M1_MDG.mat'
Description
The table-based user interface allows to create, read, and edit models
and finally to save a model into a valid PottersWheel model definition file.
See also
pwModelDesigner
pwModelDesigner
Opens the PottersWheel model designer to create reaction based
models visually.
pwModelInfo
pwModelInfo(filename, html)
With no argument:
Displays a list of all models in the repository including number
of reactions, parameters, and variables.
If filename is given, the information is also saved as a text file.
With html = true, an html page is saved.
See also
Description
The returned string can be used to construct
a list of settings to be used in the
PottersWheel Online Modeling interface.
pwModelTablesGUI
pwModelTablesGUI(modelIndex)
pwModelTablesGUI(modelFile)
pwModelTablesGUI(pwmtFile)
pwModelTablesGUI(-1)
pwModelTablesGUI()
Opens the PottersWheel Model Tables GUI for
the given model index,
model file (*.m),
or PottersWhele Model Tables file (*_pwmt.mat).
If the model index is -1, a new model is created and opened.
If no argument is specified, the highest selected model of the main
PottersWheel window is opened.
modelIndex Number between 1 and pwGetNumberOfCouples, e.g. 2
Any number less or equal to 0 will open an empty model.
modelFile Path to a model *.m file, e.g. '../Models/M1.m'
pwmtFile Path to a model Tables GUI file, e.g. '../Models/M1_pwmt.mat'
Description
The table-based user interface allows to create, read, and edit models
and finally to save a model into a valid PottersWheel model file (*.m).
See also
pwMota
pwMota(fits, [], showPlots, maxNumberOfParameters)
pwMota(K, IDs, showPlots, maxNumberOfParameters)
Mean optimal transformation approach.
Description
Applies a MOTA analysis to the given fits
or the given parameter matrix K with dimensions
nFits x nPars where the paramters have the given IDs
or will be set to p1, p2, ...
This is a wrapper function to the algorithm implemented by Stefan Hengl.
Reference
Stefan Hengl, Clemens Kreutz, Jens Timmer, Thomas Maiwald
'Data-based identifiability analysis of nonlinear dynamical models.'
Bioinformatics 2007, 23, 2612-2618
See also
pwNewModel
pwNewModel
Opens the model creation wizard.
See also
pwODEsToReactions
[reactions, ratesUser, ratesODE] = pwODEsToReactions(odes, xIDs, kIDs, uIDs, aIDs)
Tries to re-create the set of reactions given a set of differential
equations. Currently, only simple brackets are allowed within the ODE, like
a + (c + d) - (e + f) - (g - h)
Keywords: reaction network reconstruction
See also
pwOpenODE
pwOpenODE(mode)
mode = 'PottersWheel' (default):
Opens the ODE MEX C files of the currently selected models.
else:
Opens the ODE C files of the currently combined models.
userFunction Name or function handle of a user defined optimization function
If not specified, the current user function is returned.
If empty, i.e. pwOptimizationSetUserFunction([]),
no user function is used any more.
useUserFunction True {default for non-empty userFunction} or
False {default for empty userFunction}
Description
A custom function that can be used to calculate the residuals which
are optimized within PottersWheel. For this, a custom Matlab
function has to be supplied having the following input and
output arguments:
residuals = myUserFunction(residuals, couples)
residuals:
N x 1 vector comprising all N weighted distances
between model and data points and possible constraints.
This vector can be shortened, replaced or extended, e.g. to
add global constraints to an optimization, where trajectories
of different couples are compared.
couples:
Struct, where couples(i).stimuli(j).xForFit.SomeID (e.g. couples(i).stimuli(j).x.Smad)
will return the trajectory of the dynamic variable Smad of couple i and stimulus j
at all time points where also measured data is available.
Similar, couples(i).stimuli(j).yDataForFit.SomeID contains the observed values and
couples(i).stimuli(j).zForFit.SomeID the derived variables.
For calculations based on the integrated trajectories, e.g. to accurately
determine the maximum of a curve, xFine etc. can be used. In summary:
% IDs
couples(i).modelID
couples(i).dataID
couples(i).kIDs
couples(i).sIDs
couples(i).uIDs
couples(i).xIDs
couples(i).yIDs
couples(i).zIDs
couples(i).aIDs
% Parameters and start values
couples(i).k
couples(i).s
couples(i).x0
% Visibility (as set in the equalizer)
couples(i).plotting.visible.a.indices
couples(i).plotting.visible.u.indices
couples(i).plotting.visible.x.indices
couples(i).plotting.visible.y.indices
couples(i).plotting.visible.z.indices
couples(i).plotting.visible.stimuli.indices
% Trajectories for experimental sampling (ForFit)
% for each stimulus couples(i).stimuli(j):
tForFit Sampling of experiment
xForFit Dynamic variable x given by model at sampling time points
yForFit Observable y given by model at sampling time points
yDataForFit Externally given data - the measurements
yDataStdForFit Standard deviation of the external data
y0 Mean value of external data for first time point
zForFit Derived variable z
uForFit Driving input u
u0 Value of driving input u at first time point
Description
The name of the optimization function is saved in the configuration at:
config.optimization.userFunction
The function can be set any time and will be applied in the next
fitting.
Examples
1. Decrease difference of Smad concentration between two couples:
pwOptimizationSetUserFunction(@myUserFunction1)
where myUserFunction1.m reads:
function residuals = myUserFunction1(residuals, couples)
iSmad = 2; % We assume Smad is the 2nd x variable. Else, use xIDs.
furtherResiduals = couples(1).stimuli(1).xForFit(:,iSmad) - ...
couples(2).stimuli(1).xForFit(:,iSmad);
residuals(end+1:end+length(furtherResiduals)) = furtherResiduals;
2. Optimize the sum of Smad_obs over all couples compared to the data
which is attached to couple 1:
pwOptimizationSetUserFunction(@myUserFunction2)
where myUserFunction2.m reads:
function residuals = myUserFunction2(residuals, couples)
residuals = []; % We neglect every normal residual between data and model.
iSmad = 1; % We assume Smad is the 1st y variable. Else, use yIDs.
ySum = couples(1).stimuli(1).yForFit(:,iSmad);
for i=2:length(couples)
ySum = ySum + couples(i).stimuli(1).yForFit(:,iSmad);
end
% Difference to measured data (assumed to be available in couple 1):
residuals = ySum - couples(1).stimuli(1).yDataForFit(:,iSmad);
Keywords: optimization user function
See also
See also
pwOverwrite
pwOverwrite(trueOrFalse)
If parameters are changed and the trajectories
are replotted, the old trajectories are usually
erased. By setting pwOverwrite(false), they are
kept and the effect of the parameter change can
be investigated visually.
Default: true
pwParseAndShow
pwParseAndShow(show)
Reloads the currently selected models without compilation
and shows their graphs immediately. This is useful if many
changes to a model should be compared interactively with
the model graph.
show = true (default) or false. If false, the model is only parsed.
p If > 0: Will pause for p seconds.
If = 0: No pause
If < 0: The user has to press a key to continue
If unspecified or empty:
p = config.general.pause;
Description
The strength of this pause function is that its duration
can be set in a single item of the PottersWheel configuration.
(This assumes that no argument is passed to pwPause.)
Therefore it is possible to pause a PottersWheel Macro
or a custom Matlab script during developmentat at
several code positions and to switch to uninterrupted batch
processing by simply setting config.general.pause to 0.
See also
pwPlayRingIn
pwPlayRingIn
Plays a "ring in" sound.
Useful if a problem occurs.
Please copy ringin.wav from the
C:\WINDOWS\Media directory into the PW toolbox folder.
Any other wav file renamed to ringin.wav is also fine.
See also
pwPlayTada
pwPlayTada(n)
Plays a "tada" sound.
Useful as a signal after long calculations.
Please copy tada.wav from the
C:\WINDOWS\Media directory into the PW toolbox folder.
Any other wav file renamed to tada.wav is also fine.
n Number of played tadas (Default 1).
See also
pwPle
pwPle
Initializes the estimation of the Profile Likelihood.
See also
pwPleCalculate
pwPleCalculate(iPar, maxNumSteps, relChi2StepIncrease, minStepSize, maxStepSize,
breakOnParLimits, showIterations, thresholdMode, fitBeforePLE,
hSubplot, showLegend)
Profile Likelihood Estimation
iPar i'th parameter, see pwInfo
[if omitted, all free parameters are considered]
maxNumSteps maximum number of steps to sample the profile likelihood
Default: 100
relChi2StepIncrease: percentage chi^2 increase of a step [0.1]
maxStepSize: maximum step size as log10 change
minStepSize: minimum step size as log10 change
breakOnParLimits: stop if a parameter bound has been reached [true]
showIterations If true, the progress of the PL estimation is visualized
Default as specified in config.analyses.PLE.showIterations, usually true
thresholdMode 1: Use relative chi-square threshold for simultaneous confidence level
2: Use relative chi-square threshold for separate confidence levels
3: Use absolute chi-square threshold based on chi-square test
Default as specified in config.analyses.PLE.thresholdMode, usually 1
fitBeforePLE Default given by config.analyses.PLE.fitBeforePLE
hSubplot Handle to a subplot which will be used to plot
the currently estimated profile likelihood.
showLegend If true, a legend is shown. Default: true
See also
See also
See also
pwPleDirectStep
[pStep, dpNew, beta, alpha] = pwPleDirectStep(iPar, pLast, dpLast)
Determines an adaptive step based on a direct step method.
See also
pwPleFit
[pFit, pStd, warningMessages] = pwPleFit(iPar)
Fitting all parameters but fixing iPar.
iPar Parameter which is temporarilly fixed and not fitted.
pFit Fitted parameter values (not on a log-scale)
pStd Estimated standard deviation of the parameters based on the
covariance matrix approach.
warningMessages
All warnings which may have occurred during fitting.
Plots of the Profile Likelihood are marked with red circles
if one or more warnings have been issued.
See also
pwPleInit
pwPleInit(stdAlpha)
Initializes or resets the Profile Likelihood Estimation for PottersWheel.
The function is automatically called when opening the PLE GUI, e.g.
using the command pwPLEgui.
stdAlpha confidence level in units of standard deviation
Default value given in config.analyses.PLE.confLevelInUnitsOfStd,
usually 1 corresponding to a 68% confidence interval.
steppingMode 1 = direct step, 2 = progressive step
Default value given in config.analyses.PLE.steppingMode, usually 1.
Description
0. Adjust default values specified in the configuration.
config.analyses.PLE.*
1. Load the desired model(s) and data-set(s) into PottersWheel and calibrate the
parameters to best possible values. To get an overview about the parameters
incorporated in the model, execute pwInfo at the command line. PLE will
consider all fitted parameters. If necessary, use the command pwFixParameters
to free or fix parameters. Use either integrator 14 (CVODES) with
active Jacobian calculation for integration and optimization or
integrator 1 (RADAU5) with the fast integration scheme (pwFastIntegration(true)).
2. Initialise PLE using pwPleInit or open the PLE GUI using pwPLEgui.
All computed results will be stored in the subfolder PLE-yyyymmddTHHMMSS.
Continue within the GUI or apply the following commands.
3. To estimate the profile likelihood for all free parameters run pwPleCalculate
For a specific parameter run pwPleCalculate(i) where i refers to the number
of the parameter as listed by pwInfo.
Further arguments to pwPleCalculate(i, a, b, c, d, e) are:
a) maximum number of steps in increasing and decreasing direction, default = 100
b) aspired chi-square increase between two sampling steps,
measured in percentage of delta-alpha, default = 0.1
c) minimum step size in %, default = 0.01% of the parameter value
d) maximum step size in %, default = 50% of the parameter value
e) flag to stop the estimation, if the sampled parameter is increased or
decreased above or below its parameter bounds, default = true
4. Execute pwPlePrint to get a summary of the results, including an automatically
generated flag IDflag stating the type of identifiability. LowerPL and UpperPL
indicate likelihood based confidence intervals sigma^{pm, PL}, LowerHes and UpperHes
confidence intervals approximated by the inverse of the Hessian matrix sigma^{pm, Hes}
and Rel.PL and Rel.Hes the relative size of the confidence intervals (sigma^+ - sigma^-)/(2ᅵ
theta_i).
5. Execute pwPlePlot(i) to generate a figure showing the profile likelihood Chi^2_{PL}
PL(theta_i) and the corresponding changes in the other parameters.
6. Execute pwPlePlotMulti to generate a figure showing an overview of all so far
calculated profile likelihoods.
7. Execute pwPlePlotRelations(js) where js is a vector of parameter indices, to
generate a scatterplot of parameters to reveal functional relations. This is most
convenient for two or three indices. One index generates a histogram and if js
is omitted, a matrix plot is produced.
8. Execute pwPleTrajectories(i) to plot trajectories corresponding to parameter
values sampled for the profile likelihood Chi^2_{PL}(theta_i). This depicts model
variability due to uncertainties in this parameter.
Reference
Raue A., Kreutz C., Maiwald T., Bachmann J., Schilling M., Klingmueller U. and Timmer J.
'Structural and practical identifiability analysis of partially observed dynamical
models by exploiting the profile likelihood.'
Bioinformatics, 2009
Implementation within PottersWheel by Andreas Raue and Thomas Maiwald.
See also
pwPlePlot
pwPlePlot(indices, figure_number, plot_std, combine_para_plot)
Plots the profile likelihood
indices Indices of paramters to be plotted
figure_number Either an integer corresponding to a full-size
plot into the corresponding figure or a handle
to an axes. Default: 1
plot_std [false]
combine_para_plot [false]
See also
pwPlePlotRelations
pwPlePlotRelations(iPars, logplot, jResponse)
Generates a scatterplot of parameters to reveal function relations.
Useful for 2 or three parameters. If only one parameter is specified,
a histogram is calculated. An empty indices argument leads to a matrix
plot.
iPars Vector of parameter indices. Default: []
For empty indices ([]), a matrix plot is generated.
logplot Plot logarithmically. Default false.
jResponse Parameter taken as response. Default 0.
If jresponse=0 all indices are considered.
See also
pwPlePrint
pwPlePrint(fid)
Print results of PLE into the command window or a file.
fid file ID [1=Standard Output to Console]
See also
pwPleProgressiveStep
[pStep, dpLast, beta, alpha] = pwPleProgressiveStep(iPar, pLast, dpLast)
Determines an adaptive step based on the curvature of the Chi-Square
function.
See also
pwPleSaveExtremeParameterSets
pwPleSaveExtremeParameterSets(filename)
Saves the extreme parameter sets found by PLE (Profile Likelihood
Estimation) into a Matlab file. When executing the Matlab file,
the parameter values can be retrieved. They can be used to plot
etreme trajectories corresponding to the confidence interval.
Example
pwPlEgui
% Run the PLE manually on all parameters of interest
pwPleSaveExtremeParameterSets('getPars.m');
p = getPars;
[p, pIDs, settingIDs] = getPars; % also yields a description of the setting
% which can be used in a legend
See also
pwPleSearchOptimum
pwPleSearchOptimum(iPars)
Search for better a better optimum, based on down-jumps of the profile likelihood
See also
pwPleTrajectories
pwPleTrajectories(jResponse, plotEvery)
Plot trajectories for the profile likelihood of parameter jResponse.
jResponse Default: 0
plotEvery Default: true
See also
pwPlot
hSubplotsArray = pwPlot
Plots trajectories of the currently combined models.
Plotted are all variables U, X, Y, Z for which the
corresponding toggle buttons are pressed in the main or
equalizer window. (Can also be set in the configuration).
Configuration
See config.plotting for a variety of settings.
Use config.plotting.opacity < 1 to obtain semi-transparent
smoothed curves.
Keywords: Plot
See also
pwPlotExtremeSettings
pwPlotExtremeSettings
Integrates the system for all combinations of low and high parameter
values.
There exist 2^n different combinations for n fitted parameters.
See also
pwPlotMultipleParameterSettings
pwPlotMultipleParameterSettings(ID1, values1, ID2, values2, ...)
Sets the specified parameters given by ID1, ID2, ... successively to
values1(1), values2(1) / ... / values1(end), values2(end)
and integrates and plots the trajectories.
All values vectors are row vectors and must have the same length.
You can also provide a scaling value for a parameter which will be used
for all settings (TODO).
If you have multiple data sets:
Please note that the parameter names refer to the currently combined
models, i.e. use the same name as in the equalizer.
Global parameters will have the same name as in the model,
wherease locally fitted parameters get the suffix _Ci where
i is the number of the combined couple.
If a parameter is not found, the suffix _C1 is assumed.
See also
pwPlottingAddGroup
pwPlottingAddGroup(variableType, variableIDs, iCouple, groupName)
pwPlottingAddGroup(variableType, 'clear', iCouple)
Allows to plot several species into the same subfigure.
variableType string 'a','u','x','y','z'
variableIDs IDs array E.g. {'A', 'B', 'C'}
Use 'clear' as the second argument to
clear all plotting groups for the
selected variableType and couple number.
Use 'basicSpecies' to add a group
for each existing basic species comprising
all involved species.
iCouple int Number of combined couple. Default 1.
groupName string Name for the group, which will be used as
the title when plotting the grouped trajectories.
Description
Adds programmatically a group of variables which will be plotted within
the same subfigure. This can also be done using the equalizer | plotting view.
See also
pwPlottingLoadPlotSettings
pwPlottingLoadPlotSettings(filename, iCouple)
Loads the setting of visible/invisible and grouped species
from a file into a currently combined couple.
filename string M-file with plot settings.
If not specified, a file-opening dialog opens.
iCouple integer Numer of the combined couple whose plot settings
will be overwritten.
Description
The content of the created text can also be copied into a model
definition file, so that all plot settings are already set when
the model is loaded.
See also
filename string M-file where the plot settings will be stored.
If not specified, a file-saving dialog opens.
iCouple integer Numer of the combined couple whose plot settings
will be stored.
Description
The content of the created text can also be copied into a model
definition file, so that all plot settings are already set when
the model is loaded.
See also
pwPlottingSetVisibleIDs
pwPlottingSetVisibleIDs(variableType, variableIDs, iCouple, mode)
pwPlottingSetVisibleIDs(variableType, 'all', iCouple, mode)
Allows to plot only a subset of variables.
variableType string 'a','u','x','y','z'
variableIDs IDs array E.g. {'A', 'B', 'C'}
Use 'all' as the second argument to show or hide all
IDs for the selected variableType and couple number.
iCouple int Number of combined couple. Default 1.
mode string 'show' (default), 'hide'
Description
Use this function to show or to hide a subset of variables programmatically.
The same functionality is available in the equalizer (plotting view).
Only the currently combined couples are affected, i.e. the current assembly.
Each call overwrites the current setting, i.e. in order to
show species A, B, C, the function has to be called as in the
following example.
See also
Description
The set of shown, hidden, or grouped variables can be specified
in the model definition file or interactively in the equalizer.
The interactive settings are lost if new model-data-couples
are combined. Use
pwPlottingStorePlotSettings
in order to store the interactive settings into the model
so that re-combination of model-data-couples lead to the
same plotting settings.
See also
pwPlugInMOTASaveResult
pwPlugInMOTASaveResult(filename)
Saves the current result of the MOTA analysis to harddisk.
If no filename is specified, a save file dialog opens.
Supported are txt and xls files.
pwPropertiesOfDataFile
pwPropertiesOfDataFile(filenames, isfolder)
Displays all experimental data saved in filenames.
Supports several stimuli.
Can be appended to a report.
MCode stimulusDependentView = true;
for dose response experiments supported.
pwQuasiRandomNumbersExtended
Q = pwQuasiRandomNumbersExtended(N, d)
Returns quasi random numbers.
Q(i, j) is the i-th random number for dimension j.
If d is larger than 40, the random numbers are
repeated, i.e. Q(i, 41) = Q(i, 1).
pwReactionToString
s = pwReactionToString(r, width)
Displays a reaction in a simple notation:
Reactants -> Products via Modifiers, Rate signature, Parameters
See also
pwReduceFitHistorySize
pwReduceFitHistorySize(level)
level = 2:
Equivalent to storage level 'only fit information' in the configuration.
level = 1:
Deletes fit information not required to apply a fit sequence
or identifiability analysis.
See also
pwReduceRepositorySize
pwReduceRepositorySize(filename, newFilename, p)
Reduces the size of a repository given by filename
to include only p percent of the best fits.
See also
pwReduceStimuli
pwReduceStimuli(indToRemain)
pwReduceStimuli(uIDs)
Removes all stimuli except for those with index in the vector indToRemain
in the active data sets of all selected couples of the repository list.
If instead of a numeric array of indices a string or string array is supplied,
all stimuli where at least one of the uIDs is non-zero are used.
indToRemain int vector E.g. [1 4 6] if all stimuli except for
stimuli 1, 4, and 6 should be removed.
uIDs string or string vector
See also
pwRegexpRep
s = pwRegexpRep(string, pattern, replace, simplePattern, verbose)
Replaces all occurrences of the pattern in a string using the PottersWheel
convention for simplified regular expressions.
string String to be replaced.
pattern Either a simple PottersWheel regular expression or a valid
regular expression. If no matches are found, the string is
returned unchanged.
replace Simplified replacement string where e.g. "<1>" corresponds to
"<1:...>" in the given pattern and will be converted internally
to "$<T1>" before the replacement is applied by calling regexprep.
simplePattern If true (default), the pattern is assumed to be a PottersWheel
simple regular expression like "Epo_+" which will be converted
automatically to a valid regular expression based on the
PottersWheel naming convention, here
"Epo_([a-z0-9]*[A-Z]+[a-zA-Z0-9]*)".
With simplePattern = false, the pattern is assumed to
be already a valid regular expression and is not converted.
This may be useful if the function pwSimpleToValidRegExp
has already been called for the provided pattern.
verbose If true, the valid regular expression is displayed as a
debugging information. Default: false
Approach
1. Does the pattern match the original string?
If not, the original string is copied directly to the replaced string.
2. The pattern may comprise named groups like "<1:R|pR>", internally "(?<T1>R|pR)",
which matches "R" and "pR" and may be used in the replacement
by "<1>", internally "$<T1>".
3. The original string is replaced based on the potentially converted
pattern using the converted replacement string in the
same fashion as in the Matlab function regexprep.
Example
string: acR_ATP_o_o
pattern: <1:acR|inR>_ATP_<2:o|PTP>_o
converted pattern: ^(?<T1>acR|inR)_ATP_(?<T2>o|PTP)_o$
replacement: <1>_o_<2>_P
converted replacement: $<T1>_o_$<T2>_P
result: acR_o_o_P
% Using the simple pattern approach
result = pwRegexpRep('acR_ATP_o_o', '<1:acR|inR>_ATP_<2:o|PTP>_o', '<1>_o_<2>_P')
% Using the valid regular expression approach
simplePattern = false;
result = pwRegexpRep('acR_ATP_o_o', '^(?<T1>acR|inR)_ATP_(?<T2>o|PTP)_o$', ...
'<1>_o_<2>_P', simplePattern)
See also
See also
pwReload
ok = pwReload(indices, secondModel, arguments)
Reloads models specified by their index in the repository list
or all currently selected models if no indices argument is given.
secondModel Optional path to a second model which will be included
into the original model(s). Default: []
arguments Cell array. See pwAddModel.
ok True, if all models were reloaded successfully.
See also
pwReportAppendComments
pwReportAppendComments
Appends all comments saved in the model definition file of the
currently combined models.
See also
pwReportAppendGraphsAndReactions
pwReportAppendGraphsAndReactions(addGraphs, addReactions)
addGraphs = true or false
addReaction = true or false
Appends graphs and reactions optionally of all combined models.
pwReportAppendGraphsAndReactionsForSubnetworks
pwReportAppendGraphsAndReactionsForSubnetworks(addGraphs, addReactions)
addGraphs = true or false
addReaction = true or false
Appends graphs and reactions of subnetworks of all combined models.
See also
pwReportClear
pwReportClear
Deletes all sections of the current report.
pwReportGUI
pwReportGUI
Opens the PottersWheel Report Designer.
pwReportGenerate
pwReportGenerate(type)
Creates a Latex (default, recommended), MS Word or HTML report.
type: tex, word, or html
See also
pwReportNew
pwReportNew
Starts a new report and creates a report folder where
the report figures will be saved and the report itself.
See also
pwReportOnModelStructure
pwReportOnModelStructure
Creates an extensive report of the structure of
the currently selected model.
If the PottersWheel naming convention is used, a subnetwork
is determined for each basic species. This way, missing or
wrong reactions can be identified more easily.
Latex and Graphviz required.
See also
pwRepositoryBrowser
pwRepositoryBrowser
GUI which allows to navigate through all repository files within one folder.
TODO: Still under construction.
pwReset
pwReset
Sets all fitted parameter values to their initial values.
Please use pwDraw to draw the trajectories.
See also
See also
See also
pwRhsToSignature
[signature, parameters, reactants] = pwRhsToSignature(rhs, kIDs, xIDs, aIDs)
Converts a right-hand-side string into a signature which can be used
in reactions (see pwAddR) or algebraic equations (see pwAddA).
TODO: Support for uIDs.
See also
pwRotate3DFigure
pwRotate3DFigure(nTurns, figures)
Rotates the current figures nTurns times.
nTurns Default 2
figures Number of figures to rotate.
Default: All figures which are in 3D mode.
Keywords: Rotate figure
pwSBML2PW
[result, message] = pwSBML2PW(fileIn, pwFile, showInEditor)
Converts an SBML model given as an xml file or as a converted
Matlab function into a valid PottersWheel model definition file.
fileIn Either an SBML file or a Matlab function that returns
an SBML Matlab struct, e.g. created by the PottersWheel
SBML conversion web service.
SBML supported up to level 3, version 1.
pwFile Name of the PottersWheel model definition file to be created.
File extension should be '.m' since PottersWheel models
are constructed as Matlab functions.
If left empty, the model ID is used: modelID.m
showInEditor If true, opens the created PW model file in the
Matlab text editor. Default: true
result true for a successful conversion
message Reason why conversion was not successful.
Description
Many mathematical models in Systems Biology are expressed as xml
files with a certain structure as defined in the Systems Biology
Markup Language (SBML) standard [1]. Two ways exist to create a
PottersWheel model definition file based on an SBML model:
2. Using the SBML to Matlab conversion service of potterswheel.de
At www.potterswheel.de a web service lets you upload an xml file, e.g.
InsulinModel.xml, for automatic conversion. The result, e.g. InsulinModel.m,
is a Matlab file, namely a Matlab function. It will return the same Matlab
struct as the SBML toolbox when executed. If the Matlab function is saved
on the local harddisk and its path is supplied to pwSBML2PW,
a valid PottersWheel model definition file can be created, either
using the menu button or the command line, e.g.
pwSBML2PW('../SBML/InsulinModel.m', '../Models/InsulinModel_pw.m');
The web service is written in C++ and uses an adaption of the SBML toolbox
based on libSBML. No Matlab is involved, hence no compatibility issues arise.
Notes
The Model ID is limited to 39 characters and will be shortened automatically
if required.
SBML models do not comprise driving inputs, where a variable is given
externally analytically or as a smooth interpolation function.
Instead, inputs are often specified via time-dependent events.
This however dramatically reduces integration speed, since the integrator
has to determine the event (which can not be done by all integrators
anyway). Therefore, it is recommended to manually convert time-dependent
events into PottersWheel driving inputs where this is not yet done
automatically by pwSBML2PW.
References
[1] M. Hucka, S. Hoops, S.M. Keating, N. Le Novère, S. Sahle, and D. Wilkinson
Systems Biology Markup Language (SBML) Level 2:
Structures and Facilities for Model Definitions.
Available from Nature Precedings 2008, http://dx.doi.org/10.1038/npre.2008.2715.1
[2] S.M. Keating, B.J. Bornstein, A. Finney, and M. Hucka
SBMLToolbox: an SBML toolbox for MATLAB users.
Bioinformatics 2006, 22(10):12751277.
[3] B.J. Bornstein, S.M. Keating, A. Jouraku, and M. Hucka
LibSBML: An API Library for SBML.
Bioinformatics 2008, 24(6):880881, doi:10.1093/bioinformatics/btn051.
See also
figures numeric array Handles to all figures to be saved.
If unspecified, all open figures will be saved.
Description
The used image types can be specified in the configuration:
config.plotting.saveFIG
config.plotting.savePNG
config.plotting.savePNGsmall
config.plotting.saveEPS
config.plotting.saveTIFFEPS
config.plotting.saveJPG
config.plotting.savePDF
config.plotting.saveEMF
See also
See also
See also
pwSaveDataSetToFile
pwSaveDataSetToFile(dataSet, model, filename)
Saves a data set either to a text file with
extension *.txt or *.data or to a xls file
with extension *.xls.
dataSet If unspecified, the data set of the current data set of the
highest selected model-data-couple is used
model The model is needed e.g. for the uIDs
filename If no filename is given, a file saving dialog will be shown.
Description
If no Excel COM server is available, *.xls will be saved
with csv format (see xlswrite).
See also
pwSaveDataSets
pwSaveDataSets
Saves the current data set of all selected model-data-couples to hard disk.
The user can enter the file name in a dialog.
Supported are xls and txt files.
See also
pwSaveDynamicalParameters
pwSaveDynamicalParameters(filename, kIDs, k, kMin, kMax)
Save dynamic parameters and fit limits into a valid
Matlab function which can be used within pwAddDynamicalParameters.
If kIDs are empty or not given, the parameters of the currently
highest selected couple are used.
pwSaveFigures
filenames = pwSaveFigures
Saves all primary figures to hard disk.
Description
A primary figure is a figure that displays U, X, Y, or Z, depending
on the current state of the corresponding toggle buttons in
the main or equalizer window.
The figure saving type can be specified in the configuration:
config.plotting.saveFIG
config.plotting.savePNG
config.plotting.savePNGsmall
config.plotting.saveEPS
config.plotting.saveTIFFEPS
config.plotting.saveJPG
config.plotting.savePDF
config.plotting.saveEMF
See also
pwSaveFiguresOfLastStep
pwSaveFiguresOfLastStep(figureTypes)
Saves all figures of the last step, e.g. the last analysis,
to harddisk. The figure type (*.fig, *.eps, *.png, ...)
can either be specified in the configuration dialog or e.g. via
config = pwGetConfig;
config.plotting.savePNG = 1;
config.plotting.saveEPS = 1;
config.plotting.savePDF = 0;
config.plotting.saveJPG = 0;
config.plotting.saveEMF = 0;
config.plotting.saveTIFFEPS = 0; % including TIFF preview for MS Word
pwSetConfig(config);
Or it can be specified as cell array, e.g.
pwSaveFiguresOfLastStep({'png', 'eps'}).
In this case the configuration of PottersWheel is unchanged.
pwGetConfig, pwSetConfig, pwReportAppendLastStep.
pwSaveFiguresToHTML
pwSaveFiguresToHTML(title, hSubplotsArray)
Saves all primary figures into a folder
Plots/HTML
together with an html-page index.html from which
each subplot is accessible from a table.
hSubplotsArray If empty, pwPlot will be called to receive an array
of handles to all subplots.
See also
pwSaveFitsToFile
pwSaveFitsToFile(filename)
Saves the parameters values of the fits of the current analysis
into an xls or txt file.
filename File to store the fits. If unspecified, a dialog opens.
See also
b true (default): during fitting or rotation of 3D figures,
frames are saved to internal variable.
false No frames are saved (saves memory).
See also
pwSaveFramesToAnimatedGif
pwSaveFramesToAnimatedGif(filename, delayTime)
Saves frames of the last fit, rotating 3D figure, etc.
into an animated gif. Works only, if saving of frames
during fitting etc. has been activated:
pwSaveFrames(true)
delayTime = 0.1 seconds by default.
See also
pwSaveFramesToAvi
pwSaveFramesToAnimatedGif(filename)
Saves frames of the last fit, rotating 3D figure, etc.
into an avi movie. Works only, if saving of frames
during fitting etc. has been activated:
pwSaveFrames(true)
See also
pwSaveInstructions
pwSaveInstructions(filename, index)
Save the instructions of the highest selected couple into a
Matlab m file, which can be used by pwAddInstructions.
index: Number of instruction to be saved (default 1).
See also
pwSaveModel
filename = pwSaveModel(model, filename, proposedFilename, openInEditor,
saveExpandedVersion, includeComments)
Saves a model as a valid PottersWheel model definition file.
model If empty ([]), the currently selected model is saved.
If a number, the corresponding model in the repository
list is saved.
Else, a model struct is expected.
filename If filename is not given, a file saving dialog opens.
If the file already exists, PW tries to create a backup file
if config.general.doBackup == true.
The filename without path and extension will be used as the new model ID.
The complete filename will be returned.
includeComments Help comments can be included into the model comprising a short
description and examples for all essential model sections.
openInEditor true by default
See also
pwSaveModelKeepingCustomStructure
pwSaveModelKeepingCustomStructure(m, filename, dataID, classes, commentOut, append)
Saves a model to harddisk by overwriting an existing model definition
file without removing the custom structure, e.g. custom comments.
m A model struct. If unspecified the highest selected model.
filename Filename of an existing model which should be updated.
dataID ID of a data set to store local parameters.
classes Cell array of classes or elements which will be updated
in the given file corresponding to the values in m. If empty,
all supported classes and elements will be updated:
{'A','C','R','S','U','X','Y','Z','modelID','designerPropsM'}
commentOut Comments out objects which do not exist in model m.
Default: false
append If true (=default), objects existing in the model struct which can
not be located are appended.
Set it to false if you work with IDs which are not literal
strings like 'Erk1', but e.g. ['Erk', num2str(1)].
These IDs can not be located automatically and the corresponding
entry must be maintained manually.
See also
pwSaveOriginalDataFile
filename = pwSaveOriginalDataFile(coupleNumber, filename, proposedFilename, openSavedFile)
Saves the original data file of couple coupleNumber to disk.
If no coupleNumber is given, the highest selected couple is used.
If filename is not given, a file saving dialog opens.
The selected filename is returned in all cases.
See also
pwSaveOriginalModel
filename = pwSaveOriginalModel(coupleNumber, filename, proposedFilename, openInEditor)
Saves the original model of couple coupleNumber to disk.
If no coupleNumber is given, the highest selected couple is used.
If filename is not given, a file saving dialog opens.
The selected filename is returned in all cases.
See also
pwSaveParametersIntoModelFile
pwSaveParametersIntoModelFile(commentOut, append)
Stores for all combined model files the current parameter values as
shown in the PottersWheel equalizer into the corresponding model
definition file by replacing all corresponding pwAddK, pwAddX, pwAddS
lines when the ID of the fitted parameter matches the ID used in pwAddK/X/S.
commentOut Default: false
append Default: true
See also
pwSavePlottingData
pwSavePlottingData(types, coupleNr, stimulusNr, filename, openFile)
Save currently plotted data to a text file.
types Cell array with one or more of the fields:
tFine time (high sampled)
xFine dynamic variables
yFine observations
zFine derived variables
uFine driving input functions
or
tForFit time (sampled as specified in model.t for simulations
or as given in the data set)
xForFit dynamic variables
yDataForFit observations (simulated or external)
yDataStdForFit standard deviation of observations
residuals weighted distance between model and observations
yForFit observations calculated by the model
coupleNr Number of the combined couple (default 1)
stimulusNr Number of the stimulus (default 1)
filename Name of the file to save the data. If not given, a dialog will be used.
openFile After saving, the file can automatically be opened to see the data.
See also
pwSaveRepository
pwSaveRepository(filename, showDialog)
Saves the current repository to hard disk.
See also
pwSaveSelectedModelsWithFittedParValues
pwSaveSelectedModelsWithFittedParValues(filenames, toCommandWindow)
Saves all selected models with their current fitted values
to valid model definition files.
filenames Either a string for a single filename
or a cell array for several files.
If no filename is given, a dialog opens for each selected model.
toCommandWindow If true, shows information about k, x0, and s in the
command window.
See also
pwSaveStartValues
pwSaveStartValues(filename, xIDs, x0, x0Min, x0Max)
Save start values and fit limits into a valid
Matlab function which can be used within pwAddStartValues.
If xIDs are empty or not given, the start values of the currently
highest selected couple are used.
pwSaveState
pwSaveState
Saves the current state so that pwUndo will restore
the current state.
Attention: Some functions use internally pwSaveState.
pwUndo will only restore the state when pwSaveState was called
the last time, independent of a user or internal function call.
If you want to be sure that a working state is saved,
then use pwSaveRepository to save it to harddisk and reload it
with pwLoadRepository if neccessary.
See also
pwScale
pwScale
Sets the mean of all observables of all selected couples to 1.
pwScaleAndMergeDataSets
pwScaleAndMergeDataSets(inputFiles, newFile)
1. Select several input files (*.xls, *.txt)
2. Select one output file (*.txt)
3. Select automatically the x and y columns
4. Scale and merge the data
pwScatterPlots
pwScatterPlots(fits)
Opens a user interface where scatter plots from the given fits or
the last fit sequence can be investigated in 1, 2, or 3 dimensions.
Chi-square values are color coded, the start position of each
fit can be visualized, and the parameter values can be shown
in logarithmic or normal space.
See also
pwSearch
pwSearch(word, force)
Displays all PottersWheel functions where the
given word appears in the help text.
The search is applied as in a Goolge search:
not case-sensitive and using whole words.
The search is index-based and therefore very fast.
word Text element to search for.
Optional:
force If true, the files will be re-indexed. Default: false.
Description
An index table is generated when calling pwSearch the first time
for a new PottersWheel version. This index table serves afterwards
to allow quick searching within all PottersWheel help files.
Example
% To find all functions having the word 'fit' in its description,
% independent of upper or lower case spelling:
pwSearch fit
% Shortcut
pws fit
See also
pwSearchInFolder
pwSearchInFolder(token, folder, extension, includeSubfolders, inverse)
Lists all files in a folder which contain a given token.
No indexing of files is used, therefore repetitive usage will
not lead to a decreased search time.
token Case-sensitive string to search for.
folder Folder to search in. By default the current directory (pwd).
extension File extension of files to search in. By default '.m'.
includeSubfolders If true, also subfolders are investigated. Default: false
inverse If true, all files are listed which do NOT contain the token.
Default: false
See also
pwSelect
currentSelection = pwSelect(ind, n)
Selects couples in the repository list.
pwSelect([1 4 5]) selects couples 1, 4, and 5.
pwSelect('last') and pwSelect('all') is also supported.
pwSelect('last', 2) will select the last 2 couples.
See also
pwSelectDataFile
[filename, pathname] = pwSelectDataFile(multiselect, label, openFile, proposedName)
Opens a GUI to let the user open or saving a data file.
multiselect If true, multiple files may be selected at once.
label Title used in the file selection dialog.
openFile If true (default), a dialog to open a file will be shown.
Otherwise, a file saving dialog is used.
proposedName Proposed filename used in the file saving dialog.
filename Cell array of strings if multiple filenames are selected.
A string if a single file has been selected.
0 if the dialog has been cancelled.
pathname 0 if the dialog has been cancelled.
Description
The user may first select to start browsing in the current folder,
'../Data', or the data folder as specified in the configuration.
If the selected file(s) do not belong to these folders,
the user is asked whether the new folder
should be used within the configuration.
Used filter: *.data (ASCII files)
*.txt (ASCII files)
*.xls (Excel files)
pwSelectModelFile
[filename, pathname] = pwSelectModelFile(multiselect, label, openFile, proposedName)
Opens a GUI to let the user open or saving a model file.
multiselect If true, multiple files may be selected at once.
label Title used in the file selection dialog.
openFile If true (default), a dialog to open a file will be shown.
Otherwise, a file saving dialog is used.
proposedName Proposed filename used in the file saving dialog.
filename Cell array of strings if multiple filenames are selected.
A string if a single file has been selected.
0 if the dialog has been cancelled.
pathname 0 if the dialog has been cancelled.
Description
The user may first select to start browsing in the current folder,
'../Models', or the model folder as specified in the configuration.
If the selected file(s) do not belong to these folders,
the user is asked whether the new folder
should be used within the configuration.
Used filter: *.m (Matlab functions saved as ASCII files)
*.txt (ASCII files)
pwSensitivityAddPair
pwSensitivityAddPair(stateVariable, parameter, iCouple)
Adds a variable-parameter pair to the list of existing
variable-parameter pairs in order to display the corresponding
analytical time-dependent sensitivity.
stateVariable ID E.g. Erk
parameter ID E.g. Erk_activation or scale_pErk_obs_C1
iCouple int Number of couple. Currently always 1.
Description
Existing pairs are listed in the 'Sensitivities' view of the equalizer.
Please re-combine or use the equalizer to remove old pairs.
Requires CVODES integrator and the symbolic math toolbox.
Don't forget the suffix _C1 for locally fitted parameters.
Currently, only pairs for the first couple (iCouple=1) are supported.
pwSensitivityAnalysis1D
pwSensitivityAnalysis1D
Applies a 1D sensitivity analysis.
One parameter is changed around an initial value. The model trajectories
for all dynamic variables x, all observables y, and all derived variables z
are plotted (lower row of figures) together with the calculated sensitivity,
which is here the fraction of changed mean concentration to the initial mean
concentration over the whole time span.
See also
pwSensitivityAnalysis2D
pwSensitivityAnalysis2D
Applies a 2D sensitivity analysis.
In contrast to the 1D sensitivity analysis, a set of variables and
parameters can be selected to plot the model trajectories for different
changes of the parameters.
See also
pwSensitivityAnalysis3D
[sensX, sensY, sensZ] = pwSensitivityAnalysis3D(timepoint, reintegrate)
Applies a 3D sensitivity analysis.
sensX(i,j) Sensitivity of x variable i depending on parameter j
sensY y
sensZ z
timepoint Timepoint for which the sensitivity should be calculated.
If empty ([]), the mean value over time is used.
reintegrate If false, the trajectories of the last call to pwSensitivityAnalysis3D
are used to determine the sensitivity, e.g. for another time-point.
Note: The used couples should not be changed.
Default: true
Description
Applies a sensitivity analysis for all variables, observables and derived
variables and for all parameters. For very large models, the user can select
a subset of parameters in a graphical user interface. In contrast to the 1D
and 2D methods, no detailed trajectories are plotted. Sensitivity of a state
variable x_i on a parameter p_j is defined as
s_{ij}(t) = d(x_i(t))/d(p_j) * p_j / x_i(t)
for a certain time point t. Numerical approximation:
s_{ij} = (x_i(1.001 * p_j) - x_i(p_j))/(0.001 * p_j) * p_j / x_i(t)
= (x_i(1.001 * p_j) - x_i(p_j))/0.001 / x_i(t)
The factor 1.001 may be changed in the configuration:
config.analyses.sensitivity.factor
In this analysis, the sensitivity of the averaged concentration
for the integration time is calculated.
Note
The sensitivity of a variable can only be determined if its average
value or the value at the given timepoint is not zero.
Else, the result is a NaN value which is drawn
in 2D-matrix plots with the lowest available color, often dark blue.
Please use the output arguments to check for NaN values.
See also
pwSensitivityAnalysisDetailed
pwSensitivityAnalysisDetailed(targetPlayer, kIDs, xIDs, ...
percentageRecovery, propertiesUsed, withSum)
The sensitivity, i.e. the impact on different characteristics
of the target player depending on changes of the specified
dynamical parameters (kIDs) and initial concentrations (xIDs) is determined.
targetPlayer
kIDs default: 'all'
xIDs default: []
percentageRecovery default: 20
propertiesUsed default: (TODO)
withSum default: true
Description
The sensitivity of a measure f on a parameter p is estimated numerically:
s = (f(1.001 * p) - f(p))/(1.001 * p - p) * p / f
= (f(1.001 * p) - f(p))/0.001 / f
The measure f could be the time of the maximum, the average value
of a dynamic variable x, or the difference of two variables.
The factor 1.001 may be changed in the configuration:
config.analyses.sensitivity.factor
The characteristics are described in
pwCharacteristicsOfSystemResponse
The highest selected model in the repository list is used.
Implementation by Thomas Maiwald and Stefan Hengl.
The result is exported to the Matlab workspace using the variable
['ResultDetailedSensAna_', targetID]
See also
See also
pwSetConfig
pwSetConfig(config)
Sets the current configuration settings to the given config struct.
Please use pwGetConfig to get the current configuration and adapt
all fields as you wish.
Always use this function to update the configuration, because
in new PottersWheel versions the position of some fields may
have changed and pwSetConfig will be aware of the changes.
Fields are named identically as in the configuration dialog.
Example
config = pwGetConfig;
config.optimization.trustregion.maxIter = 100;
config.optimization.trustregion.TolX = 1e-6;
config.optimization.trustregion.TolFun = 1e-6;
pwSetConfig(config);
See also
pwSetCurrentDataSet
pwSetCurrentDataSet(index)
Sets the currently selected data set of the highest selected couple.
See also
pwSetCurrentDrivingFunction
pwSetCurrentDrivingFunction(df, iCouple, jStimulus, kDrivingFunction, combined)
Sets the driving function of couple i, stimulus j, and driving function k to df.
k can also be the ID of a driving input player.
Default values: i=1, j=1, k=1, combined=true
If combined==true (default), the currently combined couples are used.
Else, the currently active instructions (sampling + driving input) of model i
in the repository list is used.
df should have the following fields:
df.ID
.uType % 1 = steps, 2 = linear, 5 = spline (requiring derivatives saved in u2Values)
.uTimes
.uValues
.u2Values
Description
Attention: This function accesses directly an internal variable.
Example
Linear interpolation of several data points for input Epo:
df = [];
df.ID = 'Epo';
df.uType = 2;
df.uTimes = [-1 0 10 20 30 40];
df.uValues = [0 0 1 2 4 8];
df.u2Values = [];
pwSetCurrentDrivingFunction(df, 1, 2, 'Epo');
This sets the Epo driving input of the second stimulus of
the first combined model-data-couple.
See also
pwSetErrorLevel
oldLevel = pwSetErrorLevel(newLevel)
Sets the error level. If errors occur with a lower
error level, no message will be printed and the
program flow will not stop (if possible).
If no new error level is specified, only the current level is returned.
pwSetFitLimitsAroundCurrentValues
pwSetFitLimitsAroundCurrentValues(factor)
Sets the limits of the currently fitted parameters k, x0, and s
around the current values.
factor: If 10 (default), the fit limits will be [par/10 par*10]
In general:
lower limit: par / factor
upper limit: par * factor
Temp. fixed parameters are untouched.
See also
pwSetFitLimitsAroundTrueValues
pwSetFitLimitsAroundTrueValues(factor)
Sets the limits of the currently fitted parameters k, x0, and s
around the true values. This is only possible for simulated data.
factor: If 10 (default), the fit limits will be [parTrue/10 parTrue*10]
In general:
lower limit: parTrue / factor
upper limit: parTrue * factor
Description
Temporarily fixed parameters are untouched.
See also
pwSetFitParameterValuesByID
pwSetFitParameterValuesByID(IDs, values)
Sets the value for all parameters given as IDs
for the currently fitted parameters as given e.g. in the equalizer.
Please note that locally fitted parameters have a suffix _C1, _C2, ...
depending on the couple number in the assembly.
If a parameter ID is not found, the suffix _C1 is tried automatically,
i.e. in an assembly consisting of only one couple, no suffixes are required
(but still recommended).
See also
pwSetFitParsAndIntegrate
pwSetFitParsAndIntegrate(values, IDs)
Shortcut function to set the values of currently fitted parameters
named as in the output of 'pwInfo' with subsequent system integration.
values Numeric array of parameter values.
IDs Cell array of parameter names.
If omitted, all current parameter IDs are used.
See also
pwSetFitSettings
pwSetFitSettings(IDs, setting)
Sets the global, local and fix fit setting for
all parameters given as IDs for all selected couples.
Refers only to the currently selected data set.
IDs string array of xIDs, kIDs, and sIDs
setting string 'fix', 'global', or 'local'
Description
Each initial value x0, dynamic parameter k, or scaling parameter s
can be fixed ('fix') during parameter calibration or fitted
experiment wise ('local') or fitted to the same value for all
experiments ('global').
Usually the fit setting is specified in the model definition file.
This function allows to change the fit setting for a loaded model
without using the graphical user interface "Couples | Fit settings".
See also
See also
pwSetFittedK
m = pwSetFittedK(m, dataID, ID, value, low, high)
Allows to specify an experiment dependent value for a dynamic parameter k.
m Model struct, see pwGetEmptyModel.
dataID Usually the name of the external data file without the path
and the extension, e.g. 'data01'
ID ID of the dynamic parameter
value Value of the parameter for the specific experiment.
low Value corresponding to the lower confidence interval
high Value corresponding to the upper confidence interval
Description
If parameters are locally fitted, they get an experiment-specific value.
In order to store these values into a single model definition file,
the function pwSetFittedK can be used. If the data set with the same
data set ID is added to the model, the correct parameter values are used
automatically.
See also
pwSetFittedS
m = pwSetFittedS(m, dataID, ID, value, low, high)
Allows to specify an experiment dependent value for a scaling parameter s.
m Model struct, see pwGetEmptyModel.
dataID Usually the name of the external data file without the path
and the extension, e.g. 'data01'
ID ID of the scaling parameter
value Value of the parameter for the specific experiment.
low Lower confidence interval
high Upper confidence interval
Description
If parameters are locally fitted, they get an experiment-specific value.
In order to store these values into a single model definition file,
the function pwSetFittedS can be used. If the data set with the same
data set ID is added to the model, the correct parameter values are used
automatically.
See also
pwSetFittedX
m = pwSetFittedX(m, dataID, ID, value, low, high)
Allows to specify an experiment dependent value for a dynamic variable x.
m Model struct, see pwGetEmptyModel.
dataID Usually the name of the external data file without the path
and the extension, e.g. 'data01'
ID ID of the dynamic parameter
value Value of the parameter for the specific experiment.
low Lower confidence interval
high Upper confidence interval
Description
If parameters are locally fitted, they get an experiment-specific value.
In order to store these values into a single model definition file,
the function pwSetFittedX can be used. If the data set with the same
data set ID is added to the model, the correct parameter values are used
automatically.
See also
If fix == true:
IDs: Cell array of parameter IDs which will be fixed during fitting
Also possible: 'all' all parameters (s, x0, k) are fixed
's' all scaling parameters are fixed
'x0' all start values are fixed
'k' all dynamical parameters are fixed
If fix == false:
The opposite behavior as for fix == true.
If showInfo == true information will be shown in the command
line about the currently fixed parameters.
See also
pwSetIntegrationOptions
oldValue = pwSetIntegrationOptions(optionName, newValue)
A set of options can be set for the numerical integration.
Each integrator has its own set of parameters, often these
sets overlap, i.e. most integrators have the option 'MaxStep'.
Within this function you can set the option values. If you
switch to a different integrator where the option is not
available, the specified value will be ignored.
If the oldValue is empty, than the default value has been used before.
Possible values (with default in brackets) for the integrators:
RADAU5 (the default integrator):
RelTol (1e-3): relative tolerance
AbsTol (1e-6): absolute tolerance
eps (1e-16): rounding unit
rho (0.9): safety factors for step size control
StepSizeMinSelection (0.2)
StepSizeMaxSelection (8.0)
parameters for step size selection
StipSizeMinSelection <= tauNew/tauOld <= StepSizeMaxSelection
MaxStep (tEnd-tStart): maximal step size
InitialStep (1e-6): initial step size guess
MaxNumberOfSteps (100000): maximal number of allowed steps
FreezeStepSizeLeftBound (1.0)
FreezeStepSizeRightBound (1.2)
If FreezeStepSizeLeftBound<=tauNeu/tauOld<=FreeStepSizeRightBound,
then the step size is not changed. This saves LU-decompositions
StepSizeStrategy (1)
switch for step size strategy; possible values are 1 and 2
1: mod. predictive controller (Gustaffson)
2: classical step size control
MaxNewtonIterations (7)
the maximal number of Newton iterations for the solution of
the implicit system in each step.
StartNewtonWithZeros (0): flag for starting value for Newton's method.
=0: extrapolated collocation solution is taken as starting value
~=0: zero starting values are used
NewtonStopCriterion (min(0.03,sqrt(RelTol(1)))): stopping criterion for Newtons's method
RecomputeJACFactor (0.001)
decides whether the jacobian should be recomputed.
The higher this value (like 0.1) the less often
the jacobian is evaluated. If evaluation of the jacobian
is cheap, take a smaller value.
If RecomputeJACFactor<0 then the Jacobian is evaluated
after every accepted step.
Other integrators: Under construction (contact support potterswheel.de)
See also
pwSetIntegrationStartTime
pwSetIntegrationStartTime(tStart, forSim)
Sets the integration start time of all selected couples.
This is useful if the system should reach a basal
level before time point 0.
forSim: true or false (default)
If true, the integration start time for simulated data is changed.
Else the integration start time of the current data set is changed.
See also
pwSetIntegrator
pwSetIntegrator(index)
Sets the used integrator to index. Please re-combine afterwards.
To set the maximum integration stepsize, use the following commands:
config = pwGetConfig;
config.integration.opt = [];
config.integration.opt.MaxStep = maxValue; % with e.g. maxValue = 5
pwSetConfig(config);
Fortran
1: RADAU5 (stiff): Implicit Runge-Kutta method of order 5 with dense output
2: RADAU (stiff): Implicit Runge-Kutta method of variable order
Switches automatically between orders 5, 9, and 13
3: SEULEX: Extrapolation method based on linearly implicit Euler
4: DOP853: Explicit Runge-Kutta method of order 8(5,3) with dense output of order 7
5: DOPRI5: Explicit Runge-Kutta method of order 5(4) with dense output of order 4
6: ODEX: Extrapolation method (GBS) with dense output
Matlab
7: ode45
8: ode15s (stiff)
9: ode23
10: ode23s (stiff)
11: ode23t
12: ode23tb
13: ode113
C
14: CVODES (for stiff systems)
References
For details on integrators 1-6 see:
Hairer, Nørsett, Wanner
Solving Ordinary Differential Equations I.
Nonstiff Problems.
Springer Series in Comput. Mathematics, Vol. 8
Springer-Verlag 1987, Second revised edition 1993.
Hairer, Wanner
Solving Ordinary Differential Equations II.
Stiff and Differential-Algebraic Problems.
Springer Series in Comput. Mathematics, Vol. 14
Springer-Verlag 1991, Second revised edition 1996.
For details on integrator 14 see:
https://computation.llnl.gov/casc/sundials/main.html
See also
pwSetLogFitting
pwSetLogFitting(trueOrFalse)
Activates or deactivates fitting in logarithmic parameter space.
This is useful if the minimum and maximum limit of possible
parameter values exceed several orders of magnitude,
e.g. from 0.0001 to 1000. Without logarithmic fitting,
small parameter values are underrepresentated.
See also
See also
pwSetModelSpeciesVisibility
pwSetModelSpeciesVisibility(IDs, type)
Defines the set of visible species for the currently selected
couples. Recombining requird to take effects.
IDs IDs of all species which should be visible
type Either 'x' (default), 'y', 'z', 'u'
See also
pwSetNFine
pwSetNFine(nFine)
Sets the number of samples used for plotting purposes.
In case of fast kinetics or calculations based on the plotted
data, it might be necessary to increase the number of points.
See also
See also
pwSetOptimizationWeights
pwSetOptimizationWeights(formula)
Applies the given formula to all current optimization weights
of the currently combined couples used for fitting.
Description
A weight is usually 1/std, where std is the standard deviation
of the current data point.
A weighted residual is given as
w * (yModel - yMeasurement)
During optimization, the sum over squared weighted residuals is minimized.
The displayed chi-square value is the sum over all squared residuals:
chi^2 = sum((w * (yModel - yMeas))^2)
If constraints are used, the optimized chi^2 value may be different
in order to consider the constraints.
Available variables in the formula:
| w | Current value of the weight of a single data point |
| wArray | Array of weights for the current observable |
| yMeas | Current value of the data point |
| yMeasArray | Array of data point values for the current observable |
Internally, the following line is executed:
w = eval(formula)
for each weight, i.e. all data points.
When couples are combined, the weights are set
to 1/(standard deviation) of each data point (either given
by an analytic error model, estimated by PottersWheel, or
given by the user explicitely in the data file).
Applying this function does not affect the original data and
original standard deviation. By calling
pwCombine, all changes
are lost.
See also
pwSetOptimizer
oldValue = pwSetOptimizer(optimizer, showInfo)
Sets the optimizer. Possible values:
1 or 'linesearch'
2 or 'trustregion'
3 or 'genetic'
4 or 'annealing'
5 or 'smarquardt'
6 or 'ssmlsqnonlin'
7 or 'ssmdn2fb'
Returns the number of the currently used optimizer (before setting
to the new optimizer).
If showInfo == true, information about the changed optimizer
is displayed in the command window. Default = true.
See also
pwSetParameterValuesByID
pwSetParameterValuesByID(IDs, values, forSimulation)
Sets the value for all parameters given as IDs
for all selected couples.
forSimulation true or false
If true: Uses the values for simulation.
If false (default): Refers to the current fit of
the currently selected data set.
See also
pwSetParsForFitToDefaultValues
pwSetParsForFitToDefaultValues
Sets dynamical parameters k to 0.1,
initial values x0 to 1, and
scaling factors s to 1.
Temporary fixed parameters are untouched.
See also
pwSetPlotStartTime
pwSetPlotStartTime(tStart, forSim)
Sets the plot start time of all selected couples.
forSim: true or false (default)
If true, the plot start time for simulated data is changed.
Else the plot start time of the current data set is changed.
pwSetPlottingState
pwSetPlottingState(type, value)
type: x, y, z, u
value: true or false
Activate or deactivates plotting of
input (u)
dynamical variables (x)
observations (y)
derived variables (z)
Description
The user function must comply the following interface:
result = myUserFunction(mode, couples, fast).
Two calling modes are distinguished:
1. Info call
The function should return the number of required figures when
called with mode = 'info'.
nFigures = myUserFunction('info', couples);
This number will be used to arrange the custom figures
properly and to prepare figure saving for the report.
2. Normal call
With mode = 'normal', the function should apply the custom plot.
Output arguments are not required and will be ignored.
myUserFunction('normal', couples, fast, overwrite);
The second argument, couples, is a struct, where
where couples(i).stimuli(j).xForFit(:,k)
will return the trajectory of the k-th dynamic variable of couple i and
stimulus j at all experimentally sampled time points.
Similar, couples(i).stimuli(j).yDataForFit(:,k) contains the observed
values and couples(i).stimuli(j).zForFit(:,k) the derived variables.
For calculations based on the integrated trajectories, e.g. to accurately
determine the maximum of a curve, xFine etc. can be used.
The third argument, fast, will be true if e.g. a slider is changed in the
equalizer or a fitting process is running. Then, the user function should
avoid time-consuming steps like drawing a legend or a title.
Argument four, 'overwrite', is usually set to true. If false,
old trajectories should not be overwritten, which is useful to compare
e.g. different parameter settings in the same figure.
% IDs
couples(i).modelID
couples(i).dataID
couples(i).kIDs
couples(i).sIDs
couples(i).uIDs
couples(i).xIDs
couples(i).yIDs
couples(i).zIDs
couples(i).aIDs
% Parameters and start values
couples(i).k
couples(i).s
couples(i).x0
% Visibility (as set in the equalizer)
couples(i).plotting.visible.a.indices
couples(i).plotting.visible.u.indices
couples(i).plotting.visible.x.indices
couples(i).plotting.visible.y.indices
couples(i).plotting.visible.z.indices
couples(i).plotting.visible.stimuli.indices
% Trajectories for fine sampling (Fine) or experimental sampling (ForFit)
% for each stimulus couples(i).stimuli(j):
tForFit Sampling of experiment
tFine Fine sampling (n may be changed in config.plotting.nFine)
xForFit Dynamic variable x given by model at sampling time points
xFine Dynamic variable x given by model for fine sampling
yForFit Observable y given by model at sampling time points
yDataForFit Externally given data - the measurements
yDataStdForFit Standard deviation of the external data
yFine Observable y given by model for fine sampling
y0 Mean value of external data for first time point
zForFit Derived variable z
zFine
uForFit Driving input u
uFine
u0 Value of driving input u at first time point
Notes
Please do not use the 'figure' command to change
the current figure inside your code. Instead use
set(0,'CurrentFigure', gcf+1);
to switch to the next figure. The first figure will already be selected
by PottersWheel.
If the function is called without arguments, the current
user defined plotting function name is returned.
The name of the plotting function is saved in the configuration at:
config.plotting.userFunction
The function can be changed any time, also without calling pwCombine.
This is different for pwSetOptimizationUserFunction, which has
to be set before pwCombine is called.
Macros
PW_Macro_Custom_Plotting_01
Examples
1. Plot the sum of Erk_obs over all couples:
pwSetPlottingUserFunction(@myUserFunction1)
where myUserFunction1.m reads:
function result = myUserFunction1(mode, couples, fast, overwrite)
result = [];
if strcmpi(mode, 'info')
result = 1; % only one additional figure
return
elseif ~strcmpi(mode, 'normal')
error('Unknown mode: %s', mode)
end
% We assume that all couples have the same number of stimuli
% and that Erk is the 3rd observable (iErk = 3)
for j=1:length(couples(1).stimuli)
ySum = couples(1).stimuli(j).yForFit(:,iErk);
for i=2:length(couples)
ySum = ySum + couples(i).stimuli(j).yForFit(:,iErk);
end
plot(couples(1).tForFit, ySum);
hold on
end
2. Sum plot for x and y over all couples for stimulus 1 and
pay attention to 'fast' and 'overwrite' arguments
function result = pwUserFunctionPlotSum(mode, couples, fast, overwrite)
result = 2;
if strcmp(mode, 'info')
return
elseif ~strcmp(mode, 'normal')
error('Unknown mode: %s', mode);
end
xSum = couples(1).stimuli(1).xForFit;
ySum = couples(1).stimuli(1).yForFit;
for i=2:length(couples)
xSum = xSum + couples(i).stimuli(1).xForFit;
ySum = ySum + couples(i).stimuli(1).yForFit;
end
% Overwrite?
if overwrite == true
hold off
else
hold on
end
% Fast or slow plotting?
if fast == true
plot(couples(1).stimuli(1).tForFit, xSum, '-');
set(0, 'CurrentFigure', gcf+1);
% Overwrite?
if overwrite == true
hold off
else
hold on
end
plot(couples(1).stimuli(1).tForFit, ySum, '-');
else
plot(couples(1).stimuli(1).tForFit, xSum, '.-');
title('Sum for x over all couples')
h = legend(couples(1).xIDs);
set(h, 'Interpreter', 'none');
set(0, 'CurrentFigure', gcf+1);
% Overwrite?
if overwrite == true
hold off
else
hold on
end
plot(couples(1).stimuli(1).tForFit, ySum, '.-');
title('Sum for y over all couples')
h = legend(couples(1).yIDs);
set(h, 'Interpreter', 'none');
end
3. Phase space diagram for x variables 1 and 2
function result = phaseSpace(mode, couples, fast, overwrite)
% Custom function plotting x1 against x2.
%% Return number of created figures if mode == 'info'
result = [];
if strcmpi(mode, 'info')
result = 1; % only one additional figure
return
elseif ~strcmpi(mode, 'normal')
error('Unknown mode: %s', mode)
end
%% Get data
x1 = couples(1).stimuli(1).xFine(:,1);
x2 = couples(1).stimuli(1).xFine(:,2);
%% Overwrite?
if overwrite == true
hold off
else
hold on
end
%% Plot
plot(x1, x2, 'b-');
hold on
plot(x1(1), x2(1), 'ko');
%% Labels
title('Phase space diagram', 'FontSize', 14);
xlabel(couples(1).xIDs{1});
ylabel(couples(1).xIDs{2});
Keywords: set plotting user function
See also
pwSetQRNGIndex
pwSetQRNGIndex(index)
Sets the index of the
quasi random number generator.
Must be >= 1.
See also
pwSetReferencesFile
pwSetReferencesFile(referencesFile)
Specifies a bibtex reference file used for citations.
pwSetResetValues
pwSetResetValues
Uses the current parsForFit values, e.g. as shown in the equalizer,
as reset values. A subsequent call to pwReset will
restore these values.
Calling pwCombine sets the reset values to the values as specified
in the model definition file, i.e. the initial guess.
See also
pwSetStimulusDependentView
pwSetStimulusDependentView(value)
Activates or deactivates a stimulus dependent view
for all current data sets of the selected model-data-couples.
The data has to be marked in the MCode section that stimulus
dependent view is possible:
MCode stimulusDependentView = true;
value = true (default) or false
See also
pwSetStimulusField
oldValues = pwGetStimulusField(iCouple, jStimulus, fieldname)
Returns the old values of a certain field of the specified stimulus
and couple from the repository list before replacing them with the
new given values.
Possible fields:
t
y
yStd
See also
pwSetTimeTransformation
m = pwSetTimeTransformation(m, formula)
Allows to perform a transformation f of time t with
fittable parameters.
m Model struct, see pwGetEmptyModel.
formula String comprising an algebraic expression for the time transformation.
All parameters which are used in f must be added to the model using
pwAddS with usedInTimeTransformation=true.
The only other argument must be 't', the time.
Description
It may be useful to transform the time to correspond a model to a data set,
e.g. if the measured data has an unknown time-shift which varies from
experiment to experiment.
Currently it is not possible to fit with analytic Jacobian for the
optimization using a time-transformed model.
Only tForFit corresponding to the time-points of the experimental data is changed.
Examples
% Add new parameters via pwAddS and set usedInTimeTransformation to true.
% In order to avoid negative parameters include an offset in the formula
% and start with timeshift > 0, e.g. 10:
% m = pwAddS(m, ID, value, fitSetting, minValue, maxValue, unit, name,
% description, usedInTimeTransformation)
m = pwAddS(m, 'timeshift', 10, 'local', 1, 30, [], [], [], true);
% Set the transformation using the same parameter name:
% m = pwSetTimeTransformation(m, formula)
m = pwSetTimeTransformation(m, 't + timeshift - 10');
% To include a scaling in time:
m = pwSetTimeTransformation(m, 'a*t + b');
% Time shift without offset:
m = pwSetTimeTransformation(m, 't + b');
% To remove the time transformation for the model m, e.g. in a daughter model
m = pwSetTimeTransformation(m, []);
See also
pwSetUsedDataSet
pwSetUsedDataSet(number)
A model may be coupled to several data sets.
With this function, the currently used data set
for fitting can be specified for all selected couples.
Alternatively, the 'Data & Fits' dialog may be used.
pwSetX
pwSetX(m, ID, property1, value1, property2, value2, ...)
Sets properties of a dynamic variable x with given ID.
Valid properties are listed in pwAddX.
Description
All properties of an x variable may be specified using pwAddX.
However, the pwAddX function has many arguments which must be
provided in a certain order. Unused arguments are skipped using "[]".
The function pwSetX allows to provide only those arguments which
are of interest. If the given ID is not yet available, a new
x variable is created automatically, making a prior usage of
pwAddX optional.
Please note that the function pwSaveModelKeepingCustomStructure
currently only supports pwAddX and not pwSetX.
Example
m = pwSetX(m, 'R', 'startValue', 5, 'fitSetting', 'fix');
See also
pwSetY
pwSetY(m, rhs, ID, scalingParameter, errorModel, unit, name, description)
Overwrites observation Y given by ID.
See also
pwShortcut
pwShortcut(key)
All shortcuts can also be accessed via commandline with
this function.
pwShowChisqLandscape
chisqMatrix = pwShowChisqLandscape(par1, par2, n1, n2, inLogSpace, factor, ...
limits1, limits2, trajectory)
Calculates the chisq value for n1 * n2 parameter combinations
for parameters par1 and par2 in the given limits.
par1 Number of parameter 1 as listed in the equalizer or with pwInfo.
Can also be an array of parameters.
Can also be 'all' corresponding to an analysis for all parameters.
Can also be 'fitted' corresponding to an analysis for all
fitted parameters.
par2 Number of parameter 2 as listed in the equalizer or with pwInfo.
n1 Number of parameter variations for par1
n2 Number of parameter variations for par2
inLogSpace If true, parameter changes are applied logarithmically.
Default: true
factor If no limits are specified, a factor is used to determine
the limits via:
limits1(1) = valueOfPar1/factor
limits1(2) = valueOfPar1*factor
limits2(1) = valueOfPar2/factor
limits2(2) = valueOfPar2*factor
Default: 100
limits1 Minimum and maximum value for parameter 1
limits2 Minimum and maximum value for parameter 2
pwShowChisqLandscape3D
[chisqCube, par1Values, par2Values, par3Values] = ...
pwShowChisqLandscape3D(par1, par2, par3, n1, n2, n3, inLogSpace, factor, ...
limits1, limits2, limits3, doPlotting)
Calculates the chisq value for n1 * n2 * n3 parameter combinations
for parameters par1 and par2 and par3 in the given limits.
doPlotting: true (default) or false
pariValues are log values if inLogSpace == true
Also possible:
pwShowChisqLandscape3D('all', [], [], n1, n2, n3, ...)
pwShowChisqLandscape3D('fitted', [], [], n1, n2, n3, ...)
pwShowDataFromLibrary
files = pwShowDataFromLibrary
Lists all data sets currently available in the data library.
See also
pwShowFigure
pwShowFigure(type, value)
To display or hide figures for the dynamic variables X,
the observables Y, the derived variables Z, the algebraic
expressions A, or the driving input U.
type: 'x', 'y', 'z', or 'u'
value: true or false
Description
This function is a shortcut for the configuration settings
config = pwGetConfig;
config.plotting.showX = true; % or false
config.plotting.showY = true; % or false
% etc.
pwSetConfig(config);
pwShowFigures
pwShowFigures(n, closeCurrentFigures)
Arranges n figures on the screen.
If n is not given, all current figures are used.
Menu and toolbar and distances to the screen border
can be specified in the configuration, e.g. from command line:
config = pwGetConfig;
config.plotting.menuBar = true;
pwSetConfig(config);
With closeCurrentFigures == true, all current figures are closed.
pwShowFitting
lastState = pwShowFitting(ok)
Enable or disable plots during parameter estimation.
ok If false: Does not show fitting and simulation.
If true (default): Shows fitting and simulation.
lastState Returns the previous value of config.plotting.showFitting
which may be used to reset the value after temporarilly
turning on or off the fitting figures.
Description
This function is a shortcut to set the following settings at once:
config.plotting.showFit
config.plotting.showFitting
config.plotting.showFittingInfo
config.plotting.showIterations
config.plotting.showSimulation
See also
pwShowGraph
pwShowGraph
Shows all selected models as graphs.
pwShowGraphAsPNG
pwShowGraphAsPNG
Shows the currently selected models as exported png files.
Opens the png files only if one model is selected.
Else, all png files are just saved in the current working folder.
pwShowGraphForSubnetwork
pwShowGraphForSubnetwork(basicSpecies)
Displays all reactions related to the given basic species.
Useful when working with large models.
See also
pwShowHelp
pwShowHelp
Opens the PottersWheel main web site.
pwShowLastError
pwShowLastError
Displays the last error and its stack trace.
pwShowModelsFromLibrary
list = pwShowModelsFromLibrary(pattern)
Lists all models currently available in the model library.
A pattern can be specified to list only a subset of models.
The pattern is either a normal string or a regular expression.
The case of the pattern is ignored, i.e. 'NFkB' is the same
as 'nfkb'.
If the output argument 'list' is specified, not output to the command
line is generated. Instead, all filenames are provided in the
user given variable.
See also
pwShowODE
pwShowODE
Shows the ODE of the currently selected models
in the Matlab command window.
pwSim
couples = pwSim(couples, bShowPlots)
Simulates data of all currently selected couples if the are not supplied
directly.
Every couple of couples will be simulated based on current settings:
current instructions, current observation, current k and x0.
pwSimpleToValidRegExp
validPattern = pwSimpleToValidRegExp(simplePattern)
Converts a simple pattern to a valid regular expression.
Description
In PottersWheel rule-based modeling a set of species is represented by
a single pattern, e.g. 'R_@_S' for {'R_o_S', 'R_L_S'}. The pattern
R_@_S
is called a simple pattern, because it is not yet a valid regular
expression but a shortcut provided by PottersWheel to simplify the
creation of models. The function pwSimpleToValidRegExp
converts the simple pattern into a valid regular expression,
in this case to
^R_([a-z0-9]*[A-Z]+[a-zA-Z0-9]*|o)_S$
See also
Modes
mode = 1 (default):
Simulates new data points based on the
original data points plus Gaussian noise
with a standard deviation as defined in the observables.
Repeated call of this function always adds the noise
to the original values (which are backuped internally).
mode = 2 (Monte-Carlo):
The new data is based on the model values plus noise:
yData = yModel + randn(size(yModel)) .* yDataStd;
mode = 3 (Bootstrap):
All data points are drawn with replacement from the set of all available data points.
Note
Negative values are set to 0.
The function only affects the currently combined couples.
Recombination or calling pwRestoreOriginalData restores
the original data.
See also
pwSlide
h = pwSlide(header, body, foot, leftup, leftdown, rightup, rightdown)
Displays a full screen slide with text in the given positions.
Example
h = General_Slide(sprintf('\n\nMathematical Modeling\n\nwith PottersWheel'), ...
[], [], [], [], [], datestr(now, 29));
pwPause
close(h);
See also
pwSortFits
fits = pwSortFits(fits, mode)
Sorts an array of fits depending on the chi-square value
or on the fitting time.
mode 'chisq' (default) or 'time'
pwSplitStimuli
n = pwSplitStimuli
Splits all stimuli of all selected couples into new couples.
n is the number of created new couples, i.e. the number of
found stimuli.
See also
pwStochasticSimulation
[Ts, Ns] = pwStochasticSimulation(x0,n0,k,c,D,L,tf)
Stochastic Gillespie simulation for the highest selected model.
This function is a PottersWheel wrapper for the published Matlab
script of Ullah et al. available at
http://www.sbi.uni-rostock.de/publications/matlab-paper/stoch.m
It can be applied in conjunction with
pwGetStoichiometricMatrix
x0 Column vector of initial concentrations of all involved species
n0 Column Vector of initial populations of all the species involved
k Row vector of rate constants of all elementary reactions
c Row vector of stochastic rate constants of all elementary reactions
D Stoichiometry matrix with rows correspoding to species and columns
corresponding to reaction channels
L Stoichiometry matrix for reactants only such that L = -D.*(D < 0);
tf Final time of simulation
Ts Row vector of time points of reaction events
Ns Matrix of output concentrations with a column for each time point.
Description
[Ts,Ns] = pwStochasticSimulation(x0,n0,k,c,D,L,tf)
performs a stochastic simulation of a biochemical network composed of
M elementary reactions, using the Gillespie algorithm.
[Ts,Ns] = pwStochasticSimulation(x0,n0,k,c,D,L,tf,R)
performs R runs of stochastic simulation. The outputs Ts and Ns are cell
arrays where each cell corresponds to one run.
[Ts,Ns,TT,NBAR] = pwStochasticSimulation(x0,n0,k,c,D,L,tf,R)
where R>1, also returns the ensemble of times in the row vector TT and
the mean of Ns over R runs in matrix NBAR of the size of Ns.
pwStochasticSimulation(x0,n0,k,c,D,L,tf,1)
is the same as
pwStochasticSimulation(x0,n0,k,c,D,L,tf).
Reference
Ullah et al, IEE Proc.-Syst. Biol., Vol. 153, No. 2, March 2006
Deterministic modelling and stochastic simulation of
biochemical pathways using MATLAB
See also
pwSubtractAllY
m = pwSubtractAllY(m)
Subtracts all observations of model m.
See also
pwSubtractK
m = pwSubtractK(m, ID)
Subtracts dynamic parameter K specified by ID of model m.
See also
pwSubtractR
m = pwSubtractR(m, ID)
m = pwSubtractR(m, reactants, products, modifiers, type, options, rateSignature, parameters)
Subtracts reaction specified by ID or detailed argument list of model m.
See also
pwSubtractU
m = pwSubtractU(m, ID)
Subtracts driving input U specified by ID of model m.
See also
pwSubtractX
m = pwSubtractX(m, ID)
Subtracts dynamic variable X specified by ID of model m.
See also
pwSubtractY
m = pwSubtractY(m, ID)
Subtracts observation specified by ID of model m.
See also
pwSubtractZ
m = pwSubtractZ(m, ID, s)
Subtracts derived variables specified by ID of model m.
If no ID is given and s is set to 'all',
all derived variables are removed.
See also
pwThresholdCrossing
timePoints = pwThresholdCrossing(IDs, thresholds)
Returns the first time point where trajectory belonging to IDs
crosses a threshold. Supports multiple IDs and thresholds.
Is applied to the currently highest selected model.
pwTouch
pwTouch
Touches the currently selected models.
This is useful if the model should be
reloaded as if a change was applied.
dfArray: Array of driving functions. May also be a matrix.
surfacePlots: (true by default). If false, normal time-dependent 2D plots are drawn
as during fitting or in the equalizer.
See also
pwTrajectoriesOfManyParameterSettings
[values, labels, K, Kcomplete, IDsComplete] = pwTrajectoriesOfManyParameterSettings(...
K, percentage, selected, IDs, doFit, ...
userFunction, userFunctionArguments,
useSavedTrajectories)
The system will be integrated size(K, 1) times.
The trajectories will be plotted in one figure, so that
the distribution of trajectories is visible.
Arguments
K(i,j) is a parameter matrix of the currently fitted parameters.
i represents the i-th setting of parameter value.
j represents parameter j or to parameter IDs{j} if specified.
Instead of K also an array of fits can be specified. Then, the
percentage argument will be ignored.
If no K and not fits are given, the last fit sequence will be used.
Here, the specified percentage can be used to consider only the best fits.
If the data is fitted, K may change. The changes are available
in the third output argument.
selected: true or false (default)
If true: The selected couples of the repository
list will be used.
If false: All currently combined couples will be used.
doFit: true or false (default)
If true: The model will be fitted for each row of the Kcomplete matrix
and then drawn.
userFunction: Name of a user supplied function with the signature:
[values, labels] = userFunction(couples)
where couples is a struct array with at least the following fields:
couples(i).modelID
.dataID
.xIDs
.yIDs
.zIDs
.uIDs
.stimuli(j).tFine
.stimuli(j).uFine
.stimuli(j).xFine
.stimuli(j).yFine
.stimuli(j).zFine
.stimlui(j).tForFit
.stimlui(j).uForFit
.stimlui(j).xForFit
.stimlui(j).yForFit
.stimlui(j).yDataForFit (fitted data)
.stimlui(j).yDataStdForFit (standard deviations)
.stimlui(j).zForFit
1 <= i <= length(couples)
1 <= j <= length(couples(i).stimuli)
All matrices are of the form time x ID.
values should be a scalar vector of the same length as labels.
userFunctionArguments: Additional arguments for the userFunction as one cell array.
useSavedTrajectories: Instead of a fresh integration of the system, the saved trajectories
from each fit are used. For this,
config.optimization.levelOfHistoryStorage = 3
is required. Use this setting e.g. if integration is time-consuming
and a larger repository file is acceptable.
Example
User function:
function [values, labels] = xMaxValuesFirstCoupleFirstStimulus(couples)
labels = {};
for i=1:length(couples(1).xIDs)
labels{i} = [couples(1).xIDs{i}, ' max'];
end
values = max(couples(1).stimuli(1).xFine);
Keywords: Multi multiple trajectories display
See also
pwTutorial_ODE_based_models
pwTutorial_ODE_based_models
PottersWheel model definition files contain either a reaction network
or a set of ordinary differential equations. In the former case, PottersWheel
determines the differential equations based on the network using
a so-called chemical compiler. In the latter case this step is not
necessary since the user already supplies the ODEs, which provides
a higher flexibility at the expense of several functionalities which
are only available for reaction based models, e.g. visualization and
editing of the model structure with the PottersWheel Model Designer.
pwTutorial_Rule_based_modeling
== Rule-based modeling in PottersWheel 2.1 ==
In rule-based modeling, groups of similar reactions can be formulated
using a single 'rule' which leads to a more compact model formulation.
A rule is a reaction where e.g. the state of some binding sites is not
affecting the reaction rate and can be ignored.
Suppose a receptor R with two binding sites, one for a ligand L and
one for a substrate S. It may have the following conformations,
where 'o' stands for a free binding site and '_' separates the binding sites:
| R_o_o | Unbound receptor |
| R_L_o | Ligand-bound receptor |
| pR_L_o | Ligand-bound phosphorylated receptor |
| pR_L_S | ... bound to a substrate |
| pR_L_pS | ... bound to a phosphorylated substrate |
| pR_o_S | ... bound to a substrate, but ligand-unbound |
| pR_o_pS | ... bound to a phosphorylated substrate, but ligand-unbound |
Phosphorylation of the substrate may be independent of the presence
of the ligand, therefore the following reactions share the same rate:
pR_L_S -> pR_L_pS
pR_o_S -> pR_o_pS
A rule summarizes both reactions by using either a placeholder like '*'
representing all possible binding states or by listing all allowed states
separated by '|' and grouped by angle brackets '<...>', here
pR_@_S
pR_<L|o>_S
This notation is only applied to the reactant, since the product should have
the same state of the not-affecting binding site - with or without the ligand.
Therefore a reference is created in the reactant '<1:...>' and its concrete
value can be reused in the product by inserting '<1>', e.g.
pR_<1:@> -> pR_<1>_pS or
pr_<1:L|o> -> pR_<1>_pS
Suppose a second ligand E which is also able to phosphorylate the receptor:
R_L_o -> pR_L_o
R_E_o -> pR_E_o
These reactions can be formulated using the rule
R_<1:L|E>_o -> pR_<1>_o
Use of '@',
R_<1:@>_o -> pR_<1>_o
would be wrong since this rule also matches the reaction
R_o_o -> pR_o_o
which is not allowed in our example model. In this case the
placeholder '#' can be used, which matches all non-empty binding sites:
R_<1:#>_o -> pR_<1>_o
Requirements
In order to apply rule-based modeling in PottersWheel the following naming
convention must be applied:
- Basic species start with a capital letter [A-Z]
- Modifications of a species are denoted by lowercase prefixes [a-z0-9].
A modification could be a single or double phosphorylation, p and pp
respectively, leading to pR and ppR, or cytoplasmic versus nuclear
proteins, e.g. cS and nS.
- Bindings are denoted using an underscore '_'
Binding sites versus modification states
Modifications can always be formulated using a separate binding site,
e.g. instead of pR one could use R_P (and consequently instead of R one
would use R_o). A specific binding site enables more possibilities to
formulate rules but also leads to longer species IDs, here e.g. R_o
instead of just R.
Changes from PW 2.0
- Use of @ instead of * and # instead of +.
This allows to use PottersWheel patterns within mathematical equations
without interfering with algebraic operators.
- A_@ does not match A or A_B_C, but only A_o, A_B, etc.
To match A and A_@ please use <A|A_@>
- Use of "o" for an empty binding site.
- p|ppA does not match pA and ppA, but is not permitted any more.
Rather use explicitly pA|ppA.
See also
pwTutorial_Using_the_Parallel_Computing_Toolbox
pwTutorial_Using_the_Parallel_Computing_Toolbox
This tutorial exemplifies steps required to run a fit sequence
on a Linux cluster using the Matlab Parallel Computing toolbox
and the Load Sharing Faciltiy LSF.
Basic LSF commands
| bsub | Submit a batch job to the LSF system |
| bkill | Kill a running job |
| bjobs | See the status of jobs in the LSF queue |
| bpeek | Access the output and error files of a job |
| bhist | History of one or more LSF jobs |
| bqueues | Information about LSF batch queues |
Starting PottersWheel including installation
Copy the PottersWheel toolbox into your home folder at the cluster
using a Unix terminal, Cygwin or WinSCP
scp PottersWheel.zip username@server:
Start an X terminal (Cygwin: startx).
Log in:
ssh username@server -XC
Unzip the PottersWheel toolbox:
unzip PottersWheel.2.0.46.zip
Get a list of possible queues for your user account:
bqueues -u username
Start an interactive queue:
bsub -Is -q queueName bash
If no job is dispatched within a few minutes,
you can check for the reason using
bjobs -l
See a list of available Matlab licenses:
lmstat -f MATLAB_Distrib_Comp_Engine
Start Matlab:
matlab -nosplash -nodesktop
In Matlab, go into the toolbox folder and install PW:
cd PottersWheelToolbox
pwInstall
During installation, a warning might appear that the path definition
can not be changed. Then, the file pathdef.m will open in the Matlab
editor. Please save it into your home folder, if you start Matlab from there.
Go into a working directory, start PottersWheel,
load your model and data, and apply a fit
cd Modeling/Project01/WorkingFolder
pw
pwAddModel('M1.m');
pwAddData('Dataset1.txt');
pwCombine;
pwFit;
Alternatively, just use a model from the library
and simulate some data
pwAddModelFromLibrary('M1.m');
pwSim;
pwCombine;
Fit sequence
A fit sequence will be distributed to 20 nodes of the cluster.
Create a job using the distributed computing toolbox
jm = findResource('scheduler', 'type', 'lsf');
set(jm, 'ClusterMatlabRoot', '/opt/matlab');
job = createJob(jm);
set(jm, 'SubmitArguments', '-q queueName'); % Harvard:sysbio_15m,2h,12h,1d,7d,unlimite
Use the job within pwF2:
Syntax: pwF2(nFits, strength, backupMinutes, dataMode, tMax, job, nNodes)
Using e.g. nNodes = 20 and nFits = 100, 5 fits will be run on each node.
pwF2(100, [], [], [], [], job, 20);
pwUndo
pwUndo(pwWindow)
Undoes the last step.
Still under construction!
pwWindow Show PottersWheel main window after undoing the last step. Default: true
See also
See also
pwUpdateModelLibrary
pwUpdateModelLibrary(newModelsFolder, preserveOldLayout)
Walks through all models of the model library and overwrites
existing models with new ones from the newModelsFolder.
If preserveOldLayout is set to true (default: false), the
designer layout information of the old, existing model is
preserved.
Description
If you encounter difficulties with a new PottersWheel
version and an old repository file, try this function
after loading the repository. It refreshes the configuration
settings and forces compilation of all mex files.
Note
This situation should only occur in a major version change,
e.g. from 1.xx to 2.xx. Else, PottersWheel automatically takes care
of modification and required extensions between the old and
new repository structure when the repository is loaded into PottersWheel.
Therefore, repository problems within the same major PottersWheel
version be reported as a bug to the development team.
See also
Description
The equalizer has a reset button which sets all parameters
to their 'reset' value. Usually, this value belongs to the
parameters as given in the model definition file. However, it
may be useful to overwrite the values with the current fitted
parameters what can be done with this function.
The procedure is applied to all currently combined models.
In contrast to pwSetResetValues, re-combination of model-data-couples
does not change the reset values.
See also
Description
PottersWheel distinguishes between settings to simulate data
and settings of an experiments. The term settings comprises
e.g. kind of stimulation, sampling, initial values, and parameter
values. They can be investigated in the IDSO dialog.
See also
pwUseFitOfLastFitSequence
pwUseFitOfLastFitSequence(fitNr)
Sets the current parameter values of the equalizer to the
values of fit 'fitNr' of the last fit sequence.
Integrates and plots the trajectories.
See also
pwUserFunctionFitSum
residuals = pwUserFunctionFitSum(residuals, couples)
User function to fit the sum of the observables over all couples
to the data of couple 1.
Macros
PW_Macro_Custom_Optimization_01
See also
pwUserFunctionPlotSum
result = pwUserFunctionPlotSum(mode, couples, fast, overwrite)
Adds two additional figures where the sum over all couples
for all x and y variables is plotted.
Macros
PW_Macro_Custom_Plotting_01
See also
pwValuesAtTimePoint
[values, labels] = pwValuesAtTimePoint(couples, iCouple, iStimulus, field, t)
Returns values of a couple at a given time point.
iCouple: default all
iStimulus: default all
field: default 'xFine'
t: Time point, default 10
Description
The function can be used to plot the distribution of values
for a family of paramter values after a fit sequence.
See also
pwVersion
v = pwVersion(asString, asNiceString)
Returns the currently installed PottersWheel version
as an integer.
asString: If true, returns a string, e.g. PW-2-0-1
Default: false
asNiceString: If true, returns a long string, e.g. PottersWheel 2.0.1
Default: false
Description
Version 1.5.0 would be encoded as v = 010500 = 10500,
Version 1.5.12 as v = 010512 = 10512
See also
Ignoring comments