X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=removelineagecommand.cpp;h=9fec2496068950b4863448fe500b17cbc957670a;hb=36cea83f926066127bf856e7eae1a70ce7e796d0;hp=b72f4b669d43b4b44fa1c20df4812155aaff82fc;hpb=19fcbbdba99658f5eca244803280f9ee7f9f6607;p=mothur.git diff --git a/removelineagecommand.cpp b/removelineagecommand.cpp index b72f4b6..9fec249 100644 --- a/removelineagecommand.cpp +++ b/removelineagecommand.cpp @@ -169,12 +169,12 @@ RemoveLineageCommand::RemoveLineageCommand(string option) { //check for required parameters fastafile = validParameter.validFile(parameters, "fasta", true); - if (fastafile == "not open") { abort = true; } + if (fastafile == "not open") { fastafile = ""; abort = true; } else if (fastafile == "not found") { fastafile = ""; } else { m->setFastaFile(fastafile); } 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); } @@ -193,7 +193,7 @@ RemoveLineageCommand::RemoveLineageCommand(string option) { else { m->setListFile(listfile); } taxfile = validParameter.validFile(parameters, "taxonomy", true); - if (taxfile == "not open") { abort = true; } + if (taxfile == "not open") { taxfile = ""; abort = true; } else if (taxfile == "not found") { taxfile = m->getTaxonomyFile(); if (taxfile != "") { m->mothurOut("Using " + taxfile + " as input file for the taxonomy parameter."); m->mothurOutEndLine(); } @@ -220,7 +220,12 @@ RemoveLineageCommand::RemoveLineageCommand(string option) { if ((fastafile == "") && (namefile == "") && (groupfile == "") && (alignfile == "") && (listfile == "") && (taxfile == "")) { m->mothurOut("You must provide one of the following: fasta, name, group, alignreport, taxonomy or listfile."); m->mothurOutEndLine(); abort = true; } if ((usedDups != "") && (namefile == "")) { m->mothurOut("You may only use dups with the name option."); m->mothurOutEndLine(); abort = true; } - + + if ((namefile == "") && ((fastafile != "") || (taxfile != ""))){ + vector files; files.push_back(fastafile); files.push_back(taxfile); + parser.getNameFile(files); + } + } } @@ -555,7 +560,8 @@ int RemoveLineageCommand::readTax(){ if (hasConPos != string::npos) { taxonsHasConfidence[i] = true; searchTaxons[i] = getTaxons(listOfTaxons[i]); - noConfidenceTaxons[i] = removeConfidences(listOfTaxons[i]); + noConfidenceTaxons[i] = listOfTaxons[i]; + m->removeConfidences(noConfidenceTaxons[i]); } } @@ -577,7 +583,8 @@ int RemoveLineageCommand::readTax(){ int hasConfidences = tax.find_first_of('('); if (hasConfidences != string::npos) { - newtax = removeConfidences(tax); + newtax = tax; + m->removeConfidences(newtax); } int pos = newtax.find(noConfidenceTaxons[j]); @@ -609,7 +616,8 @@ int RemoveLineageCommand::readTax(){ string noNewTax = tax; int hasConfidences = tax.find_first_of('('); if (hasConfidences != string::npos) { - noNewTax = removeConfidences(tax); + noNewTax = tax; + m->removeConfidences(noNewTax); } int pos = noNewTax.find(noConfidenceTaxons[j]); @@ -726,29 +734,6 @@ vector< map > RemoveLineageCommand::getTaxons(string tax) { exit(1); } } -/**************************************************************************************************/ -string RemoveLineageCommand::removeConfidences(string tax) { - try { - - string taxon = ""; - int taxLength = tax.length(); - for(int i=0;ierrorOut(e, "RemoveLineageCommand", "removeConfidences"); - exit(1); - } -} //********************************************************************************************************************** //alignreport file has a column header line then all other lines contain 16 columns. we just want the first column since that contains the name int RemoveLineageCommand::readAlign(){