Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
SysBiOThe
/
CRA-Matlab
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit fc6b3a69
authored
2019-03-31 21:49:33 +0200
by
Chiara Antonini
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Upload new file
1 parent
8af676c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
0 deletions
CRA_Updated_Version/CRA_Toolbox_bash/main_modelPeng2016.m
CRA_Updated_Version/CRA_Toolbox_bash/main_modelPeng2016.m
0 → 100644
View file @
fc6b3a6
%SCRIPT FOR RUNNING THE CRA TOOLBOX WITHOUT USING THE GUI
%The model is written as a Matlab function.
%%%% THE FIRST THING TO DO FOR RUNNING THE SCRIPT IS TO ADD THE FOLDER
%%%% CLASSES AND THE FOLDER Examples TO THE PATH %%%%
%Parameters to be set by the user are:
% 1-model_name: name of the model in .xml format. A struct is created to
% store the following characteristics of an ODE model: nominal values and
% names of the parameters, initial conditions and names of variables, input
% values.
% 2-stop_time: final time point for the model simulation
% 3-step_size: time interval for the vector of time points
% 4- ode_solver: type of ode_solver for simulating the model (possible
% choices are: ode45, ode15s, ode23t, sundials, stochastic, explicit tau
% and implicit tau
% 5- Nr: number of independent realizations to perform
% 6- LBpi: lower boundary of the Latin Hypercube Sampling for perturbation
% of the model parameter space
% 7- UBpi: upper boundary of the Latin Hypercube Sampling
% 8- Ns: number of samples of the Latin Hypercube (parameters n of the
% lhsdesign function)
% 9- variable_name: variable of the model to set as reference node to be
% measured
% 10- current_func: is the type of evaluation function. Currently, it is
% possible to choose among
% three evaluation functions: area under the curve, maximum value and time
% of maximum for the time behavior of the selected variables. The user can
% also define his evaluation function in a .m file by extending the
% abstract class EvaluationFunction
% 11- tail_size: number of samples to include in the upper and lower tail
% when computing the probability density function of the evaluation
% function
% 12- current_tm: is the method for computing the tails of the pdf of the
% evaluation function. Right now, it is possible to choose between two
% methods: sorted() which sorts the values of the evaluation function and
% selects the first and last samples according to tail_size; tmp_sum()
% computes the tails by selecting the upper and lower quartile. When using
% tmp_sum(), the parameter step_size needs also to be specified. Step_size
% is the step for computing the lower and upper quartile of the pdf in an
% iterative way, i.e. when the upper and lower tails do not have the number of
% samples specified by the user, the threshold is increased of a quantity
% equal to step_size and the calculation of the tails is repeated.
% The user can also define his own method for the tails computation by
% extending the abstract class TailMethod().
% 13- folder: name of the folder to create where the results are saved
tic
;
model_name
=
'model_Peng2016_reduced'
;
stop_time
=
5
;
step_size
=
0.1
;
ode_solver
=
'ode45'
;
%time axis for model simulation
time_axis
=
[
0
:
step_size
:
stop_time
]
'
;
%parameters and initial conditions of the model
nominal_parameters
=
[
0.6391
0.32343
0.1
6.7027
0.1
1.4262
1.0617
2.0964
5.0511
3.0776
1.4596
0.97883
0.73912
0.1
0.35453
0.14414
0.56469
0.40886
0.21382
0.1
0.65031
4.1119
0.4722
];
parameters_name
=
{
'lambda_A'
,
'r_p1'
,
'r_a1'
,
'r_m'
,
'k_CX'
,
'r_p2'
,
'r_a2'
,
'alpha_XD'
,
'pigreco_D'
,
'alpha_DC'
,
'k_RC'
,
'mi_C'
,
'alpha_DR'
,
'pigreco_R'
,
'alpha_IR'
,
'alpha_XR'
,
'mi_R'
,
'alpha_CI'
,
'mi_I'
,
'alpha_DCDR'
,
'mi_D'
,
'pigreco_C'
,
'alpha_DRR'
};
x0
=
[
1
1
0
1
1
1
1
1
1
1
1
1
];
num_observables
=
12
;
observables_name
=
{
'A'
,
'X1'
,
'X2'
,
'D_m'
,
'C2'
,
'R2'
,
'I2'
,
'D_C'
,
'D_R'
,
'C1'
,
'R1'
,
'I1'
};
model
=
struct
(
'name'
,
model_name
,
'odesolver'
,
ode_solver
,
'time'
,
time_axis
,
'stop'
,
stop_time
,
'step'
,
step_size
,
'nominal_parameters'
,
nominal_parameters
,
'parameters_name'
,{
parameters_name
},
'num_observables'
,
num_observables
,
'observables_name'
,{
observables_name
},
'initial_conditions'
,
x0
,
'input'
,
0
,
'total_proteins'
,
0
);
Nr
=
100
;
LBpi
=
0.1
;
UBpi
=
10
;
Ns
=
10000
;
variable_name
=
'C1'
;
current_func
=
Area
();
%current evaluation function
tail_size
=
10
;
%number of samples for the lower and upper tail
step_size
=
0.1
;
%this parameter needs to be defined only when current_tm=tmp_sum(step_size)
current_tm
=
sorted
();
folder
=
'modelPeng2016_results'
;
%model simulation for each sample of the Latin Hypercube
disp
(
'Starting model simulation with perturbed parameters'
);
[
AllResults
,
AllPerturbations
]
=
start_simulation
(
model
,
Nr
,
LBpi
,
UBpi
,
Ns
);
disp
(
'All done! Model simulation completed!'
);
%computation of the MIRI for the chosen evaluation function and model
%variable
disp
(
'Starting computation of the MIRI for each parameter...'
);
try
compute_MIRI
(
model
,
variable_name
,
current_func
,
tail_size
,
current_tm
,
Nr
,
Ns
,
AllResults
,
AllPerturbations
,
folder
)
catch
ME
break
end
%plot and save probability density function of the evaluation function
disp
(
'Plot of the probability density function of the chosen evaluation function'
);
plotpdf_evalfunc
(
folder
,
variable_name
);
%plot and save conditional probability density functions of the parameters
disp
(
'Plot of the parameter probability density functions'
);
plotpdf_param
(
folder
,
variable_name
,
model
,
Nr
);
toc
;
\ No newline at end of file
\ No newline at end of file
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment