Usage examples of clocksim software

Table of Contents

./clocksim <modeldir> timecourse <id>
./clocksim <modeldir> evalcost <id>
./clocksim <modeldir> benchmark <id> <iters>
./clocksim <modeldir> create <newid>
./clocksim <modeldir> scan1 <id> <parameter> <steps>
./clocksim <modeldir> scan2 <id> <parameter1> <steps1> <parameter2> <steps2>
./clocksim <modeldir> experiment <id> <experimentid/all> <conditions>
./clocksim <modeldir> experiment_lc <id> <experimentid/all> <conditions> <limcyc_conditions>
./clocksim <modeldir> experiment_param <id> <experimentid/all> <paramchange>
./clocksim <modeldir> anneal <id> <newid> <parmutprob> <iter> <T_begin> <T_end> <mutationsize> [parameters]
./clocksim <modeldir> tempering id newid parmutprob iters swapfreq savefreq T1;T2;... mutationsize [parameters]
./clocksim <modeldir> localopt <id> <newid> <iters> [parameters]
./clocksim <modeldir> localoptslow <id> <newid> <iters> [parameters]
./clocksim <modeldir> randominit <id> <points>
./clocksim <modeldir> optparam <id> <newid> <parameter> <rangefrac>
./clocksim <modeldir> printparameters <id> normalized
./clocksim <modeldir> modifyparameters <id> <newid> 'factor/param operator targetparam[s] [, f/p oper targ...]'
./clocksim <modeldir> refresh <newid>
./clocksim <modeldir> gnuplot <id>
modeldir
specifies what model description to use; this is a directory with the following files: variables, parameters, inputsignals, equations, experiments.
id
the number of the parameter set to load, or 0 to use the default parameter values.
newid
the number of the parameter set to save, or 0 to discard the results of the operation. The parameter sets are stored in modeldir/paramsets/pset.<id>.

Commands

timecourse

./clocksim <modeldir> timecourse <id>

Run all experiments for model defined in modeldir with parameter set id, and output time courses for all variables (and output expressions) to modeldir/tc/<experimentid>

evalcost

./clocksim <modeldir> evalcost <id> <verbose>

Evaluate and print the value of the cost function for parameter set number id.

verbose takes the value 0 or 1, where 1 corresponds to printing cost for every experiment explicitly, rather than just the total in the end.

benchmark

./clocksim <modeldir> benchmark <id> <iters>

Evaluate the cost function iters times and print timing info.

create

./clocksim <modeldir> create <newid>

This creates a new parameter set with the default (id=0) parameter values.

refresh

./clocksim <modeldir> refresh <newid>

Read in parameter file and rewrite it. Useful when removed parameters from the model, then it removes them from the parameter file, and no more warnings about unused parameters.

scan1

./clocksim <modeldir> scan1 <id> <parameter> <steps>

Alter the value of one parameter in steps number of steps, from the minimum to the maximum value (as specified in file modeldir/parameters), and evaluate the cost function at each point. The output is saved in <modeldir>/plot/param.<id>.<parameter>.

example

../src/clocksim . scan1 1 m1 100
../src/clocksim . scan1 3 "p5" 100

scan2

./clocksim <modeldir> scan2 <id> <parameter1> <steps1> <parameter2> <steps2>

Like scan1 but for two parameters, examining the whole surface in steps1 * steps2 points.

experiment

./clocksim <modeldir> experiment <id> <experimentid/all> <conditions>

Generate timecourses for one named experiment or all experiments, with the option to alter input signals to simulate different light conditions, mutants and so forth. Note: the change in input signal is after the limit cycle. The timecourses are saved in the same file(s) as for 'timecourse', i.e. they will overwrite any preexisting file for the same experiment in <modeldir>/tc.

example 1

../src/clocksim . experiment 1 ll "aba_ok 0"

In the first example above the experiment named ll will be run with the inputsignal aba_ok = 0, using parameter set 1 (located in paramsets/pset1).

example 2:

../src/clocksim . experiment 1 all ""

Run all experiments for parameterset 1, without changing the values of the imputsignals defined in the experiments file. I.e. in this case it is the same as running a timecourse ./clocksim . timecourse 1.

experiment_lc

./clocksim <modeldir> experiment_lc <id> <experimentid/all> <conditions> <limcyc_conditions>

Unlike the experiment option, experiment_lc changes the given input signal including the limit cycle, so it will be in right phase.

example

../src/clocksim . experiment_lc 1 ll "elf3_ok 0.25" "elf3_ok 0.25"
../src/clocksim . experiment_lc 1 all "elf3_ok 0.25" "elf3_ok 0.25"

