-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNottinghamPhageSetup.m
443 lines (386 loc) · 16.2 KB
/
NottinghamPhageSetup.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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
function [initVals, thetaODE] = ...
NottinghamPhageSetup(theta, fixedVals, dataVals, simMode)
% Setup initial values and parameters based on the simMode
%
% function [initVals, thetaODE] = ...
% NottinghamPhageSetup(theta, fixedVals, dataVals, simMode)
%
% initVals - Initial species values for simulations.
% thetaODE - ODE parameters for simulations.
%
% theta - Parameters for the simulation
% fixedVals - Values that are not varied
% dataVals - Initial species numbers
% simMode - Which version of the model to use
% Version Author Date Affiliation
% 1.00 J K Summers 10/06/17 Kreft Lab - School of Biosciences -
% University of Birmingham
% 1.01 J K Summers 24/11/17 Added mode 12 for interconversion of
% sensitive & persistor bacteria & mode
% 13 to have conversion dependent on all
% dead prey
% 1.02 J K Summers 06/12/17 Added modes 22 & 26 to convert only
% on prey killed by phage (22) &
% by bdellovibrio (26)
% 1.03 J K Summers 06/12/17 Added modes 14 & 15
% 1.04 J K Summers 11/12/17 Added mode 16
% 1.05 J K Summers 12/12/17 Added modes 17 & 18
% 1.06 J K Summers 13/12/17 Added modes 19, 20 & 21
% 1.07 J K Summers 14/12/17 Added mode 23
% 1.08 J K Summers 14/12/17 Added mode 25
% 1.09 J K Summers 15/12/17 Added mode 27
% 1.10 J K Summers 03/09/18 Added modes 31 & 32
% 1.11 J K Summers 17/09/18 Added mode 33
% 2.0 J K Summers 04/01/18 Amended for multiple initial species
% numbers & phage mutation rate
% simMode 1
% Full model
% simMode 2
% Simplified model
% simMode 3
% Mixed model
% simMode 6
% As mode 5, but Bdellovibrio now has a Holling type I functional response
% simModes 8, 16, 17 and 18
% As mode 7, but Halophage now has a Holling type I functional response
% simMode 9
% Single prey species - Bd Holling II, phage Holling I
% simMode 10
% As mode 8, but only two prey species
% simModes 11 and 19
% As mode 8, but Bdellovibrio also now has a Holling type I functional
% response
% simMode 12
% As mode 11, but interconversion between sensitive & persister bacteria,
% persisters grow into new persisters and have a maxGrowth that is a
% multipler of the sensitive prey max growth rate
% simModes 23, 24, 25 and 28
% As mode 22, but bdellovibrio is Holling II
% simMode 27
% As mode 16, but allow mortality to vary
% simMode 31
% As mode 27, but resistance can also develop over time
% simMode 32
% As mode 27, but resistance not initially present, but develops over time
% simMode 33
% As mode 27, but phage burst size is fixed
initVals(1) = 0; % Initial substrate
initVals(2) = dataVals(1); % Sensitive bacteria - prey only
if simMode == 1
initVals(1) = theta(1); % Substrate
initVals(2) = theta(2); % Sensitive prey
initVals(3) = theta(3); % Bdellovibrio persistent prey
initVals(4) = theta(4); % Phage resistant prey
initVals(5) = theta(5); % Resistant prey
initVals(6) = theta(6); % Bdellovibrio
initVals(7) = 0; % Bdelloplasts
initVals(8) = theta(7); % Phage
initVals(9) = 0; % Infected cells
elseif (simMode == 2 || simMode == 3)
initVals(3) = theta(1); % Phage resistant bacteria
initVals(4) = dataVals(2); % Bdellovibrio
initVals(5) = 0; % Bdelloplast
initVals(6) = dataVals(3); % Bacteriophage
initVals(7) = 0;
elseif simMode == 9
initVals(3) = dataVals(2); % Prey in Bd predation scenario
initVals(4) = dataVals(3); % Prey in Halophage predation scenario
initVals(5) = dataVals(4); % Prey in dual predation scenario
initVals(6) = dataVals(5); % Bdellovibrio in Bd predation scenario
initVals(7) = dataVals(6); % Bdellovibrio in Dual predation scenario
initVals(8) = 0; % Bdelloplasts
initVals(9) = dataVals(7); % Bacteriophage in Halophage predation scenario
initVals(10) = dataVals(8); % Bacteriophage in dual predation scenario
initVals(11) = 0; % infected cells
elseif simMode == 10
initVals(3) = dataVals(1) * theta(1); % Phage resistant bacteria for prey only
initVals(4) = dataVals(2); % Sensitive prey - Bd predation
initVals(5) = dataVals(2) * theta(1); % Phage resistant bacteria - Bd predation
initVals(6) = dataVals(3); % Sensitive prey - Bd predation
initVals(7) = dataVals(3) * theta(1); % Phage resistant bacteria - phage predation
initVals(8) = dataVals(4); % Sensitive prey - Bd predation
initVals(9) = dataVals(4) * theta(1); % Phage resistant bacteria - dual predation
initVals(10) = dataVals(5); % Bdellovibrio - Bd predation
initVals(11) = dataVals(6); % Bdellovibrio - dual predatio
initVals(12) = 0; % Bdelloplasts
initVals(13) = dataVals(7); % Bacteriophage - phage predation
initVals(14) = dataVals(8); % Bacteriophage - dual predation
initVals(15) = 0; % infected cells
elseif simMode == 34
% Dual resistance
initVals(3) = 0; % Bd persistent prey - Prey only
initVals(4) = dataVals(1) * theta(1); % Phage resistant bacteria - Prey only
initVals(5) = 0; % dual resistant prey - Prey only
initVals(6) = dataVals(2); % Sensitive prey - Bd predation
initVals(7) = 0; % Bd persistent prey - Bd predation
initVals(8) = dataVals(2) * theta(1); % Phage resistant bacteria - Bd predation
initVals(9) = 0; % dual resistant prey - Bd predation
initVals(10) = dataVals(3); % Sensitive prey - Phage predation
initVals(11) = 0; % Bd persistent prey - Phage predation
initVals(12) = dataVals(3) * theta(1); % Phage resistant bacteria - Phage predation
initVals(13) = 0; % dual resistant prey - Bd predation
initVals(14) = dataVals(4); % Sensitive prey - dual predation
initVals(15) = 0; % Bd persistent prey - dual predation
initVals(16) = dataVals(4) * theta(1); % Phage resistant bacteria - dual predation
initVals(17) = 0; % dual resistant prey - dual predation
initVals(18) = dataVals(5); % Bdellovibrio - Bd predation
initVals(19) = dataVals(6); % Bdellovibrio - Dual predation
initVals(20) = 0; % Bdelloplasts
initVals(21) = dataVals(7); % Bacteriophage - Phage predation
initVals(22) = dataVals(8); % Bacteriophage - Dual predation
initVals(23) = 0; % Infected cells
initVals(24) = 0; % Alarmone
else
% Bdellovibrio phenotypic persistence
if simMode == 4
initVals(3) = dataVals(1) * theta(1); % Bd persistent bacteria
initVals(4) = dataVals(1) * theta(2); % Phage resistant bacteria
else
initVals(3) = 0; % Bd persistent prey - Prey only
initVals(5) = dataVals(2); % Sensitive prey - Bd predation
initVals(6) = 0; % Bd persistent prey - Bd predation
initVals(8) = dataVals(3); % Sensitive prey - Phage predation
initVals(9) = 0; % Bd persistent prey - Phage predation
initVals(11) = dataVals(4); % Sensitive prey - dual predation
initVals(12) = 0; % Bd persistent prey - dual predation
if (simMode == 32)
initVals(4) = 0; % Phage resistant bacteria - Prey only
initVals(7) = 0; % Phage resistant prey - Bd predation
initVals(10) = 0; % Phage resistant prey - Phage predation
initVals(13) = 0; % Phage resistant prey - Dual predation
else
initVals(4) = dataVals(1) * theta(1); % Phage resistant bacteria - Prey only
initVals(7) = dataVals(2) * theta(1); % Phage resistant bacteria - Bd predation
initVals(10) = dataVals(3) * theta(1); % Phage resistant bacteria - Phage predation
initVals(13) = dataVals(4) * theta(1); % Phage resistant bacteria - Dual predation
end
end
initVals(14) = dataVals(5); % Bdellovibrio - Bd predation
initVals(15) = dataVals(6); % Bdellovibrio - Dual predation
initVals(16) = 0; % Bdelloplasts
initVals(17) = dataVals(7); % Bacteriophage - Phage predation
initVals(18) = dataVals(8); % Bacteriophage - Dual predation
initVals(19) = 0; % Infected cells
if (simMode == 13 || simMode == 16 || simMode == 17 || ...
simMode == 18 || simMode == 19 || simMode == 20 || ...
simMode == 21 || simMode == 22 || simMode == 23 || ...
simMode == 24 || simMode == 25 || simMode == 26 || ...
simMode == 27 || simMode == 28 || simMode == 31 || ...
simMode == 32 || simMode == 33)
initVals(20) = 0; % Alarmone
end
end
if simMode == 1
thetaODE.muMaxPrey = theta(8);
thetaODE.Ksn = theta(9);
thetaODE.yieldNPerS = theta(10);
thetaODE.muMaxPred1 = theta(11);
thetaODE.Knp = theta(12);
thetaODE.mortality = theta(13);
thetaODE.kP = theta(14);
thetaODE.yieldPPerB = theta(15);
thetaODE.muMaxPred2 = theta(16);
thetaODE.Knv = theta(17);
thetaODE.kV = theta(18);
thetaODE.yieldVPerI = theta(19);
elseif simMode == 9
thetaODE.muMaxPrey = theta(1);
thetaODE.Ksn = theta(2);
thetaODE.yieldNPerS = theta(3);
thetaODE.muMaxPred1 = theta(4);
thetaODE.Knp = theta(5);
thetaODE.yieldPPerB = fixedVals(1);
thetaODE.mortality = fixedVals(2);
thetaODE.kP = theta(6);
thetaODE.muMaxPred2 = theta(7);
thetaODE.kV = theta(8);
thetaODE.yieldVPerI = theta(9);
thetaODE.yieldSPerP = theta(10);
thetaODE.yieldSPerV = theta(11);
else
if simMode == 31
thetaODE.rateDevResistance = theta(2);
elseif (simMode == 29 || simMode == 32)
thetaODE.rateDevResistance = theta(1);
end
if (simMode == 4 || simMode == 12 || simMode == 13 || ...
simMode == 22 || simMode == 23 || simMode == 24 || ...
simMode == 25 || simMode == 26 || simMode == 28 || ...
simMode == 31)
if (simMode == 4 || simMode == 31)
thetaODE.muMaxPrey = theta(3);
else
thetaODE.muMaxPrey = theta(2);
thetaODE.persGrowth = theta(3);
end
thetaODE.Ksn = theta(4);
thetaODE.yieldNPerS = theta(5);
thetaODE.muMaxPred1 = theta(6);
if (simMode == 12 || simMode == 13 || simMode == 22 || ...
simMode == 26)
thetaODE.yieldPPerB = fixedVals(1);
thetaODE.mortality = fixedVals(2);
thetaODE.kP = theta(7);
thetaODE.muMaxPred2 = theta(8);
thetaODE.kV = theta(9);
thetaODE.yieldVPerI = theta(10);
thetaODE.yieldSPerP = theta(11);
thetaODE.yieldSPerV = theta(12);
thetaODE.rateDevPersist = theta(13);
thetaODE.rateRevert = theta(14);
else
thetaODE.Knp = theta(7);
if simMode == 4
thetaODE.mortality = theta(8);
thetaODE.kP = theta(9);
thetaODE.yieldPPerB = theta(10);
thetaODE.muMaxPred2 = theta(11);
thetaODE.Knv = theta(12);
thetaODE.kV = theta(13);
thetaODE.yieldVPerI = theta(14);
thetaODE.yieldSPerP = theta(15);
thetaODE.yieldSPerV = theta(16);
else
thetaODE.yieldPPerB = fixedVals(1);
thetaODE.kP = theta(8);
if simMode == 31
thetaODE.mortality = theta(9);
thetaODE.muMaxPred2 = theta(10);
thetaODE.kV = theta(11);
thetaODE.yieldVPerI = theta(12);
thetaODE.yieldSPerP = theta(13);
thetaODE.yieldSPerV = theta(14);
thetaODE.rateDevPersist = theta(15);
else
thetaODE.mortality = fixedVals(2);
thetaODE.muMaxPred2 = theta(9);
thetaODE.kV = theta(10);
thetaODE.yieldVPerI = theta(11);
thetaODE.yieldSPerP = theta(12);
thetaODE.yieldSPerV = theta(13);
thetaODE.rateDevPersist = theta(14);
thetaODE.rateRevert = theta(15);
thetaODE.rateDevResistance = theta(16);
end
end
end
else
thetaODE.muMaxPrey = theta(2);
if (simMode == 2 || simMode == 6)
thetaODE.yieldNPerS = theta(3);
thetaODE.muMaxPred1 = theta(4);
if simMode == 2
thetaODE.mortality = theta(5);
thetaODE.kP = theta(6);
thetaODE.yieldPPerB = theta(7);
thetaODE.muMaxPred2 = theta(8);
thetaODE.kV = theta(9);
thetaODE.yieldVPerI = theta(10);
thetaODE.yieldSPerP = theta(11);
thetaODE.yieldSPerV = theta(12);
else
thetaODE.kP = theta(5);
thetaODE.yieldPPerB = theta(6);
thetaODE.muMaxPred2 = theta(7);
thetaODE.kV = theta(8);
thetaODE.yieldVPerI = theta(9);
thetaODE.yieldSPerP = theta(10);
thetaODE.yieldSPerV = theta(11);
thetaODE.rateDevPersist = theta(12);
end
else
thetaODE.Ksn = theta(3);
thetaODE.yieldNPerS = theta(4);
thetaODE.muMaxPred1 = theta(5);
if (simMode == 11 || simMode == 15 || simMode == 19 || ...
simMode == 20)
thetaODE.yieldPPerB = fixedVals(1);
thetaODE.mortality = fixedVals(2);
thetaODE.kP = theta(6);
thetaODE.muMaxPred2 = theta(7);
if (simMode == 15 || simMode == 20)
thetaODE.Knv = theta(8);
thetaODE.kV = theta(9);
thetaODE.yieldVPerI = theta(10);
thetaODE.yieldSPerP = theta(11);
thetaODE.yieldSPerV = theta(12);
thetaODE.rateDevPersist = theta(13);
thetaODE.rateDevResistance = theta(14);
else
thetaODE.kV = theta(8);
thetaODE.yieldVPerI = theta(9);
thetaODE.yieldSPerP = theta(10);
thetaODE.yieldSPerV = theta(11);
thetaODE.rateDevPersist = theta(12);
thetaODE.rateDevResistance = theta(13);
end
else
thetaODE.Knp = theta(6);
if (simMode == 3 || simMode == 5)
thetaODE.mortality = theta(7);
thetaODE.kP = theta(8);
thetaODE.yieldPPerB = theta(9);
thetaODE.muMaxPred2 = theta(10);
thetaODE.muMaxPred2 = theta(10);
thetaODE.Knv = theta(11);
thetaODE.kV = theta(12);
thetaODE.yieldVPerI = theta(13);
thetaODE.yieldSPerP = theta(14);
thetaODE.yieldSPerV = theta(15);
if simMode == 5
thetaODE.rateDevPersist = theta(16);
end
elseif (simMode == 27 || simMode == 29 || simMode == 30 ...
|| simMode == 32 || simMode == 33 || simMode == 34)
thetaODE.kP = theta(7);
thetaODE.yieldPPerB = fixedVals(1);
thetaODE.mortality = theta(8);
thetaODE.muMaxPred2 = theta(9);
thetaODE.kV = theta(10);
if simMode == 33
thetaODE.yieldVPerI = fixedVals(3);
thetaODE.yieldSPerP = theta(11);
thetaODE.yieldSPerV = theta(12);
thetaODE.rateDevPersist = theta(13);
else
thetaODE.yieldVPerI = theta(11);
thetaODE.yieldSPerP = theta(12);
thetaODE.yieldSPerV = theta(13);
thetaODE.rateDevPersist = theta(14);
thetaODE.rateDevResistance = theta(15);
end
else
thetaODE.mortality = fixedVals(2);
thetaODE.kP = theta(7);
thetaODE.yieldPPerB = fixedVals(1);
thetaODE.muMaxPred2 = theta(8);
if (simMode == 7 || simMode == 14 || simMode == 21)
thetaODE.Knv = theta(9);
thetaODE.kV = theta(10);
thetaODE.yieldVPerI = theta(11);
thetaODE.yieldSPerP = theta(12);
thetaODE.yieldSPerV = theta(13);
thetaODE.rateDevPersist = theta(14);
thetaODE.rateDevResistance = theta(15);
else
thetaODE.kV = theta(9);
thetaODE.yieldVPerI = theta(10);
thetaODE.yieldSPerP = theta(11);
thetaODE.yieldSPerV = theta(12);
if simMode == 10
thetaODE.rateDevResistance = theta(13);
else
thetaODE.rateDevPersist = theta(13);
thetaODE.rateDevResistance = theta(14);
end
end
end
end
end
end
end
thetaODE.yieldBPerN = 1;
thetaODE.yieldBPerP = 1;
thetaODE.yieldIPerN = 1;
thetaODE.yieldIPerV = 1;
end