-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathplot_vp.m
236 lines (197 loc) · 4.97 KB
/
plot_vp.m
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
% load data
mw = data_dictionary.mw;
T=T_sample;
% total index
total_vector = 1:n_vp;
%err_index2 = find(state_array(25,1,:)>0)
success_array = setdiff(total_vector,err_vector);
state_array_success = state_array(:,:,[success_array]);
% calculate statistics
% mean_state_array = median(state_array_success,3);
percentile90 = prctile(state_array_success,75,3);
percentile10 = prctile(state_array_success,25,3);
std_state_array = std(state_array_success,[],3);
%lb_state_array = mean_state_array - std_state_array;
min_state_array = min(state_array_success,[],3);
max_state_array = max(state_array_success,[],3);
for species_index = 1:length(data_dictionary.initial_condition)
s.(data_dictionary.species_names(species_index,2)) = mean_state_array(:,species_index);
low.(data_dictionary.species_names(species_index,2)) = percentile10(:,species_index);
high.(data_dictionary.species_names(species_index,2)) = percentile90(:,species_index);
end
figure(1)
set(gcf, 'Position', [100, 100, 1200, 800])
subplot(3,2,1)
ylabel('Viral Load (#)')
xlabel('Days')
hold on
high.V(high.V<=1) = 1;
low.V(low.V<=1) = 1;
patch([T/24;flipud(T/24)]'',[high.V;flipud(low.V)]', 'k','FaceAlpha',0.2)
plot(T/24,low.V,'k','LineStyle','--','LineWidth',2)
plot(T/24,high.V,'k','LineStyle','--','LineWidth',2)
xlim([-5 75])
ax = gca;
ax.FontSize = 16;
set(ax, 'YScale', 'log')
ylim([1e4 1e12])
yticks([1e2 1e4 1e6 1e8 1e10 1e12])
subplot(3,2,2)
ylabel('AT2 (#)')
xlabel('Days')
hold on
patch([T/24;flipud(T/24)]'',[high.AT2;flipud(low.AT2)]', 'k','FaceAlpha',0.2)
plot(T/24,low.AT2,'k','LineStyle','--','LineWidth',2)
plot(T/24,high.AT2,'k','LineStyle','--','LineWidth',2)
xlim([-5 75])
ax = gca;
ax.FontSize = 16;
set(ax, 'YScale', 'linear')
subplot(3,2,3)
ylabel('Infected (#)')
xlabel('Days')
hold on
patch([T/24;flipud(T/24)]'',[high.I;flipud(low.I)]', 'k','FaceAlpha',0.2)
plot(T/24,low.I,'k','LineStyle','--','LineWidth',2)
plot(T/24,high.I,'k','LineStyle','--','LineWidth',2)
xlim([-5 75])
ax = gca;
ax.FontSize = 16;
set(ax, 'YScale', 'linear')
legend('Median Trajectory','80% Interval')
subplot(3,2,4)
plot(T/24, s.AT1,'LineWidth',2,'Color',[0.2422 0.1504 0.6603])
ylabel('AT1 (#)')
xlabel('Days')
hold on
plot(T/24,low.AT1,'k','LineStyle','--','LineWidth',2)
plot(T/24,high.AT1,'k','LineStyle','--','LineWidth',2)
xlim([-5 75])
ax = gca;
ax.FontSize = 16;
set(ax, 'YScale', 'linear')
subplot(3,2,5)
plot(T/24, s.dAT1,'LineWidth',2,'Color',[0.2422 0.1504 0.6603])
ylabel('Damaged AT1 (#)')
xlabel('Days')
hold on
plot(T/24,low.dAT1,'k','LineStyle','--','LineWidth',2)
plot(T/24,high.dAT1,'k','LineStyle','--','LineWidth',2)
xlim([-5 75])
ax = gca;
ax.FontSize = 16;
subplot(3,2,6)
plot(T/24, s.dAT2,'LineWidth',2,'Color',[0.2422 0.1504 0.6603])
ylabel('Damaged AT2 (#)')
xlabel('Days')
hold on
patch([T/24;flipud(T/24)]'',[high.dAT2;flipud(low.dAT2)]', 'k','FaceAlpha',0.2)
plot(T/24,low.dAT2,'k','LineStyle','--','LineWidth',2)
plot(T/24,high.dAT2,'k','LineStyle','--','LineWidth',2)
xlim([-5 75])
ax = gca;
ax.FontSize = 16;
vol_alv_ml = data_dictionary.vol_alv_ml;
vol_plasma = data_dictionary.vol_plasma;
% convert total cell count to #/uL
cell2conclung = 1/vol_alv_ml/1000; % cells --> cells/uL
cell2concplasma = 1/1000; % cells/mL --> cells/uL
billioncellsperL2cellsperuL = 1e9/1e6;
figure(3)
subplot(2,4,1)
hold on
xlim([-5 75])
ylabel('IL6 plasma (pg/mL) ')
xlabel('Days')
hold on
subplot(2,4,2)
ylabel('IFNb plasma (pg/ml)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,3)
hold on
xlim([-5 75])
ylabel('IFNg plasma (pg/ml)')
xlabel('Days')
hold on
subplot(2,4,4)
hold on
ylabel('IL10 plasma (pg/ml)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,5)
hold on
xlim([-5 75])
ylabel('IL6 lung (pg/mL) ')
xlabel('Days')
hold on
subplot(2,4,6)
ylabel('IFNb lung (pg/ml)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,7)
hold on
xlim([-5 75])
ylabel('IFNg lung (pg/ml)')
xlabel('Days')
hold on
subplot(2,4,8)
hold on
ylabel('IL10 lung (pg/ml)')
xlabel('Days')
hold on
xlim([-5 75])
figure(5)
subplot(2,4,1)
hold on
shadedErrorBar(T/24,s.M1_c/1000,'lineprops','k-','transparent',1)
ylabel('pDC plasma (#/\muL)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,2)
hold on
ylabel('N plasma (#/\muL)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,3)
hold on
ylabel('CD4 plasma (#/\muL)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,4)
hold on
ylabel('CTL plasma (#/\muL)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,5)
hold on
shadedErrorBar(T/24,s.M1_c/1000,'lineprops','k-','transparent',1)
ylabel('pDC lung (#/\muL)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,6)
hold on
ylabel('N lung (#/\muL)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,7)
hold on
ylabel('CD4 lung (#/\muL)')
xlabel('Days')
hold on
xlim([-5 75])
subplot(2,4,8)
hold on
ylabel('CTL lung (#/\muL)')
xlabel('Days')
hold on
xlim([-5 75])