X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=collectcommand.cpp;h=5549fd121dfca80e5cd4a406084f68803875dc58;hp=adaff9b1bc7b17d979b30106de2ee88c0d03631d;hb=1d898dc6edaf9e9f287fab53bf1f21fb29757a17;hpb=c7f5a50aec1ec4b420b286d6ccf980d2a847d494 diff --git a/collectcommand.cpp b/collectcommand.cpp index adaff9b..5549fd1 100644 --- a/collectcommand.cpp +++ b/collectcommand.cpp @@ -63,15 +63,16 @@ vector CollectCommand::setParameters(){ string CollectCommand::getHelpString(){ try { string helpString = ""; + ValidCalculators validCalculator; helpString += "The collect.single command parameters are list, sabund, rabund, shared, label, freq, calc and abund. list, sabund, rabund or shared is required unless you have a valid current file. \n"; helpString += "The collect.single command should be in the following format: \n"; helpString += "The freq parameter is used indicate when to output your data, by default it is set to 100. But you can set it to a percentage of the number of sequence. For example freq=0.10, means 10%. \n"; helpString += "collect.single(label=yourLabel, iters=yourIters, freq=yourFreq, calc=yourEstimators).\n"; helpString += "Example collect(label=unique-.01-.03, iters=10000, freq=10, calc=sobs-chao-ace-jack).\n"; helpString += "The default values for freq is 100, and calc are sobs-chao-ace-jack-shannon-npshannon-simpson.\n"; - helpString += validCalculator->printCalc("single"); + helpString += validCalculator.printCalc("single"); helpString += "The label parameter is used to analyze specific labels in your input.\n"; - helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n"; return helpString; } catch(exception& e) { @@ -123,7 +124,7 @@ CollectCommand::CollectCommand(string option) { allLines = 1; //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; } + if(option == "help") { help(); abort = true; } else { vector myArray = setParameters(); @@ -310,10 +311,10 @@ int CollectCommand::execute(){ m->mothurOutEndLine(); m->mothurOut("Processing group " + groups[p]); m->mothurOutEndLine(); m->mothurOutEndLine(); } - validCalculator = new ValidCalculators(); + ValidCalculators validCalculator; for (int i=0; iisValidCalculator("single", Estimators[i]) == true) { + if (validCalculator.isValidCalculator("single", Estimators[i]) == true) { if (Estimators[i] == "sobs") { cDisplays.push_back(new CollectDisplay(new Sobs(), new OneColumnFile(fileNameRoot+"sobs"))); outputNames.push_back(fileNameRoot+"sobs"); outputTypes["sobs"].push_back(fileNameRoot+"sobs"); @@ -409,7 +410,6 @@ int CollectCommand::execute(){ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear(); delete input; delete order; - delete validCalculator; m->Groups.clear(); return 0; } @@ -422,7 +422,6 @@ int CollectCommand::execute(){ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear(); delete input; delete order; - delete validCalculator; m->Groups.clear(); return 0; } @@ -471,7 +470,6 @@ int CollectCommand::execute(){ for(int i=0;iGroups.clear(); return 0; } @@ -504,8 +502,7 @@ int CollectCommand::execute(){ for(int i=0;iGroups.clear(); return 0; } @@ -515,7 +512,6 @@ int CollectCommand::execute(){ for(int i=0;icontrol_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }