X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=removegroupscommand.cpp;h=34a072b30a0b563fd22ddef60099224bdc6bf9f0;hb=a4f05f09c250323132a4b9427f41a3ededaec634;hp=6042bbecebf848b7a37d158293dc7650d2587c51;hpb=5c076cc7d3842d8050694918948e023334c9839e;p=mothur.git diff --git a/removegroupscommand.cpp b/removegroupscommand.cpp index 6042bbe..34a072b 100644 --- a/removegroupscommand.cpp +++ b/removegroupscommand.cpp @@ -27,8 +27,7 @@ vector RemoveGroupsCommand::getValidParameters(){ //********************************************************************************************************************** RemoveGroupsCommand::RemoveGroupsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["taxonomy"] = tempOutNames; @@ -67,10 +66,10 @@ vector RemoveGroupsCommand::getRequiredFiles(){ //********************************************************************************************************************** RemoveGroupsCommand::RemoveGroupsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -222,7 +221,7 @@ void RemoveGroupsCommand::help(){ int RemoveGroupsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } groupMap = new GroupMap(groupfile); groupMap->readMap(); @@ -259,6 +258,33 @@ int RemoveGroupsCommand::execute(){ m->mothurOut("Output File names: "); m->mothurOutEndLine(); for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); } m->mothurOutEndLine(); + + //set fasta file as new current fastafile + string current = ""; + itTypes = outputTypes.find("fasta"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setFastaFile(current); } + } + + itTypes = outputTypes.find("name"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setNameFile(current); } + } + + itTypes = outputTypes.find("group"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setGroupFile(current); } + } + + itTypes = outputTypes.find("list"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setListFile(current); } + } + + itTypes = outputTypes.find("taxonomy"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setTaxonomyFile(current); } + } } return 0; @@ -588,6 +614,8 @@ int RemoveGroupsCommand::fillNames(){ names.insert(seqs[i]); } } + + return 0; } catch(exception& e) { m->errorOut(e, "RemoveGroupsCommand", "fillNames");