X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=classifyotucommand.cpp;h=ec22de8b35762adf92e2a3b750198dcbb91f0396;hb=e339f9008daa7d37c9a9034829565620a6abe783;hp=f36631a0590725867dffc402f74fd73af6168e20;hpb=74dc92cf53df65fd8b14d8eaf35489bbecbccac6;p=mothur.git diff --git a/classifyotucommand.cpp b/classifyotucommand.cpp index f36631a..ec22de8 100644 --- a/classifyotucommand.cpp +++ b/classifyotucommand.cpp @@ -182,7 +182,7 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option) { else if (refTaxonomy == "not open") { abort = true; } 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 { m->setNameFile(namefile); } @@ -206,7 +206,7 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option) { if ((basis != "otu") && (basis != "sequence")) { m->mothurOut("Invalid option for basis. basis options are otu and sequence, using otu."); m->mothurOutEndLine(); } string temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "51"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); temp = validParameter.validFile(parameters, "probs", false); if (temp == "not found"){ temp = "true"; } probs = m->isTrue(temp); @@ -214,6 +214,11 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option) { if ((cutoff < 51) || (cutoff > 100)) { m->mothurOut("cutoff must be above 50, and no greater than 100."); m->mothurOutEndLine(); abort = true; } + if (namefile == ""){ + vector files; files.push_back(taxfile); + parser.getNameFile(files); + } + } } catch(exception& e) { @@ -470,6 +475,9 @@ vector ClassifyOtuCommand::findConsensusTaxonomy(int bin, ListVector* th } } + + //phylotree adds an extra unknown so we want to remove that + if (bestChild.name == "unknown") { bestChildSize--; } //is this taxonomy above cutoff int consensusConfidence = ceil((bestChildSize / (float) size) * 100);