X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rarefactsharedcommand.cpp;fp=rarefactsharedcommand.cpp;h=0be8141636a1fffaacce16f2592e6bf8738ad400;hb=8bc3e5b38c2317a1715f53be22fa96455868c281;hp=c0f5ec0c4daba141c9267817836522e0d22c1a3a;hpb=f663afa231c9bc1b5e18e0ea3bdd2b2ee784f5b2;p=mothur.git diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index c0f5ec0..0be8141 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -11,6 +11,54 @@ #include "sharedsobs.h" #include "sharednseqs.h" +//********************************************************************************************************************** +vector RareFactSharedCommand::getValidParameters(){ + try { + string Array[] = {"iters","freq","label","calc","groups", "jumble","outputdir","inputdir"}; + vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); + return myArray; + } + catch(exception& e) { + m->errorOut(e, "RareFactSharedCommand", "getValidParameters"); + exit(1); + } +} +//********************************************************************************************************************** +RareFactSharedCommand::RareFactSharedCommand(){ + try { + //initialize outputTypes + vector tempOutNames; + outputTypes["sharedrarefaction"] = tempOutNames; + outputTypes["sharedr_nseqs"] = tempOutNames; + } + catch(exception& e) { + m->errorOut(e, "RareFactSharedCommand", "RareFactSharedCommand"); + exit(1); + } +} +//********************************************************************************************************************** +vector RareFactSharedCommand::getRequiredParameters(){ + try { + vector myArray; + return myArray; + } + catch(exception& e) { + m->errorOut(e, "RareFactSharedCommand", "getRequiredParameters"); + exit(1); + } +} +//********************************************************************************************************************** +vector RareFactSharedCommand::getRequiredFiles(){ + try { + string Array[] = {"shared"}; + vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); + return myArray; + } + catch(exception& e) { + m->errorOut(e, "RareFactSharedCommand", "getRequiredFiles"); + exit(1); + } +} //********************************************************************************************************************** RareFactSharedCommand::RareFactSharedCommand(string option) { @@ -41,6 +89,11 @@ RareFactSharedCommand::RareFactSharedCommand(string option) { if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; } } + //initialize outputTypes + vector tempOutNames; + outputTypes["sharedrarefaction"] = tempOutNames; + outputTypes["sharedr_nseqs"] = tempOutNames; + //make sure the user has already run the read.otu command if (globaldata->getSharedFile() == "") { if (globaldata->getListFile() == "") { m->mothurOut("You must read a list and a group, or a shared before you can use the collect.shared command."); m->mothurOutEndLine(); abort = true; } @@ -107,10 +160,10 @@ RareFactSharedCommand::RareFactSharedCommand(string option) { if (validCalculator->isValidCalculator("sharedrarefaction", Estimators[i]) == true) { if (Estimators[i] == "sharedobserved") { rDisplays.push_back(new RareDisplay(new SharedSobs(), new SharedThreeColumnFile(fileNameRoot+"shared.rarefaction", ""))); - outputNames.push_back(fileNameRoot+"shared.rarefaction"); + outputNames.push_back(fileNameRoot+"shared.rarefaction"); outputTypes["sharedrarefaction"].push_back(fileNameRoot+"shared.rarefaction"); }else if (Estimators[i] == "sharednseqs") { rDisplays.push_back(new RareDisplay(new SharedNSeqs(), new SharedThreeColumnFile(fileNameRoot+"shared.r_nseqs", ""))); - outputNames.push_back(fileNameRoot+"shared.r_nseqs"); + outputNames.push_back(fileNameRoot+"shared.r_nseqs"); outputTypes["sharedr_nseqs"].push_back(fileNameRoot+"shared.r_nseqs"); } } }