-
Notifications
You must be signed in to change notification settings - Fork 0
/
driver_May2024.m
198 lines (158 loc) · 7.98 KB
/
driver_May2024.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
%% driver file for Basophil-T cell-cancer cell model
clear all;
%-- Specify parameters
% cancer cells
params(1,1) = 8.2e-6; % kpT -- fixed; double once in 24 hours
params(2,1) = 3.85e-10; % kdT -- fixed; +CD8 alone: 21.85% death (achieves 21.7%)
% Treg
params(3,1) = 0; % kpTr
params(4,1) = 3e-6; % kdTr -- fixed; basal 41% death when cultured alone for 72h (achieves 40%)
params(5,1) = 5.6e-5; % str_TregDeath: strength of basophil effect on Treg death
% -- fixed; +Baso: 71% death at 72h (achieves 71%)
% CD8 cells
params(6,1) = 1e-9; % kpCD8 -- fixed to balance death
params(7,1) = 3.71e-10; % ksupCD8 -- fixed; +Treg: 0.21% cancer cell death in 72h (achieves 0.23%)
params(8,1) = 2.8e-4; % str_CD8supp strength of basophil effect on inhibiting Treg-mediated CD8 suppression
% -- tuned to achieve 19.2% cancer cell death when considering both basophil-mediated mechanisms
params(9,1) = 1e-9; % kdCD8 -- fixed to exactly balance production
% Basophils
params(10,1) = 25000; % number of basophils
%-- set details
numDays = 2; % 48h beyond D1
tstep = 1000;
stopTime = 24*numDays*3600; %time
maxY = 1e5;
n_diffeqn = 6;
options = odeset('RelTol',1e-12);
%-- initial values
init_cancer = 12500; %cancer cells are added at D1
init_Treg = 6000;
init_CD8 = 25000;
init_Basophil = params(10,1);
initvalue = zeros(n_diffeqn,1);
initvalue(1,1) = init_cancer; %T
%-- solve ODEs
tspan = [0:tstep:stopTime];
[tsim, results_onlycancer] = ode15s(@core_base,tspan,initvalue,options,params);
initvalue(5,1) = init_CD8; %CD8
[tsim, results_cancerCD8] = ode15s(@core_base,tspan,initvalue,options,params);
initvalue(5,1) = init_CD8; %CD8
[tsim, results_cancerCD8Baso] = ode15s(@core_base,tspan,initvalue,options,params);
initvalue(3,1) = init_Treg; %Treg
initvalue(5,1) = init_CD8; %CD8
[tsim, results_noB] = ode15s(@core_base,tspan,initvalue,options,params);
[tsim, results_TregDeath] = ode15s(@core_TregDeath,tspan,initvalue,options,params);
[tsim, results_CD8supp] = ode15s(@core_CD8supp,tspan,initvalue,options,params);
[tsim, results_TregDeath_CD8supp] = ode15s(@core_TregDeath_CD8supp,tspan,initvalue,options,params);
%-- calculate percent cancer cell death
percentages = (1-([results_cancerCD8(end,1);results_cancerCD8Baso(end,1);results_noB(end,1);...
results_TregDeath(end,1);results_CD8supp(end,1);...
results_TregDeath_CD8supp(end,1)]/init_cancer))*100;
cancerCellCount(:,1:6) = [results_cancerCD8(:,1) results_cancerCD8Baso(:,1) results_noB(:,1)...
results_TregDeath(:,1) results_CD8supp(:,1) ...
results_TregDeath_CD8supp(:,1)];
%-- plot results
w = 6; % Linewidth for plotting
tsim = tsim/3600;
figure(1)
plot(tsim,results_onlycancer(:,1),'LineWidth',w,'Color','k')
xlim([0 numDays*24])
xlabel('time (hrs)')
ylabel('number of cancer cells')
title('cancer cells')
set(gca,'FontSize',14,'LineWidth',2);
figure(2);
subplot(1,2,1)
whichSpecies = 1; % cancer cells
plot(tsim,results_onlycancer(:,whichSpecies),'LineWidth',w,'Color','k');
hold on; plot(tsim,results_cancerCD8(:,whichSpecies),'LineWidth',w,'Color',[0.64,0.08,0.18]);
hold on; plot(tsim,results_cancerCD8Baso(:,whichSpecies),'LineWidth',w,'Color',[0 0.8 0.8]);
hold on; plot(tsim,results_noB(:,whichSpecies),'LineWidth',w,'Color',[0.5,0.5,0.5]);
hold on; plot(tsim,results_TregDeath(:,whichSpecies),'LineWidth',w,'Color',[0.49,0.18,0.56]);
hold on; plot(tsim,results_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.07,0.62,1.00]);
hold on; plot(tsim,results_TregDeath_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.47,0.67,0.19]);
hold off;
xlim([0 numDays*24])
xlabel('time (hrs)')
ylabel('number of cancer cells')
legend('cancer cells only', 'cancer,CD8','cancer,CD8,Baso(no effect)','cancer,CD8,Treg',...
'cancer,CD8,Treg,Baso(+Treg death)','cancer,CD8,Treg,Baso(+CD8 supp)',...
'cancer,CD8,Treg,Baso(+Treg death,+CD8 supp)')
title('cancer cells')
set(gca,'FontSize',14,'LineWidth',2);
subplot(1,2,2)
whichSpecies = 5; % CD8 T cells
plot(tsim,results_onlycancer(:,whichSpecies),'LineWidth',w,'Color','k');
hold on; plot(tsim,results_cancerCD8(:,whichSpecies),'LineWidth',w,'Color',[0.64,0.08,0.18]);
hold on; plot(tsim,results_cancerCD8Baso(:,whichSpecies),'LineWidth',w,'Color',[0 0.8 0.8]);
hold on; plot(tsim,results_noB(:,whichSpecies),'LineWidth',w,'Color',[0.5,0.5,0.5]);
hold on; plot(tsim,results_TregDeath(:,whichSpecies),'LineWidth',w,'Color',[0.49,0.18,0.56]);
hold on; plot(tsim,results_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.07,0.62,1.00]);
hold on; plot(tsim,results_TregDeath_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.47,0.67,0.19]);
hold off;
xlim([0 numDays*24])
xlabel('time (hrs)')
ylabel('number of CD8 T cells')
title('CD8')
set(gca,'FontSize',14,'LineWidth',2);
figure(3)
subplot(2,2,1)
whichSpecies = 3; % Treg
plot(tsim,results_onlycancer(:,whichSpecies),'LineWidth',w,'Color','k');
hold on; plot(tsim,results_cancerCD8(:,whichSpecies),'LineWidth',w,'Color',[0.64,0.08,0.18]);
hold on; plot(tsim,results_cancerCD8Baso(:,whichSpecies),'LineWidth',w,'Color',[0 0.8 0.8]);
hold on; plot(tsim,results_noB(:,whichSpecies),'LineWidth',w,'Color',[0.5,0.5,0.5]);
hold on; plot(tsim,results_TregDeath(:,whichSpecies),'LineWidth',w,'Color',[0.49,0.18,0.56]);
hold on; plot(tsim,results_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.07,0.62,1.00]);
hold on; plot(tsim,results_TregDeath_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.47,0.67,0.19]);
hold off;
xlim([0 numDays*24])
xlabel('time (hrs)')
ylabel('number of cells')
title('Treg')
ylim([-500 7500])
set(gca,'FontSize',14,'LineWidth',2);
subplot(2,2,2)
whichSpecies = 5; % CD8 T cells
plot(tsim,results_onlycancer(:,whichSpecies),'LineWidth',w,'Color','k');
hold on; plot(tsim,results_cancerCD8(:,whichSpecies),'LineWidth',w,'Color',[0.64,0.08,0.18]);
hold on; plot(tsim,results_cancerCD8Baso(:,whichSpecies),'LineWidth',w,'Color',[0 0.8 0.8]);
hold on; plot(tsim,results_noB(:,whichSpecies),'LineWidth',w,'Color',[0.5,0.5,0.5]);
hold on; plot(tsim,results_TregDeath(:,whichSpecies),'LineWidth',w,'Color',[0.49,0.18,0.56]);
hold on; plot(tsim,results_TregDeath_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.47,0.67,0.19]);
hold off;
xlim([0 numDays*24])
xlabel('time (hrs)')
ylabel('number of cells')
title('CD8')
set(gca,'FontSize',14,'LineWidth',2);
subplot(2,2,3)
whichSpecies = 4; % dead Treg
plot(tsim,results_onlycancer(:,whichSpecies),'LineWidth',w,'Color','k');
hold on; plot(tsim,results_cancerCD8(:,whichSpecies),'LineWidth',w,'Color',[0.64,0.08,0.18]);
hold on; plot(tsim,results_cancerCD8Baso(:,whichSpecies),'LineWidth',w,'Color',[0 0.8 0.8]);
hold on; plot(tsim,results_noB(:,whichSpecies),'LineWidth',w,'Color',[0.5,0.5,0.5]);
hold on; plot(tsim,results_TregDeath(:,whichSpecies),'LineWidth',w,'Color',[0.49,0.18,0.56]);
hold on; plot(tsim,results_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.07,0.62,1.00]);
hold on; plot(tsim,results_TregDeath_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.47,0.67,0.19]);
hold off;
xlim([0 numDays*24])
xlabel('time (hrs)')
ylabel('number of cells')
title('dead Treg')
set(gca,'FontSize',14,'LineWidth',2);
subplot(2,2,4)
whichSpecies = 6; % dead CD8 T cells
plot(tsim,results_onlycancer(:,whichSpecies),'LineWidth',w,'Color','k');
hold on; plot(tsim,results_cancerCD8(:,whichSpecies),'LineWidth',w,'Color',[0.64,0.08,0.18]);
hold on; plot(tsim,results_cancerCD8Baso(:,whichSpecies),'LineWidth',w,'Color',[0 0.8 0.8]);
hold on; plot(tsim,results_noB(:,whichSpecies),'LineWidth',w,'Color',[0.5,0.5,0.5]);
hold on; plot(tsim,results_TregDeath(:,whichSpecies),'LineWidth',w,'Color',[0.49,0.18,0.56]);
hold on; plot(tsim,results_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.07,0.62,1.00]);
hold on; plot(tsim,results_TregDeath_CD8supp(:,whichSpecies),'LineWidth',w,'Color',[0.47,0.67,0.19]);
hold off;
xlim([0 numDays*24])
xlabel('time (hrs)')
ylabel('number of cells')
title('dead CD8')
set(gca,'FontSize',14,'LineWidth',2);