]> git.donarmstrong.com Git - mothur.git/blobdiff - unweighted.cpp
added checks for ^C to quit command instead of program
[mothur.git] / unweighted.cpp
index 5bf6ee3616fb39f6d9ea4a3b4d048e45962f6c33..2a2a41cf0f6b823e3a781d9dabe53702e04d6f78 100644 (file)
@@ -49,6 +49,7 @@ EstOutput Unweighted::getValues(Tree* t) {
                                groups.push_back(globaldata->Groups[a]); groups.push_back(globaldata->Groups[l]);
                
                                for(int i=0;i<t->getNumNodes();i++){
+                                       if (m->control_pressed) {  return data; }
        
                                        copyIpcount = t->tree[i].pcount;
                                        for (it = copyIpcount.begin(); it != copyIpcount.end();) {
@@ -101,6 +102,8 @@ EstOutput Unweighted::getValues(Tree* t) {
                        copyIpcount.clear();
                                
                        for(int i=0;i<t->getNumNodes();i++){
+                       
+                               if (m->control_pressed) {  return data; }
                                
                                copyIpcount = t->tree[i].pcount;
                                for (it = copyIpcount.begin(); it != copyIpcount.end();) {
@@ -182,10 +185,14 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB) {
                                //swap labels in the groups you want to compare
                                copyTree->assembleRandomUnifracTree(groups[0], groups[1]);
                                
+                               if (m->control_pressed) { delete copyTree; return data; }
+                               
                                //copyTree->createNewickFile("random"+groupA+toString(count));
                                
                                for(int i=0;i<copyTree->getNumNodes();i++){
-                                               
+                                       
+                                       if (m->control_pressed) { delete copyTree; return data; }
+                                       
                                        /**********************************************************************/
                                        //This section adds in all lengths that are non leaf
                                        copyIpcount = copyTree->tree[i].pcount;
@@ -242,8 +249,11 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB) {
                                
                        //swap labels in all the groups you want to compare
                        copyTree->assembleRandomUnifracTree(groups);
+                       
+                       if (m->control_pressed) { delete copyTree; return data; }
 
                        for(int i=0;i<copyTree->getNumNodes();i++){
+                               if (m->control_pressed) { delete copyTree; return data; }
                        
                                copyIpcount = copyTree->tree[i].pcount;
                                for (it = copyIpcount.begin(); it != copyIpcount.end();) {