Repository navigation
Expand file tree
/
Copy pathexample_02_SolveSSITModels_ODE.m
More file actions
104 lines (80 loc) · 3.89 KB
/
Copy pathexample_02_SolveSSITModels_ODE.m
File metadata and controls
104 lines (80 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
%% SSIT/Examples/example_02_SolveSSITModels_ODE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Section 3.2.1: Finding and visualizing master equation solutions: ODEs
% * Compute Ordinary Differential Equations (ODEs)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Preliminaries
% Use the models from example_01_CreateSSITModels
% clear
% close all
% example_01_CreateSSITModels
% Load the models created in example_1_CreateSSITModels
load('ExampleSaveFiles/example_1_CreateSSITModels.mat')
% View model summaries:
Model.summarizeModel
STL1.summarizeModel
STL1_4state.summarizeModel
% Set the times at which distributions will be computed:
Model.tSpan = linspace(0,50,101);
STL1.tSpan = linspace(0,50,101);
STL1_4state.tSpan = linspace(0,50,101);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Ex(1): Use deterministic, ordinary differential equations (ODEs)
% to average the time evolution of state space probabilities for
% the bursting gene example model from example_1_CreateSSITModels
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Model:
% Solve ODEs:
Model = Model.solve(solver='ODE');
% Plot ODE solutions:
Model.plotODE(speciesNames=Model.species, timeVec=Model.tSpan,...
lineProps={'linewidth',4}, AxisLabelSize=24, TickLabelSize=24,...
Title='Bursting Gene', TitleFontSize=32,...
LegendFontSize=15, LegendLocation='southeast',...
XLabel='Time', YLabel='Molecule Count')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Ex(2): Use deterministic, ordinary differential equations (ODEs)
% to average the time evolution of state space probabilities for
% the time-varying STL1 yeast model from example_1_CreateSSITModels
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% STL1 Model:
% Solve ODEs:
STL1 = STL1.solve(solver='ODE');
% Plot ODE solutions:
STL1.plotODE(speciesNames=STL1.species, timeVec=STL1.tSpan,...
lineProps={'linewidth',4}, Title='STL1', TitleFontSize=32,...
AxisLabelSize=24, TickLabelSize=24,...
LegendFontSize=15, LegendLocation='northwest',...
XLabel='Time', YLabel='Molecule Count')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Ex(3): Use deterministic, ordinary differential equations (ODEs)
% to average the time evolution of state space probabilities for the
% 4-state time-varying STL1 yeast model from example_1_CreateSSITModels
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 4-state STL1 Model:
% Set the ODE integrator (default 'ode23s'):
STL1_4state.odeIntegrator = 'ode23s';
% Solve ODEs:
STL1_4state = STL1_4state.solve(solver='ODE');
% Plot ODE solutions for mRNA:
STL1_4state.plotODE(speciesNames=STL1_4state.species(5),...
timeVec=STL1_4state.tSpan, lineProps={'linewidth',4},...
TitleFontSize=26, Title='4-state STL1 (mRNA)',...
AxisLabelSize=20, TickLabelSize=20, LegendFontSize=20,...
LegendLocation='east', Colors=[0.23,0.67,0.20],...
XLabel='Time (min.)', YLabel='mRNA Count')
% Plot ODE solutions for the four gene states:
STL1_4state.plotODE(speciesNames=STL1_4state.species(1:4),...
timeVec=STL1_4state.tSpan, lineProps={'linewidth',4},...
TitleFontSize=26, Title='4-state STL1 (gene states)',...
AxisLabelSize=20, TickLabelSize=20, LegendFontSize=20,...
LegendLocation='east', XLabel='Time (min.)',YLabel='Gene State')
% Make a movie of the ODE solution being plotted:
% STL1_4state.plotODE(makeMovie=true,...
% videoFileName='STL1_4state_ODE.mp4');
%% Save ODE models & solutions
saveNames = unique({'Model'
'STL1'
'STL1_4state'
});
save('ExampleSaveFiles/example_2_SolveSSITModels_ODE',saveNames{:})