]> git.donarmstrong.com Git - mothur.git/blobdiff - clustercommand.cpp
adding mothurout.h and .cpp to repo
[mothur.git] / clustercommand.cpp
index 5d9c7bccfbb250267553997fa3d6b16d7aa560b7..7484a621645c2449bfc9f158a391549f33da71dd 100644 (file)
@@ -154,6 +154,17 @@ int ClusterCommand::execute(){
                double saveCutoff = cutoff;
                
                while (matrix->getSmallDist() < cutoff && matrix->getNNodes() > 0){
+               
+                       if (m->control_pressed) { //clean up
+                               delete globaldata->gSparseMatrix;  globaldata->gSparseMatrix = NULL;
+                               delete globaldata->gListVector;  globaldata->gListVector = NULL;
+                               if (globaldata->getFormat() == "phylip") { globaldata->setPhylipFile(""); }
+                               else if (globaldata->getFormat() == "column") { globaldata->setColumnFile(""); }
+                               sabundFile.close();rabundFile.close();listFile.close();
+                               for (int i = 0; i < outputNames.size(); i++) {  remove(outputNames[i].c_str());         }
+                               return 0;
+                       }
+               
                        if (print_start && isTrue(timing)) {
                                m->mothurOut("Clustering (" + tag + ") dist " + toString(matrix->getSmallDist()) + "/" 
                                        + toString(roundDist(matrix->getSmallDist(), precision))