X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=phylotypecommand.cpp;h=1d6c391de69c83a86971873577a0df0b21efdbcd;hb=8dd3c225255d7084e3aff8740aa4f1f1cabb367a;hp=70f2b2f4e93df4af17aabdd804103a99ef696cf6;hpb=1d898dc6edaf9e9f287fab53bf1f21fb29757a17;p=mothur.git diff --git a/phylotypecommand.cpp b/phylotypecommand.cpp index 70f2b2f..1d6c391 100644 --- a/phylotypecommand.cpp +++ b/phylotypecommand.cpp @@ -76,6 +76,7 @@ PhylotypeCommand::PhylotypeCommand(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(); @@ -127,12 +128,13 @@ PhylotypeCommand::PhylotypeCommand(string option) { m->mothurOut("No valid current files. taxonomy is a required parameter."); m->mothurOutEndLine(); abort = true; } - }else if (taxonomyFileName == "not open") { abort = true; } + }else if (taxonomyFileName == "not open") { taxonomyFileName = ""; abort = true; } + else { m->setTaxonomyFile(taxonomyFileName); } namefile = validParameter.validFile(parameters, "name", true); - if (namefile == "not open") { abort = true; } + if (namefile == "not open") { namefile = ""; abort = true; } else if (namefile == "not found") { namefile = ""; } - else { readNamesFile(); } + else { readNamesFile(); m->setNameFile(namefile); } //if the user changes the output directory command factory will send this info to us in the output parameter outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ @@ -142,7 +144,7 @@ PhylotypeCommand::PhylotypeCommand(string option) { string temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "-1"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); label = validParameter.validFile(parameters, "label", false); if (label == "not found") { label = ""; allLines = 1; } @@ -151,6 +153,11 @@ PhylotypeCommand::PhylotypeCommand(string option) { else { allLines = 1; } } + if (namefile == "") { + vector files; files.push_back(taxonomyFileName); + parser.getNameFile(files); + } + } } catch(exception& e) { @@ -213,7 +220,7 @@ int PhylotypeCommand::execute(){ if (m->control_pressed) { outRabund.close(); outSabund.close(); outList.close(); - for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } + for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } delete tree; return 0; } @@ -284,7 +291,7 @@ int PhylotypeCommand::execute(){ delete tree; if (m->control_pressed) { - for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } + for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }