X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rarefactcommand.cpp;h=c4a104b6c2d10468777fe673567de1c05544a1a9;hb=16f9c4ab6f39769856b13e048eae2c8eaa413c02;hp=0fdd0798e2cdda014a6cc568d3a1c895362c3158;hpb=050e1297eaf24fabbbe0e9b76c3a5acfb90eed7d;p=mothur.git diff --git a/rarefactcommand.cpp b/rarefactcommand.cpp index 0fdd079..c4a104b 100644 --- a/rarefactcommand.cpp +++ b/rarefactcommand.cpp @@ -56,7 +56,7 @@ string RareFactCommand::getHelpString(){ try { ValidCalculators validCalculator; string helpString = ""; - helpString += "The rarefaction.single command parameters are list, sabund, rabund, shared, label, iters, freq, calc, processors and abund. list, sabund, rabund or shared is required unless you have a valid current file. \n"; + helpString += "The rarefaction.single command parameters are list, sabund, rabund, shared, label, iters, freq, calc, processors, groupmode and abund. list, sabund, rabund or shared is required unless you have a valid current file. \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 += "The processors parameter allows you to specify the number of processors to use. The default is 1.\n"; helpString += "The rarefaction.single command should be in the following format: \n"; @@ -74,6 +74,39 @@ string RareFactCommand::getHelpString(){ exit(1); } } +//********************************************************************************************************************** +string RareFactCommand::getOutputFileNameTag(string type, string inputName=""){ + try { + string outputFileName = ""; + map >::iterator it; + + //is this a type this command creates + it = outputTypes.find(type); + if (it == outputTypes.end()) { m->mothurOut("[ERROR]: this command doesn't create a " + type + " output file.\n"); } + else { + if (type == "rarefaction") { outputFileName = "rarefaction"; } + else if (type == "r_chao") { outputFileName = "r_chao"; } + else if (type == "r_ace") { outputFileName = "r_ace"; } + else if (type == "r_jack") { outputFileName = "r_jack"; } + else if (type == "r_shannon") { outputFileName = "r_shannon"; } + else if (type == "r_shannoneven") { outputFileName = "r_shannoneven"; } + else if (type == "r_smithwilson") { outputFileName = "r_smithwilson"; } + else if (type == "r_npshannon") { outputFileName = "r_npshannon"; } + else if (type == "r_simpson") { outputFileName = "r_simpson"; } + else if (type == "r_simpsoneven") { outputFileName = "r_simpsoneven"; } + else if (type == "r_invsimpson") { outputFileName = "r_invsimpson"; } + else if (type == "r_bootstrap") { outputFileName = "r_bootstrap"; } + else if (type == "r_coverage") { outputFileName = "r_coverage"; } + else if (type == "r_nseqs") { outputFileName = "r_nseqs"; } + else { m->mothurOut("[ERROR]: No definition for type " + type + " output file tag.\n"); m->control_pressed = true; } + } + return outputFileName; + } + catch(exception& e) { + m->errorOut(e, "RareFactCommand", "getOutputFileNameTag"); + exit(1); + } +} //********************************************************************************************************************** RareFactCommand::RareFactCommand(){ @@ -305,52 +338,52 @@ int RareFactCommand::execute(){ for (i=0; i 1) { file2Group[outputNames.size()-1] = groups[p]; } }