Use '|' as epitope mut/WT field list separator (on single line).
authorDariusz Murakowski <murakdar@mit.edu>
Mon, 17 Feb 2014 11:52:07 +0000 (06:52 -0500)
committerDariusz Murakowski <murakdar@mit.edu>
Mon, 17 Feb 2014 11:52:07 +0000 (06:52 -0500)
test/importState.test.ep
test/importState.test.expected-out
test/verbose.test.expected-out
wf.cpp

index b152847..4476bf5 100644 (file)
@@ -1,2 +1 @@
-24     25      26      27      28      29      31      32
-30
+24     25      26      27      28      29      31      32      |       30
index 7312035..d8e8adf 100644 (file)
@@ -1,4 +1,7 @@
 seed = 66314
 1      30      57      60      74      78      90;
-24     25      26      27      28      29      31      32
-30
+24     25      26      27      28      29      31      32      |       30
+-----------
+24 25 26 27 28 29 31 32 | 30 
+-----------
+24 25 26 27 28 29 31 32 | 30 
index f6a0dcd..0170b5a 100644 (file)
@@ -1,7 +1,8 @@
 seed = 66314
 1      30      57      60      74      78      90;
-24     25      26      27      28      29      31      32
-30
+24     25      26      27      28      29      31      32      |       30
+-----------
+24 25 26 27 28 29 31 32 | 30 
 survival probability 0.00240569 number survived 0 total number 0       0       30      57      60      74      78      90
 survival probability 0.00735298 number survived 1 total number 1       1       30      57      60      74      78      90
 survival probability 0.000431987 number survived 0 total number 0      2       30      57      60      74      78      90
@@ -314,6 +315,8 @@ survival probability 0.998641 number survived 21 total number 21    30      60      74      78      90
 survival probability 1 number survived 39 total number 39      57      60      74      78      90
 checkpoint, total_deaths = 50637
 The total population size is 49363
+-----------
+24 25 26 27 28 29 31 32 | 30 
 survival probability 0.00240687 number survived 0 total number 0       0       30      57      60      74      78      90
 survival probability 0.00735655 number survived 0 total number 0       1       30      57      60      74      78      90
 survival probability 0.000432199 number survived 0 total number 0      2       30      57      60      74      78      90
diff --git a/wf.cpp b/wf.cpp
index fcb55de..c53acf9 100644 (file)
--- a/wf.cpp
+++ b/wf.cpp
@@ -102,6 +102,20 @@ void run(RunParameters &r, unsigned seed) {
                 H.set_epitope(r.eWT, r.eMut, r.penalty);
                 H.set_temp(r.bh, r.bJ);
                 Population P(H, r.n, r.mu, r.initPop, r.initFrac);
+
+                // print epitopes
+                std::cout << "-----------\n";
+                for (unsigned ep=0; ep<H.penalty.size(); ++ep) {
+                    for (unsigned i=0; i<H.epitopeWT[ep].size(); ++i) {
+                        std::cout << H.epitopeWT[ep][i] << " ";
+                    }
+                    std::cout << "| ";
+                    for (unsigned i=0; i<H.epitopeMut[ep].size(); ++i) {
+                        std::cout << H.epitopeMut[ep][i] << " ";
+                    }
+                    std::cout << "\n";
+                }
+                fflush(stdout);
                 
                 unsigned int i;
                 for (i=0; i<r.g; ++i) {
@@ -236,7 +250,12 @@ void importEpitope(RunParameters &r) {
         if (o=='\n') break;
         
     }
-    
+
+    if (fscanf(input,"%c",&o) != 1 || o != '|') { perror((std::string("ERROR in importEpitope: ") + r.epitopeInfile).c_str()); exit(1); }
+    std::cout << o; // XXX
+    if (fscanf(input,"%c",&o) != 1 || o != '\t') { perror((std::string("ERROR in importEpitope: ") + r.epitopeInfile).c_str()); exit(1); }
+    std::cout << o; // XXX;
+
     while (fscanf(input,"%u",&site)==1) {
 
         std::cout << site; // XXX