X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=catchallcommand.cpp;h=39cc44f86e2cbe70efba4cb2700ad3154eb91945;hb=74dc92cf53df65fd8b14d8eaf35489bbecbccac6;hp=3effaf4eaafe09659252e6f93fa81f31dcc4e1db;hpb=ca9ac1d80c62f57270b0dcd49410ebe08a8aecd6;p=mothur.git diff --git a/catchallcommand.cpp b/catchallcommand.cpp index 3effaf4..39cc44f 100644 --- a/catchallcommand.cpp +++ b/catchallcommand.cpp @@ -8,7 +8,6 @@ */ #include "catchallcommand.h" -#include "globaldata.hpp" //********************************************************************************************************************** vector CatchAllCommand::setParameters(){ @@ -73,6 +72,7 @@ CatchAllCommand::CatchAllCommand(string option) { //allow user to run help if(option == "help") { help(); abort = true; calledHelp = true; } + else if(option == "citation") { citation(); abort = true; calledHelp = true;} else { vector myArray = setParameters(); @@ -119,10 +119,12 @@ CatchAllCommand::CatchAllCommand(string option) { sabundfile = validParameter.validFile(parameters, "sabund", true); if (sabundfile == "not open") { sabundfile = ""; abort = true; } else if (sabundfile == "not found") { sabundfile = ""; } + else { m->setSabundFile(sabundfile); } sharedfile = validParameter.validFile(parameters, "shared", true); if (sharedfile == "not open") { sharedfile = ""; abort = true; } else if (sharedfile == "not found") { sharedfile = ""; } + else { m->setSharedFile(sharedfile); } string label = validParameter.validFile(parameters, "label", false); if (label == "not found") { label = ""; } @@ -234,7 +236,7 @@ int CatchAllCommand::execute() { //run catchall system(catchAllCommand.c_str()); - remove(filename.c_str()); + m->mothurRemove(filename); filename = m->getRootName(filename); filename = filename.substr(0, filename.length()-1); //rip off extra . if (savedOutputDir == "") { filename = m->getSimpleName(filename); } @@ -246,7 +248,7 @@ int CatchAllCommand::execute() { createSummaryFile(filename + "_BestModelsAnalysis.csv", sabund->getLabel(), out); - if (m->control_pressed) { out.close(); for (int i = 0; i < outputNames.size(); i++) {remove(outputNames[i].c_str()); } delete input; delete sabund; return 0; } + if (m->control_pressed) { out.close(); for (int i = 0; i < outputNames.size(); i++) {m->mothurRemove(outputNames[i]); } delete input; delete sabund; return 0; } processedLabels.insert(sabund->getLabel()); userLabels.erase(sabund->getLabel()); @@ -278,7 +280,7 @@ int CatchAllCommand::execute() { //run catchall system(catchAllCommand.c_str()); - remove(filename.c_str()); + m->mothurRemove(filename); filename = m->getRootName(filename); filename = filename.substr(0, filename.length()-1); //rip off extra . if (savedOutputDir == "") { filename = m->getSimpleName(filename); } @@ -290,7 +292,7 @@ int CatchAllCommand::execute() { createSummaryFile(filename + "_BestModelsAnalysis.csv", sabund->getLabel(), out); - if (m->control_pressed) { out.close(); for (int i = 0; i < outputNames.size(); i++) {remove(outputNames[i].c_str()); } delete input; delete sabund; return 0; } + if (m->control_pressed) { out.close(); for (int i = 0; i < outputNames.size(); i++) {m->mothurRemove(outputNames[i]); } delete input; delete sabund; return 0; } processedLabels.insert(sabund->getLabel()); userLabels.erase(sabund->getLabel()); @@ -343,7 +345,7 @@ int CatchAllCommand::execute() { //run catchall system(catchAllCommand.c_str()); - remove(filename.c_str()); + m->mothurRemove(filename); filename = m->getRootName(filename); filename = filename.substr(0, filename.length()-1); //rip off extra . if (savedOutputDir == "") { filename = m->getSimpleName(filename); } @@ -361,7 +363,7 @@ int CatchAllCommand::execute() { out.close(); delete input; - if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) {remove(outputNames[i].c_str()); } return 0; } + if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) {m->mothurRemove(outputNames[i]); } return 0; } } @@ -469,7 +471,7 @@ string CatchAllCommand::combineSummmary(vector& outputNames) { numLines = thisFilesLines.size(); temp.close(); - remove(outputNames[i].c_str()); + m->mothurRemove(outputNames[i]); } //for each label @@ -577,7 +579,7 @@ vector CatchAllCommand::parseSharedFile(string filename) { //clears file before we start to write to it below for (int i=0; igetGroup() + ".sabund").c_str()); + m->mothurRemove((sharedFileRoot + lookup[i]->getGroup() + ".sabund")); filenames.push_back((sharedFileRoot + lookup[i]->getGroup() + ".sabund")); groups.push_back(lookup[i]->getGroup()); }