X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=heatmapsimcommand.cpp;h=dc67a8d4374ae90aebf182ce80d5474b17431f95;hp=1b4b9d79010b22391ed29e148c8b3f9137ac1b3f;hb=aa9238c0a9e6e7aa0ed8b8b606b08ad4fd7dcfe3;hpb=182db2b6f1747bc1e0b8cd3eceec8751abdd31d5 diff --git a/heatmapsimcommand.cpp b/heatmapsimcommand.cpp index 1b4b9d7..dc67a8d 100644 --- a/heatmapsimcommand.cpp +++ b/heatmapsimcommand.cpp @@ -240,6 +240,8 @@ int HeatMapSimCommand::execute(){ delete heatmap; delete validCalculator; + if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; } + m->mothurOutEndLine(); m->mothurOut("Output File Names: "); m->mothurOutEndLine(); for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); } @@ -273,9 +275,13 @@ int HeatMapSimCommand::runCommandShared() { set processedLabels; set userLabels = labels; + if (m->control_pressed) { delete read; delete input; globaldata->ginput = NULL; for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } globaldata->Groups.clear(); return 0; } + //as long as you are not at the end of the file or done wih the lines you want while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { - + + if (m->control_pressed) { delete read; delete input; globaldata->ginput = NULL; for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } globaldata->Groups.clear(); return 0; } + if(allLines == 1 || labels.count(lookup[0]->getLabel()) == 1){ m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine(); @@ -311,7 +317,10 @@ int HeatMapSimCommand::runCommandShared() { for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } lookup = input->getSharedRAbundVectors(); } + + if (m->control_pressed) { delete read; delete input; globaldata->ginput = NULL; globaldata->Groups.clear(); return 0; } + //output error messages about any remaining user labels set::iterator it; bool needToRun = false; @@ -325,6 +334,8 @@ int HeatMapSimCommand::runCommandShared() { } } + if (m->control_pressed) { delete read; delete input; globaldata->ginput = NULL; globaldata->Groups.clear(); return 0; } + //run last label if you need to if (needToRun == true) { for (int i = 0; i < lookup.size(); i++) { if (lookup[i] != NULL) { delete lookup[i]; } } @@ -337,6 +348,7 @@ int HeatMapSimCommand::runCommandShared() { for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } } + if (m->control_pressed) { delete read; delete input; globaldata->ginput = NULL; globaldata->Groups.clear(); return 0; } //reset groups parameter globaldata->Groups.clear(); @@ -407,7 +419,9 @@ int HeatMapSimCommand::runCommandDist() { in >> name; names.push_back(name); - for(int j=0;j> matrix[i][j]; } + if (m->control_pressed) { return 0; } + + for(int j=0;j> matrix[i][j]; } gobble(in); } }else { @@ -416,6 +430,8 @@ int HeatMapSimCommand::runCommandDist() { in >> name; names.push_back(name); + if (m->control_pressed) { return 0; } + for(int j=0;j> dist; matrix[i][j] = dist; matrix[j][i] = dist; @@ -448,6 +464,8 @@ int HeatMapSimCommand::runCommandDist() { while (!in.eof()) { in >> first >> second >> dist; gobble(in); + if (m->control_pressed) { return 0; } + map::iterator itA = nameMap->find(first); map::iterator itB = nameMap->find(second);