It can almost be considered as a bug that one needs to specify the same thing twice, but they're used in different places (I think?).

experiment_param

./clocksim <modeldir> experiment_param <id> <experimentid/all> <paramchange>

To change one or several parameter values. Either specify experiment id or all, parameters to change, paramchange, are given on the form: "p1 1.0; p2 *1.5; p3 +1"

example

../clocksim . experiment_param 1 all "p1 1.0; p2 *1.5; p3 +1"

Run all experiments with parameter set 1, leaving parameter p1 unchanged, multiplying p2 with 1.5, and adding 1 to the p3 value.

anneal

./clocksim <modeldir> anneal <id> <newid> <parmutprob> <iter> <T_begin> <T_end> <mutationsize> [parameters]

Do a simulated annealing, where parmutprob is the probability to change (mutate) a parameter between the updates, i.e. 0.01 on 100 paamters means mutate on average one parameter. If 0 parameters mutated, then defaults to one. T_begin and T_end are the temperatures used for the annealing (exponential decrease), and iter is number of iterations/Mone Carlo steps.

The mutationsize is by how much to change a parameter from its max/min value as specified in the parameters file, and the last optional arg parameters is a list of parameters to change, if one wants to run a more local annealing. If not specified, it will use all parameters.

The idea is that this algorithm should do a more "global" search. Energy minimum is saved in a subfolder plot/anneal.<newid> where accept/reject, cost, temperature, and step length (distance traveled in parameter space) is logged.

example

./clocksim . anneal 1 11 0.1 100000 0.1 0.001 0.03
for i in 1..4; do ./clocksim . anneal $i 1$i 0.1 100000 0.1 0.001 0.01

tempering

./clocksim <modeldir> tempering <id> <newid> <parmutprob> <iters> <swapfreq> <savefreq> <"T1,T2;..."> <mutationsize> [parameters]

Similar to annealing, but run in parallel. How often to suggest a swap of temperature between the threads are set by swapfreq. Value of 10 means every 10 iteration (MC step) a swap is suggested and evaluated. Value 1 means every iteration.

The savefreq sets how often to save the parameter set, useful when running on computer cluster where the system will shut down the program after some time. savefreq=30 means save every 30 iteration.

Next the program wants a string, "T1,T2,T3…" with the temperatures to run each thread at. Same number of temperatures as threads.

mutationsize and optional paramters works as in annealing.

randominit

./clocksim <modeldir> randominit <newid> <points>

Randomly pick points number of points in parameter space (as spanned by max/min in parameters-file), and save best parameter set as newid.

printparameters

./clocksim <modeldir> printparameters <id> normalized

Print paramset id's values normalized between [0,1] as defined from the min/max in the parameters file.

modifyparameters

./clocksim <modeldir> modifyparameters <id> <newid> 'factor/param operator targetparam[s] [, f/p oper targ...]'

Change the value of specified parameter in specified parameter set.

example

An example of how it was used / why it was implemented (here applied to paramset $i):

./clocksim . modifyparameters $i $i "p4 * r4 r7 r10 r14 r17 r20 r24 r27, p4 / toc1_ox,\
p1 * r3 r40 r41 m37 m38 r32, p27 / f6 f2, p27 * f3 r6 r9 r13 r16 r18 r22 r25, 1 = p4 p1 p27"

localopt

./clocksim <modeldir> localopt <id> <newid> <iters> [parameters]

Optimize the cost function with respect to the parameter values, using a local optimizer that makes use of derivatives of the cost function (GSL's vector_bfgs2). This optimizer is fast but tends to get stuck before it reaches the local optimum.

localoptslow

./clocksim <modeldir> localoptslow <id> <newid> <iters> [parameters]

Like localopt but with the nmsimplex optimizer which is slower but good for really finding the optimum after running localopt.

optparam

./clocksim <modeldir> optparam <id> <newid> <parameter> <rangefrac>

Optimize one parameter locally, within an interval given by the current value +/- rangefrac * (max - min). The interval needs to be specified because GSL's one-dimensional optimizer assumes that the interval contains exactly one optimum, and this is not necessarily true for the whole range between the minimum and maximum values for the parameter.

gnuplot

./clocksim modeldir gnuplot <id>

Generate a gnuplot script for the simulations, and run gnuplot. Currently this only works for ostreococcus and arabidopsis_2012

Created: 2014-06-26 Thu 10:12

Emacs 24.3.91.1 (Org mode 8.2.6)

Validate