]> git.donarmstrong.com Git - mothur.git/blobdiff - venn.cpp
added checks for ^C to quit command instead of program
[mothur.git] / venn.cpp
index 43129f5e2d8713e1608be534915cbe61276d1ea5..638a12fa817e6737d453c25e85b5b50cc66562d8 100644 (file)
--- a/venn.cpp
+++ b/venn.cpp
@@ -37,6 +37,8 @@ vector<string> Venn::getPic(SAbundVector* sabund, vector<Calculator*> vCalcs) {
                        string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + ".venn." + sabund->getLabel() + vCalcs[i]->getName() + ".svg";
                        outputNames.push_back(filenamesvg);
                        openOutputFile(filenamesvg, outsvg);
+                       
+                       if (m->control_pressed) { outsvg.close(); return outputNames; }
 
                        vector<double> data = vCalcs[i]->getValues(sabund);
                        
@@ -83,7 +85,9 @@ vector<string> Venn::getPic(vector<SharedRAbundVector*> lookup, vector<Calculato
                                string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + lookup[0]->getLabel() + ".venn." + vCalcs[i]->getName() + ".svg";
                                outputNames.push_back(filenamesvg);
                                openOutputFile(filenamesvg, outsvg);
-                       
+                               
+                               if (m->control_pressed) { outsvg.close(); return outputNames; }
+                               
                                //in essence you want to run it like a single 
                                if (vCalcs[i]->getName() == "sharedsobs") {
                                        singleCalc = new Sobs();
@@ -134,6 +138,8 @@ vector<string> Venn::getPic(vector<SharedRAbundVector*> lookup, vector<Calculato
                                outputNames.push_back(filenamesvg);
                                openOutputFile(filenamesvg, outsvg);
                                
+                               if (m->control_pressed) { outsvg.close(); return outputNames; }
+                               
                                //get estimates for sharedAB
                                vector<double> shared = vCalcs[i]->getValues(subset);
                                
@@ -203,6 +209,8 @@ vector<string> Venn::getPic(vector<SharedRAbundVector*> lookup, vector<Calculato
                                outputNames.push_back(filenamesvg);
                                openOutputFile(filenamesvg, outsvg);
                                
+                               if (m->control_pressed) { outsvg.close(); return outputNames; }
+                               
                                if (vCalcs[i]->getName() == "sharedace") {
                                
                                        singleCalc = new Ace(10);
@@ -459,7 +467,8 @@ vector<string> Venn::getPic(vector<SharedRAbundVector*> lookup, vector<Calculato
                                        outputNames.push_back(filenamesvg);
                                        openOutputFile(filenamesvg, outsvg);
 
-                               
+                                       if (m->control_pressed) { outsvg.close(); return outputNames; }
+                                       
                                        //in essence you want to run it like a single 
                                        if (vCalcs[i]->getName() == "sharedsobs") {
                                                singleCalc = new Sobs();