X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=clusterdoturcommand.cpp;h=5bcfe03416f90700a02a4ff3d58ad312f788bb96;hb=d0954e27635712cdbd8b86e3c4510670803a2665;hp=56fbd5c0d6c2b8e9380959bd6ba97435b28fcd70;hpb=89f19f9c6ab89c2f6c7c6921a328ae87bce6f8e3;p=mothur.git diff --git a/clusterdoturcommand.cpp b/clusterdoturcommand.cpp index 56fbd5c..5bcfe03 100644 --- a/clusterdoturcommand.cpp +++ b/clusterdoturcommand.cpp @@ -25,8 +25,7 @@ vector ClusterDoturCommand::getValidParameters(){ //********************************************************************************************************************** ClusterDoturCommand::ClusterDoturCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["list"] = tempOutNames; outputTypes["rabund"] = tempOutNames; @@ -65,10 +64,10 @@ vector ClusterDoturCommand::getRequiredFiles(){ ClusterDoturCommand::ClusterDoturCommand(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 @@ -189,7 +188,7 @@ ClusterDoturCommand::~ClusterDoturCommand(){} int ClusterDoturCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if(namefile != ""){ nameMap = new NameAssignment(namefile); @@ -272,6 +271,25 @@ int ClusterDoturCommand::execute(){ // m->mothurOut("changed cutoff to " + toString(cutoff)); m->mothurOutEndLine(); //} + //set list file as new current listfile + string current = ""; + itTypes = outputTypes.find("list"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setListFile(current); } + } + + //set rabund file as new current rabundfile + itTypes = outputTypes.find("rabund"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setRabundFile(current); } + } + + //set sabund file as new current sabundfile + itTypes = outputTypes.find("sabund"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setSabundFile(current); } + } + m->mothurOutEndLine(); m->mothurOut("Output File Names: "); m->mothurOutEndLine(); for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }