X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=venncommand.cpp;h=c918500270a537ac909326f3edc10ad068dc3ac5;hb=006601d68abe8d0061f77e8d28323b160750e343;hp=b5b401de349fcf9d57253582d7c68d9c6cd3f99a;hpb=0718c426add1df69adcc24444ef45550fb262ca7;p=mothur.git diff --git a/venncommand.cpp b/venncommand.cpp index b5b401d..c918500 100644 --- a/venncommand.cpp +++ b/venncommand.cpp @@ -66,6 +66,27 @@ string VennCommand::getHelpString(){ exit(1); } } +//********************************************************************************************************************** + +string VennCommand::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 == "svg") { outputFileName = "svg"; } + 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, "VennCommand", "getOutputFileNameTag"); + exit(1); + } +} //********************************************************************************************************************** VennCommand::VennCommand(){ @@ -193,7 +214,7 @@ VennCommand::VennCommand(string option) { string temp; temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; } - convert(temp, abund); + m->mothurConvert(temp, abund); temp = validParameter.validFile(parameters, "nseqs", false); if (temp == "not found"){ temp = "f"; } nseqs = m->isTrue(temp); @@ -202,7 +223,7 @@ VennCommand::VennCommand(string option) { perm = m->isTrue(temp); temp = validParameter.validFile(parameters, "fontsize", false); if (temp == "not found") { temp = "24"; } - convert(temp, fontsize); + m->mothurConvert(temp, fontsize); } @@ -229,8 +250,7 @@ int VennCommand::execute(){ }else if (Estimators[i] == "chao") { vennCalculators.push_back(new Chao1()); }else if (Estimators[i] == "ace") { - if(abund < 5) - abund = 10; + if(abund < 5) { abund = 10; } vennCalculators.push_back(new Ace(abund)); } }