-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparameters.cpp
More file actions
760 lines (626 loc) · 26.7 KB
/
Copy pathparameters.cpp
File metadata and controls
760 lines (626 loc) · 26.7 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
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
#include "parameters.h"
#include <cmath>
#include <sstream>
using namespace std;
void parameters::init_param() {
// Resizes the vector for paramteres values
par.resize(N_par, 0.);
// Resizes the vector for paramteres names
names.resize(N_par);
}
parameters::parameters(int takeHyphasmaFile, string parfname) {
// This constructor reads paramteres in Hyphasma format
// Initialize parameters fileds
init_param();
cout << "Reading parameter file " << parfname
<< " in 'Hyphasma' format:" << endl;
hyphasmaParameter hpar;
// Read parameter in Htphasma format
bool done = hpar.wahl(parfname.c_str(), true, true);
if (!done) {
cerr << "Error: Could not load parameters from " << parfname << endl;
} else {
cerr << "Parameter reading is done." << endl;
}
// Transfers the parameters from hyphasma format into Mafalda format
matchFromHyphasma(hpar);
parameter_file_name = parfname;
}
parameters::~parameters() {}
parameters::parameters() {
// This constructor creates a verison of Built-in parameter values
// Initialize parameters fileds "names" and "par"
init_param();
// A
names[AgAmountperFDC] = " Presented Antigen per FDC ";
par[AgAmountperFDC] = 3000;
names[agSaturation] =
" Ag saturation per FDC fragment in units of threshold. 1:constant "
"finding proability ";
par[agSaturation] = 20;
names[Ag_threshold] =
" Threshold Ag-concentration for binding CC (in Mol): ";
par[Ag_threshold] = 1.e-8;
// B
names[Bcell_speed] = " B-Cell Speed (um / hr) ";
par[Bcell_speed] = 7.5;
names[Bcell_stddev] = " deviation of B-cell speed (um/hr.) ";
par[Bcell_stddev] = -1;
names[Bcell_tp] = " B-Cell Persistent Time average (hr.) ";
par[Bcell_tp] = 1.5;
names[Bcell_tp_stddev] = " B-Cell Persistent Time stddev (hr.) ";
par[Bcell_tp_stddev] = 0;
names[BCR_pool] = " Size of initial B-cell receptor pool ";
par[BCR_pool] = 100;
// C
names[c_G1] = " Phase g1 of cell cycle (hr.) ";
par[c_G1] = 2.5;
names[c_S] = " Phase S of cell cycle (hr.) ";
par[c_S] = 1.5;
names[c_G2] = " Phase g2 of cell cycle (hr.) ";
par[c_G2] = 2.5;
names[c_M] = " Phase M of cell cycle (hr.) ";
par[c_M] = 0.5;
names[c_G1_stddev] = " Phase g1 of cell cycle stddev (hr.) ";
par[c_G1_stddev] = 1;
names[c_S_stddev] = " Phase S of cell cycle stddev (hr.) ";
par[c_S_stddev] = 1;
names[c_G2_stddev] = " Phase g2 of cell cycle stddev (hr.) ";
par[c_G2_stddev] = 1;
names[c_M_stddev] = " Phase M of cell cycle stddev (hr.) ";
par[c_M_stddev] = 1;
names[Ccdif_delay_stddev] =
" Standard deviation for delay to differentiation. ";
par[Ccdif_delay_stddev] = 0;
names[chemo_dx] = " Lattice Chemokine Constant (um) ";
par[chemo_dx] = 5;
names[CXCL12crit] =
" Critical CXCL12 concentration for desensitization (mol) ";
par[CXCL12crit] = 0.000000006;
names[CXCL13crit] =
" Critical CXCL13 concentration for desensitization (mol) //(-1 for "
"none)????? ";
par[CXCL13crit] = 8.e-11;
names[CXCL12recrit] =
" Critical CXCL12 concentration for resensitization (mol) ";
par[CXCL12recrit] = 0.000000004;
names[CXCL13recrit] =
" Critical CXCL13 concentration for resensitization (mol) //(-1 for "
"none)????? ";
par[CXCL13recrit] = 6.e-11;
names[chemmax] = " Maximum weigh of chemotaxis ";
par[chemmax] = 10;
names[chemosteep] =
" Steepness of weight reduction with chemokine gradient (mol/l) ";
par[chemosteep] = 1.e+10;
names[chemohalf] = " Chemokine gradient of half weight (l/mol) ";
par[chemohalf] = 2.e-11;
names[collectionFDCperiod] =
" Duration of CC collection of Antigen by serial encounters with FDC "
"(hr.) ";
par[collectionFDCperiod] = 0.7;
names[CB_radius] = " Centroblast radius (um) ";
par[CB_radius] = 2.45;
// D
names[DendriteLength] =
" Length FDC dendrites / dx (number of positions) ";
par[DendriteLength] = 40;
names[dimension] = " Lattice Dimensions ";
par[dimension] = 3;
names[dt] = " Time resolution (hr) ";
par[dt] = 0.002;
names[dx] = " Lattice Constant (um) ";
par[dx] = 5;
names[DeleteAgInFreshCC] = " Retained Ag is deleted in fresh CC ";
par[DeleteAgInFreshCC] = true;
names[difDelay] =
" Delay cell differentiation after TC selection (hr.) ";
par[difDelay] = 6;
// E
names[expMin] = "Conversion of shape space affinity to (1/mol)";
par[expMin] = 5.5;
names[expMax] = "Conversion of shape space affinity to (1/mol)";
par[expMax] = 9.5;
names[eta] = " Exponent of the hamming distance ";
par[eta] = 2;
// G
names[Gamma] = " Width of gaussian affinity weight function ";
par[Gamma] = 2.8;
// I
names[InitialNumberSC] = " Initial Number Stromal cells ";
par[InitialNumberSC] = 300;
names[InitialNumberTC] = " Initial Number T-cells ";
par[InitialNumberTC] = 250;
names[InitialNumberCB] = " Initial Number Centroblasts ";
par[InitialNumberCB] = 0;
names[InitialNumberFDC] = " Initial Number FDCs ";
par[InitialNumberFDC] = 200;
// K
names[kon] = "k_on for building immune complex (1/mol h) ";
par[kon] = 1.e6;
names[koff] = "k_off for dissociation of immune complex (in /s): ";
par[koff] = 0.001;
// L
names[BCR_Length] = " Length of BCRs ";
par[BCR_Length] = 4;
// M
names[macrophage] = "Rate of macrophage transport of dead cells (h):";
par[macrophage] = 6.0;
// names[Memorycell_tp] = " Memory Cell speed (um / hr.) ";
// par[Memorycell_tp] = 0.0125 ;
// names[Memorycell_speed] = " Memory Cell polarity (degrees) ";
// par[Memorycell_speed] = 0.05 ;
// names[Memorycell_tp_stddev] = " Memory Cell polarity (degrees) ";
// par[Memorycell_tp_stddev] = 0 ;
// N
names[Nmax] = " Maximum number of residues in one dimension ";
par[Nmax] = 9;
names[NoMutFounderCells] = " FounderCellsDoNotMutate ";
par[NoMutFounderCells] = false;
names[nDiv] = " Number of divisions of founder cells ";
par[nDiv] = 12;
names[nDiv_stddev] = " stddev of Number of divisions of founder cells ";
par[nDiv_stddev] = 0;
names[nDivinflow] = " Number of divisions of influx Bcells ";
par[nDivinflow] = 6;
Avogadro_constant = 6.02205e+23; // mol^-1, Avogadro number
// P
names[Plasmacell_tp] = " Plasma Cell persistence time (unit) ";
par[Plasmacell_tp] = 0.75;
names[Plasmacell_speed] = " Plasma Cell speed (unit) ";
par[Plasmacell_speed] = 3.0;
names[Plasmacell_tp_stddev] = " Plasma Cell polarity (degrees) ";
par[Plasmacell_tp_stddev] = -1;
names[pMHCdepHill] =
" p-MHC dependent division number Hill (Hill coef. n_P) ";
par[pMHCdepHill] = 2;
names[pMHCdepMin] =
" p-MHC dependent division number Hill (Hill coef. P_Min) ";
par[pMHCdepMin] = 1;
names[pMHCdepMax] =
" p-MHC dependent division number Hill (Hill coef. P_Max) ";
par[pMHCdepMax] = 6;
names[pMHCdepK] =
" p-MHC dependent division number Hill (Hill coef. K_P) ";
par[pMHCdepK] = 9;
names[pmutB4StartMut] =
" Probability of mutation before first 24 hours ";
par[pmutB4StartMut] = 0;
names[pmutAfterStartMut] =
" Probability of mutation after first 24 hours ";
par[pmutAfterStartMut] = 0.5; // 0.5
names[pmutAfterSelection] =
" Probability of mutation after selection (affinity dependant) ";
par[pmutAfterSelection] = 0;
names[pmutAffinityExponent] =
" Affinity dependant mutation upon TC contact (affinity-exponent) ";
par[pmutAffinityExponent] = 1;
names[pDivideAgAssymetric] =
" Probability to divide Ag assymetrically to daughter B-cell ";
par[pDivideAgAssymetric] = 0.72;
names[polarityIndex] = " Assymetric Distribution of Ag ";
par[polarityIndex] = 1.0;
names[pSel] = " Probability to be selected by FDC. ";
par[pSel] =
20; // -->original (1/0.05) ; //#Rechcek, need to fix this
names[pApoCC] = " % Casp3+ LZ cells per hr. used as (apoptosis rate) ";
par[pApoCC] = 0;
names[pApoCB] = " % Casp3+ DZ cells per hr. used as (apoptosis rate) ";
par[pApoCB] = 0;
names[p_dif] = " Differentiation rate ";
// R
names[radius] = " Lattice Radius (um) ";
par[radius] = 160;
names[rateCBinflow] = " rate of inflow (cells/hr.) ";
par[rateCBinflow] = 2.0;
// S
names[smoothnessStopCBinflow] =
" smoothness of stop inflow CB (hr.) (-1 = no) ";
par[smoothnessStopCBinflow] = 6;
names[StartMutation] = " Start of mutation period (hr.) ";
par[StartMutation] = 24;
// T
names[timeStopCBinflow] = " time to stop inflow CB (hr.) ";
par[timeStopCBinflow] = 96.0;
names[Tcell_speed] = " T-Cell Speed (um / hr.) ";
par[Tcell_speed] = 10;
names[Tcell_tp] = " T-Cell Persistent Time average (hr.) ";
par[Tcell_tp] = 1.7; // hour
names[Tcell_stddev] = " deviation of T-cell speed (um/sec) ";
par[Tcell_stddev] = -1;
names[Tcell_tp_stddev] = " T-Cell Persistent Time stddev (hr.) ";
par[Tcell_tp_stddev] = 0;
names[tcTime] = " Duration of CC-Tc contact (hr.) ";
par[tcTime] = 0.6; // hour
names[tcRescueTime] =
" Minimum duration of TC-CC-polarization for CC-rescue (hr.) ";
par[tcRescueTime] = 0.5; // hour 0.5
names[testDelay] = " Time gap between TFHC-CC binding tests (hr.) ";
par[testDelay] = 0.02; // Unit?
names[tmax] = " Maximum duration of GC simulation (hr.) ";
par[tmax] = 504;
names[tolight] = " Rate for differentiation of centroblasts to centrocytes ";
par[tolight] = 0.1; // in hours, #temporary, check hyphasma
// W
par[widthPI] = 0.04;
names[widthPI] = " Coefficient of variation arround Polarity Index ";
// Z
par[zoneRatioGC] = 0.5;
names[zoneRatioGC] =
" Ratio that determines the position of DZ in Germinal Center ";
}
void parameters::writeparameters(string fname) {
ofstream myfile;
myfile.open(fname);
if (!myfile) cerr << "ERROR! My parameter file empty";
myfile << print();
myfile.close();
}
//Elena: Reads a file that has first line with parameter name second with value. For future extension.
bool parameters::readparameters(string fname) {
// danial: This needs to be fixed, in different versions there are different
// types of reading parameters. This is not probabily compatible with current
// code.
//Elena: this is only necesary to read from a hyphasma file
// ifstream myfile;
// myfile.open(fname);
// if (myfile.is_open()) {
// string nameLine; // parameter mame in imput file
// int count = 0; // Counter for while loop
// while ((count < 1000000) && (getline(myfile, nameLine))) {
// double value = NAN; // If value not found in names, parameter value
// will
// // have NAN. Create an error mesage!
// myfile >> value; // Open myfil and take value
// bool found = false; // Check if nameLine (parameter of input file)
// was
// // found twice or not found
// for (unsigned int i = 0; i < names.size(); i++) {
// if (nameLine.compare(names[i]) == 0) // Compare name with nameline;
// // returns 0 if the strings
// are
// // identical.
// {
// // cerr << " reads " << nameLine << " value " << value << endl;
// par[i] = value;
// if (found) cerr << nameLine << "found 2 times or more" << endl;
// found = true;
// }
// }
// if (!found) cerr << nameLine << " not found" << endl;
// getline(myfile, nameLine); // to finish line
// }
//
// for (unsigned int i = 0; i < par.size(); i++) {
// if (isnan(par[i])) {
// cerr << "ERROR! Parameter missing in imput file" << i
// << " name:" << names[i] << endl;
// }
// }
// myfile.close();
// if (count >= 1000000) {
// cerr << "infinite loop" << endl;
// } else {
// return true;
// }
//
// } else
// cerr << "ERROR! Unable to open file " << fname << endl;
return false;
}
string parameters::print() {
// This function returns a string that includes all parameters with their
// values.
stringstream res;
for (int i = 0; i < (N_par - 1); i++) {
res << names[i] << endl;
res << par[i] << endl;
}
return res.str();
}
void parameters::matchFromHyphasma(hyphasmaParameter &hypar) {
/**
- Parameter : This function is written to put paramters from hyphasma
parameter file to built-in parameter fields
**/
// A
names[AgAmountperFDC] = " Presented Antigen per FDC ";
par[AgAmountperFDC] = hypar.Value.ag_per_FDC;
names[agSaturation] =
" Ag saturation per FDC fragment in units of threshold. 1:constant "
"finding proability ";
par[agSaturation] = hypar.Value.ag_saturation_FDC;
names[Ag_threshold] =
" Threshold Ag-concentration for binding CC (in Mol): ";
par[Ag_threshold] = hypar.Value.ag_threshold;
// B
names[Bcell_speed] = " B-Cell Speed (um / hr) ";
par[Bcell_speed] = hypar.Value.v_CB;
names[Bcell_stddev] = " deviation of B-cell speed (um/hr.) ";
par[Bcell_stddev] = hypar.Value.v_CB_width;
names[Bcell_tp] = " B-Cell Persistent Time average (hr.) ";
par[Bcell_tp] = hypar.Value.CB_persistence;
names[Bcell_tp_stddev] = " B-Cell Persistent Time stddev (hr.) ";
par[Bcell_tp_stddev] = 0;
names[BCR_pool] = " Size of initial B-cell receptor pool ";
par[BCR_pool] = hypar.Value.totalBss;
// C
names[c_G1] = " Phase g1 of cell cycle (hr.) ";
par[c_G1] = hypar.Value.CB_dt_G1;
names[c_S] = " Phase S of cell cycle (hr.) ";
par[c_S] = hypar.Value.CB_dt_S;
names[c_G2] = " Phase g2 of cell cycle (hr.) ";
par[c_G2] = hypar.Value.CB_dt_G2;
names[c_M] = " Phase M of cell cycle (hr.) ";
par[c_M] = hypar.Value.CB_dt_M;
names[c_G1_stddev] = " Phase g1 of cell cycle stddev (hr.) ";
par[c_G1_stddev] = hypar.Value.CB_dtphase_width;
names[c_S_stddev] = " Phase S of cell cycle stddev (hr.) ";
par[c_S_stddev] = hypar.Value.CB_dtphase_width;
names[c_G2_stddev] = " Phase g2 of cell cycle stddev (hr.) ";
par[c_G2_stddev] = hypar.Value.CB_dtphase_width;
names[c_M_stddev] = " Phase M of cell cycle stddev (hr.) ";
par[c_M_stddev] = hypar.Value.CB_dtphase_width;
names[Ccdif_delay_stddev] =
" Standard deviation for delay to differentiation. ";
par[Ccdif_delay_stddev] = 0;
names[chemo_dx] = " Lattice Chemokine Constant (um) ";
par[chemo_dx] = hypar.Value.dx_signal;
names[CXCL12crit] =
" Critical CXCL12 concentration for desensitization (mol) ";
par[CXCL12crit] = hypar.Value.CXCL12crit;
names[CXCL13crit] =
" Critical CXCL13 concentration for desensitization (mol) //(-1 for "
"none)????? ";
par[CXCL13crit] = hypar.Value.CXCL13crit;
names[CXCL12recrit] =
" Critical CXCL12 concentration for resensitization (mol) ";
par[CXCL12recrit] = hypar.Value.CXCL12recrit;
names[CXCL13recrit] =
" Critical CXCL13 concentration for resensitization (mol) //(-1 for "
"none)????? ";
par[CXCL13recrit] = hypar.Value.CXCL13recrit;
names[chemmax] = " Maximum weigh of chemotaxis ";
par[chemmax] = hypar.Value.chemo_max;
names[chemosteep] =
" Steepness of weight reduction with chemokine gradient (mol/l) ";
par[chemosteep] = hypar.Value.chemo_steep;
names[chemohalf] = " Chemokine gradient of half weight (l/mol) ";
par[chemohalf] = hypar.Value.chemo_half;
names[collectionFDCperiod] =
" Duration of CC collection of Antigen by serial encounters with FDC "
"(hr.) ";
par[collectionFDCperiod] = hypar.Value.collectFDCperiod;
names[CB_radius] = " Centroblast radius (um) ";
par[CB_radius] = hypar.Value.CB_radius;
// D
names[DendriteLength] =
" Length FDC dendrites / dx (number of positions) ";
par[DendriteLength] = hypar.Value.FDClength;
names[dimension] = " Lattice Dimensions ";
par[dimension] = hypar.Value.DimSpace;
names[dt] = " Time resolution (hr) ";
par[dt] = hypar.Value.deltat;
names[dx] = " Lattice Constant (um) ";
par[dx] = hypar.Value.dx;
names[DeleteAgInFreshCC] = " Retained Ag is deleted in fresh CC ";
par[DeleteAgInFreshCC] = hypar.Value.ag_loaded_CB_diff2output;
names[difDelay] =
" Delay cell differentiation after TC selection (hr.) ";
par[difDelay] = hypar.Value.ccdiff_delay;
// E
names[expMin] = "Conversion of shape space affinity to (1/mol)";
par[expMin] = hypar.Value.k_ic_exp_min;
names[expMax] = "Conversion of shape space affinity to (1/mol)";
par[expMax] = hypar.Value.k_ic_exp_max;
names[eta] = " Exponent of the hamming distance ";
par[eta] = hypar.Value.amplitudeGauss;
// G
names[Gamma] = " Width of gaussian affinity weight function ";
par[Gamma] = hypar.Value.GammaGauss;
// I
names[InitialNumberSC] = " Initial Number Stromal cells ";
par[InitialNumberSC] = 300;
names[InitialNumberTC] = " Initial Number T-cells ";
par[InitialNumberTC] = hypar.Value.totalTC;
names[InitialNumberCB] = " Initial Number Centroblasts ";
par[InitialNumberCB] =
hypar.Value.totalB; // Danial:changed from totalBss to total B
names[InitialNumberFDC] = " Initial Number FDCs ";
par[InitialNumberFDC] = hypar.Value.FDCnumber;
// K
names[kon] = "k_on for building immune complex (1/mol h) ";
par[kon] = hypar.Value.ic_k_on;
names[koff] = "k_off for dissociation of immune complex (in /s): ";
par[koff] = hypar.Value.ic_k_off;
// L
names[BCR_Length] = " Length of BCRs ";
par[BCR_Length] = hypar.Value.DimShapeSpace;
// M
names[macrophage] = "Rate of macrophage transport of dead cells (h):";
par[macrophage] = hypar.Value.macrophage;
// names[Memorycell_tp] = " Memory Cell speed (um / hr.) ";
// par[ Memorycell_tp ] = hypar.Value. OUT_persistence ;
// names[Memorycell_speed] = " Memory Cell polarity (degrees) ";
// par[ Memorycell_speed ] = hypar.Value. v_OUT ;
// names[Memorycell_tp_stddev] = " Memory Cell polarity (degrees) ";
// par[ Memorycell_tp_stddev ] = hypar.Value. v_OUT_width ;
// N
names[Nmax] = " Maximum number of residues in one dimension ";
par[Nmax] = 9;
names[NoMutFounderCells] = " FounderCellsDoNotMutate ";
par[NoMutFounderCells] = false;
names[nDiv] =
" Number of divisions of founder cells "
"((StartDifferentiation-tmin)/cell cycle duration) ";
par[nDiv] = hypar.Value.CB_fixed_times_of_divisions_in_expansion;
names[nDiv_stddev] =
" stddev of Number of divisions of founder cells "
"((StartDifferentiation-tmin)/cell cycle duration) ";
par[nDiv_stddev] = hypar.Value.stddev_initial_divisions;
names[nDivinflow] = " Number of divisions of influx Bcells ";
par[nDivinflow] =
6; // Elena: Is there any same parameter for hyphasma? CHECsK****
Avogadro_constant = 6.02205e+23; // mol^-1, Avogadro number
// P
names[Plasmacell_tp] = " Plasma Cell persistence time (unit) ";
par[Plasmacell_tp] = hypar.Value.OUT_persistence;
names[Plasmacell_speed] = " Plasma Cell speed (unit) ";
par[Plasmacell_speed] = hypar.Value.v_OUT;
names[Plasmacell_tp_stddev] = " Plasma Cell polarity (degrees) ";
par[Plasmacell_tp_stddev] = hypar.Value.v_OUT_width;
names[pMHCdepHill] =
" p-MHC dependent division number Hill (Hill coef. n_P) ";
par[pMHCdepHill] = hypar.Value.pMHC_dependent_nHill;
names[pMHCdepMin] =
" p-MHC dependent division number Hill (Hill coef. P_Min) ";
par[pMHCdepMin] = hypar.Value.pMHC_dependent_P_min;
names[pMHCdepMax] =
" p-MHC dependent division number Hill (Hill coef. P_Max) ";
par[pMHCdepMax] = hypar.Value.pMHC_dependent_P_max;
names[pMHCdepK] =
" p-MHC dependent division number Hill (Hill coef. K_P) ";
par[pMHCdepK] = hypar.Value.pMHC_dependent_K;
names[pmutB4StartMut] =
" Probability of mutation before first 24 hours ";
par[pmutB4StartMut] = 0;
names[pmutAfterStartMut] =
" Probability of mutation after first 24 hours ";
par[pmutAfterStartMut] = hypar.Value.mutation;
names[pmutAfterSelection] =
" Probability of mutation after selection (affinity dependant) ";
par[pmutAfterSelection] = hypar.Value.mutation_after_tc;
names[pmutAffinityExponent] =
" Affinity dependant mutation upon TC contact (affinity-exponent) ";
par[pmutAffinityExponent] = hypar.Value.mutation_affinity_exponent;
names[pDivideAgAssymetric] =
" Probability to divide Ag assymetrically to daughter B-cell ";
par[pDivideAgAssymetric] = hypar.Value.divide_ag_asymmetric;
names[polarityIndex] = " Assymetric Distribution of Ag ";
par[polarityIndex] = hypar.Value.asymmetric_polarity_index;
names[pSel] = " Probability to be selected by FDC. ";
par[pSel] = hypar.Value.selection;
names[pApoCC] = " % Casp3+ LZ cells per hr. used as (apoptosis rate) ";
par[pApoCC] = 0;
names[pApoCB] = " % Casp3+ DZ cells per hr. used as (apoptosis rate) ";
par[pApoCB] = 0;
names[p_dif] = " Differentiation rate ";
// R
names[radius] = " Lattice Radius (um) ";
par[radius] = hypar.Value.GC_radius;
names[rateCBinflow] = " rate of inflow (cells/hr.) ";
par[rateCBinflow] = hypar.Value.newBCinflux_rate;
// S
names[smoothnessStopCBinflow] =
" smoothness of stop inflow CB (hr.) (-1 = no) ";
par[smoothnessStopCBinflow] = hypar.Value.smooth_stopBCinflux;
names[StartMutation] = " Start of mutation period (hr.) ";
par[StartMutation] = hypar.Value.Start_Mutation;
// T
names[timeStopCBinflow] = " time to stop inflow CB (hr.) ";
par[timeStopCBinflow] = hypar.Value.newBCinflux_stop;
names[Tcell_speed] = " T-Cell Speed (um / hr.) ";
par[Tcell_speed] = hypar.Value.v_TC;
names[Tcell_tp] = " T-Cell Persistent Time average (hr.) ";
par[Tcell_tp] = hypar.Value.TC_persistence;
names[Tcell_stddev] = " deviation of T-cell speed (um/sec) ";
par[Tcell_stddev] = hypar.Value.v_TC_width;
names[Tcell_tp_stddev] = " T-Cell Persistent Time stddev (hr.) ";
par[Tcell_tp_stddev] = 0;
names[tcTime] = " Duration of CC-Tc contact (hr.) ";
par[tcTime] = hypar.Value.TC_time;
names[tcRescueTime] =
" Minimum duration of TC-CC-polarization for CC-rescue (hr.) ";
par[tcRescueTime] = hypar.Value.TC_rescue_time;
names[testDelay] = " Time gap between TFHC-CC binding tests (hr.) ";
par[testDelay] = hypar.Value.CC_test_delay;
names[tmax] = " Maximum duration of GC simulation (hr.) ";
par[tmax] = hypar.Value.tmax;
names[tolight] = " Rate for differentiation of centroblasts to centrocytes ";
par[tolight] = hypar.Value.tolight;
// W
names[widthPI] = " Coefficient of variation arround Polarity Index ";
par[widthPI] = hypar.Value.smooth_PI;
// Z
names[zoneRatioGC] =
" Ratio that determines the position of DZ in Germinal Center ";
par[zoneRatioGC] = 0.5;
}
void parameters::convert_parameters() {
// It should be mentioned in output files that parameters are converted based
// on time and size steps. #temporary
//#Recheck
par[kon] = par[kon] * 3600. * par[Ag_threshold]; // /(Mol hour) ?
par[koff] = par[koff] * 3600.; // /(Mol hour) ?
par[macrophage] = (log(2) / par[macrophage]) * par[dt];
par[testDelay] = int(par[testDelay] / par[dt] + 0.5);
// Persistence time
// CB
if (par[Bcell_tp] > 60. * par[dt]) {
par[Bcell_tp] = 60. * par[dt] / par[Bcell_tp];
} else {
par[Bcell_tp] = 1.;
}
// Out
if (par[Plasmacell_tp] > 60. * par[dt]) {
par[Plasmacell_tp] = 60. * par[dt] / par[Plasmacell_tp];
} else {
par[Plasmacell_tp] = 1.;
}
// TC
if (par[Tcell_tp] > 60. * par[dt]) {
par[Tcell_tp] = 60. * par[dt] / par[Tcell_tp];
} else {
par[Tcell_tp] = 1.;
}
par[p_dif] =
(1 / par[tolight]) * par[dt]; // #temporary make it specific for cc and cb
par[chemosteep] = par[chemosteep] / (par[dx] * par[dx] * par[dx] * 1.e-15 *
Avogadro_constant); // in # molecules
par[chemohalf] = par[chemohalf] * par[dx] * par[dx] * par[dx] * 1.e-15 * Avogadro_constant;
// in # molecules
par[CXCL12crit] =
par[CXCL12crit] * par[dx] * par[dx] * par[dx] * 1.e-15 * Avogadro_constant;
// in # molecules
par[CXCL12recrit] =
par[CXCL12recrit] * par[dx] * par[dx] * par[dx] * 1.e-15 * Avogadro_constant;
// in # molecules
par[CXCL13crit] =
par[CXCL13crit] * par[dx] * par[dx] * par[dx] * 1.e-15 * Avogadro_constant;
// in # molecules
par[CXCL13recrit] =
par[CXCL13recrit] * par[dx] * par[dx] * par[dx] * 1.e-15 * Avogadro_constant;
//////////////////////////////////////////////////////////////////////////////////
int smoothmove = 1; // #temproary, move to parameters file
par[Bcell_speed] = 60. * par[Bcell_speed] * par[dt] / par[dx];
double smoothfactor = smoothmove * par[dx] * par[dx] /
(12.56 * par[CB_radius] * par[CB_radius]);
double dfactor = 0.7; // approximate value for use_D_correction==0
if (par[Bcell_speed] * smoothfactor / (dfactor) > 1.0) {
cout << "Centroblast-Diffusion (p="
<< par[Bcell_speed] * smoothfactor / (dfactor)
<< ") is too large for dx and dt !!!\n";
exit(1);
}
// TC speed
par[Tcell_speed] = 60. * par[Tcell_speed] * par[dt] / par[dx];
if (par[Tcell_speed] > 0.5) {
cout << "TC-motility (p=" << par[Tcell_speed]
<< ") is too large for dx and dt !!!\n";
exit(1);
}
// Out speed
par[Plasmacell_speed] = 60. * par[Plasmacell_speed] * par[dt] / par[dx];
if (par[Plasmacell_speed] > 0.5) {
cout << "TC-motility (p=" << par[Plasmacell_speed]
<< ") is too large for dx and dt !!!\n";
exit(1);
}
par[DendriteLength] = int(par[DendriteLength] / par[dx]);
par[pSel] = par[pSel] * par[dt]; //"Rate of positive
//selection at FDCs" * dt , the rate of
//position selection is Psel and we save the
//new value that is the result of
//multiplication by dt, in pSel itself.
//////////////////////////////////////////////////////////////////////////////////////////////////////////
}