X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=consensuscommand.cpp;h=9b72638662e4001963b9219f4c5f313010774797;hb=5d6d303e481489e226fdf8d6c5385b99b50718bc;hp=2fef5b16a062ed99cd90c2fc43e7617c25d5ee13;hpb=e0fbf58358a72f20352cf2a43922ab6b5bdf0cf8;p=mothur.git diff --git a/consensuscommand.cpp b/consensuscommand.cpp index 2fef5b1..9b72638 100644 --- a/consensuscommand.cpp +++ b/consensuscommand.cpp @@ -9,6 +9,54 @@ #include "consensuscommand.h" +//********************************************************************************************************************** +vector ConcensusCommand::getValidParameters(){ + try { + vector myArray; + return myArray; + } + catch(exception& e) { + m->errorOut(e, "ConcensusCommand", "getValidParameters"); + exit(1); + } +} +//********************************************************************************************************************** +vector ConcensusCommand::getRequiredParameters(){ + try { + vector myArray; + return myArray; + } + catch(exception& e) { + m->errorOut(e, "ConcensusCommand", "getRequiredParameters"); + exit(1); + } +} +//********************************************************************************************************************** +vector ConcensusCommand::getRequiredFiles(){ + try { + string AlignArray[] = {"tree","group"}; + vector myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string))); + return myArray; + } + catch(exception& e) { + m->errorOut(e, "ConcensusCommand", "getRequiredFiles"); + exit(1); + } +} +//********************************************************************************************************************** +ConcensusCommand::ConcensusCommand(){ + try { + abort = true; + //initialize outputTypes + vector tempOutNames; + outputTypes["tree"] = tempOutNames; + outputTypes["nodepairs"] = tempOutNames; + } + catch(exception& e) { + m->errorOut(e, "ConcensusCommand", "ConcensusCommand"); + exit(1); + } +} //********************************************************************************************************************** ConcensusCommand::ConcensusCommand(string fileroot) { @@ -16,6 +64,11 @@ ConcensusCommand::ConcensusCommand(string fileroot) { globaldata = GlobalData::getInstance(); abort = false; + //initialize outputTypes + vector tempOutNames; + outputTypes["tree"] = tempOutNames; + outputTypes["nodepairs"] = tempOutNames; + filename = fileroot; t = globaldata->gTree; @@ -67,8 +120,8 @@ int ConcensusCommand::execute(){ if (m->control_pressed) { return 0; } //open file for pairing not included in the tree - notIncluded = filename + ".cons.pairs"; - openOutputFile(notIncluded, out2); + notIncluded = filename + ".cons.pairs"; outputNames.push_back(notIncluded); outputTypes["nodepairs"].push_back(notIncluded); + m->openOutputFile(notIncluded, out2); consensusTree = new Tree(); @@ -150,10 +203,10 @@ int ConcensusCommand::execute(){ out2 << '\t' << it2->second << endl; } - outputFile = filename + ".cons.tre"; - openOutputFile(outputFile, out); + outputFile = filename + ".cons.tre"; outputNames.push_back(outputFile); outputTypes["tree"].push_back(outputFile); + m->openOutputFile(outputFile, out); - consensusTree->printForBoot(out); + consensusTree->print(out, "boot"); out.close(); out2.close();