Reactions accounting for propagation of CTL divisions.
authorDariusz Murakowski <murakdar@mit.edu>
Tue, 28 Apr 2015 03:59:05 +0000 (23:59 -0400)
committerDariusz Murakowski <murakdar@mit.edu>
Tue, 28 Apr 2015 03:59:05 +0000 (23:59 -0400)
ss.cpp

diff --git a/ss.cpp b/ss.cpp
index 95ed444..56f26bd 100644 (file)
--- a/ss.cpp
+++ b/ss.cpp
@@ -496,9 +496,11 @@ void importEpitope(RunParameters_SS &r, Species_parray &species, Rxn_parray &rea
             print_spec.push_back(Tn);
         }
 
-        {   // p
+        std::vector<CTLSpecies*>::iterator it = Tgen.begin(), end = Tgen.end();
+
+        for (it = Tgen.begin(); it != end; ++it) {   // p
             KillingReaction* rx = new KillingReaction(r.rate_p);
-            rx->T = T;  rx->V = V;
+            rx->T = *it;  rx->V = V;
             reactions.push_back(rx);
         }
         {   // a
@@ -506,16 +508,27 @@ void importEpitope(RunParameters_SS &r, Species_parray &species, Rxn_parray &rea
             rx->Tfrom = N;  rx->Tto = T;  rx->V = V;
             reactions.push_back(rx);
         }
-        {   // r
+        for (size_t i=0; i<r.num_T_gen-1; i++) {   // r
             ElementaryReaction* rx = new ElementaryReaction(r.rate_r);
-            rx->reactants.push_back(T); rx->reactant_stoich.push_back(1);
-            rx->products.push_back(T); rx->product_stoich.push_back(1);
+            rx->reactants.push_back(Tgen[i]); rx->reactant_stoich.push_back(1);
+            rx->products.push_back(Tgen[i]); rx->product_stoich.push_back(-1);
+            rx->products.push_back(Tgen[i+1]); rx->product_stoich.push_back(2);
             reactions.push_back(rx);
         }
-        {   // d = 0.5  // note d' = 3.0
-            ElementaryReaction* rx = new ElementaryReaction(r.rate_dprime);
-            rx->reactants.push_back(T); rx->reactant_stoich.push_back(1);
-            rx->products.push_back(T); rx->product_stoich.push_back(-1);
+        // un-commenting the following reaction causes there to be no difference
+        // between the effector cell generations, so that the last generation
+        // will simply accumulate; dynamics should be equivalent to the original
+        // version before including multiple divisions
+        //{   // r
+        //    ElementaryReaction* rx = new ElementaryReaction(r.rate_r);
+        //    rx->reactants.push_back(Tgen.back()); rx->reactant_stoich.push_back(1);
+        //    rx->products.push_back(Tgen.back()); rx->product_stoich.push_back(1);
+        //    reactions.push_back(rx);
+        //}
+        for (it = Tgen.begin(); it != end; ++it) {   // d = 0.5  // note d' = 3.0
+            ElementaryReaction* rx = new ElementaryReaction(r.rate_d);
+            rx->reactants.push_back(*it); rx->reactant_stoich.push_back(1);
+            rx->products.push_back(*it); rx->product_stoich.push_back(-1);
             reactions.push_back(rx);
         }
         {   // b
@@ -540,10 +553,10 @@ void importEpitope(RunParameters_SS &r, Species_parray &species, Rxn_parray &rea
             rx->Tfrom = M;  rx->Tto = T;  rx->V = V;
             reactions.push_back(rx);
         }
-        {   // g
+        for (it = Tgen.begin(); it != end; ++it) {   // g
             ElementaryReaction* rx = new ElementaryReaction(r.rate_g);
-            rx->reactants.push_back(T); rx->reactant_stoich.push_back(1);
-            rx->products.push_back(T); rx->product_stoich.push_back(-1);
+            rx->reactants.push_back(*it); rx->reactant_stoich.push_back(1);
+            rx->products.push_back(*it); rx->product_stoich.push_back(-1);
             rx->products.push_back(M); rx->product_stoich.push_back(1);
             reactions.push_back(rx);
         }
@@ -652,9 +665,11 @@ void importEpitope_Potts(RunParameters_SS &r, Species_parray &species, Rxn_parra
             print_spec.push_back(Tn);
         }
 
-        {   // p
+        std::vector<CTLaaSpecies*>::iterator it = Tgen.begin(), end = Tgen.end();
+
+        for (it = Tgen.begin(); it != end; ++it) {   // p
             AAKillingReaction* rx = new AAKillingReaction(r.rate_p);
-            rx->T = T;  rx->V = V;
+            rx->T = *it;  rx->V = V;
             reactions.push_back(rx);
         }
         {   // a
@@ -662,16 +677,27 @@ void importEpitope_Potts(RunParameters_SS &r, Species_parray &species, Rxn_parra
             rx->Tfrom = N;  rx->Tto = T;  rx->V = V;
             reactions.push_back(rx);
         }
-        {   // r
+        for (size_t i=0; i<r.num_T_gen-1; i++) {   // r
             ElementaryReaction* rx = new ElementaryReaction(r.rate_r);
-            rx->reactants.push_back(T); rx->reactant_stoich.push_back(1);
-            rx->products.push_back(T); rx->product_stoich.push_back(1);
+            rx->reactants.push_back(Tgen[i]); rx->reactant_stoich.push_back(1);
+            rx->products.push_back(Tgen[i]); rx->product_stoich.push_back(-1);
+            rx->products.push_back(Tgen[i+1]); rx->product_stoich.push_back(2);
             reactions.push_back(rx);
         }
-        {   // d = 0.5  // note d' = 3.0
-            ElementaryReaction* rx = new ElementaryReaction(r.rate_dprime);
-            rx->reactants.push_back(T); rx->reactant_stoich.push_back(1);
-            rx->products.push_back(T); rx->product_stoich.push_back(-1);
+        // un-commenting the following reaction causes there to be no difference
+        // between the effector cell generations, so that the last generation
+        // will simply accumulate; dynamics should be equivalent to the original
+        // version before including multiple divisions
+        //{   // r
+        //    ElementaryReaction* rx = new ElementaryReaction(r.rate_r);
+        //    rx->reactants.push_back(Tgen.back()); rx->reactant_stoich.push_back(1);
+        //    rx->products.push_back(Tgen.back()); rx->product_stoich.push_back(1);
+        //    reactions.push_back(rx);
+        //}
+        for (it = Tgen.begin(); it != end; ++it) {   // d = 0.5  // note d' = 3.0
+            ElementaryReaction* rx = new ElementaryReaction(r.rate_d);
+            rx->reactants.push_back(*it); rx->reactant_stoich.push_back(1);
+            rx->products.push_back(*it); rx->product_stoich.push_back(-1);
             reactions.push_back(rx);
         }
         {   // b
@@ -696,10 +722,10 @@ void importEpitope_Potts(RunParameters_SS &r, Species_parray &species, Rxn_parra
             rx->Tfrom = M;  rx->Tto = T;  rx->V = V;
             reactions.push_back(rx);
         }
-        {   // g
+        for (it = Tgen.begin(); it != end; ++it) {   // g
             ElementaryReaction* rx = new ElementaryReaction(r.rate_g);
-            rx->reactants.push_back(T); rx->reactant_stoich.push_back(1);
-            rx->products.push_back(T); rx->product_stoich.push_back(-1);
+            rx->reactants.push_back(*it); rx->reactant_stoich.push_back(1);
+            rx->products.push_back(*it); rx->product_stoich.push_back(-1);
             rx->products.push_back(M); rx->product_stoich.push_back(1);
             reactions.push_back(rx);
         }