#include "sharedmorisitahorn.h"
#include "sharedbraycurtis.h"
-
+//**********************************************************************************************************************
+vector<string> TreeGroupCommand::getValidParameters(){
+ try {
+ string Array[] = {"label","calc","groups", "phylip", "column", "name", "precision","cutoff","outputdir","inputdir"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "TreeGroupCommand", "getValidParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+TreeGroupCommand::TreeGroupCommand(){
+ try {
+ abort = true;
+ globaldata = GlobalData::getInstance();
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["tree"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "TreeGroupCommand", "TreeGroupCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> TreeGroupCommand::getRequiredParameters(){
+ try {
+ vector<string> myArray;
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "TreeGroupCommand", "getRequiredParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> TreeGroupCommand::getRequiredFiles(){
+ try {
+ string Array[] = {"phylip","column","shared","or"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "TreeGroupCommand", "getRequiredFiles");
+ exit(1);
+ }
+}
//**********************************************************************************************************************
TreeGroupCommand::TreeGroupCommand(string option) {
if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
}
- globaldata->newRead();
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["tree"] = tempOutNames;
//if the user changes the input directory command factory will send this info to us in the output parameter
string inputDir = validParameter.validFile(parameters, "inputdir", false);
phylipfile = validParameter.validFile(parameters, "phylip", true);
if (phylipfile == "not open") { abort = true; }
else if (phylipfile == "not found") { phylipfile = ""; }
- else { format = "phylip"; globaldata->setPhylipFile(phylipfile); }
+ else { globaldata->newRead(); format = "phylip"; globaldata->setPhylipFile(phylipfile); }
columnfile = validParameter.validFile(parameters, "column", true);
if (columnfile == "not open") { abort = true; }
else if (columnfile == "not found") { columnfile = ""; }
- else { format = "column"; globaldata->setColumnFile(columnfile); }
+ else { globaldata->newRead(); format = "column"; globaldata->setColumnFile(columnfile); }
namefile = validParameter.validFile(parameters, "name", true);
if (namefile == "not open") { abort = true; }
//create a new filename
outputFile = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "tre";
- outputNames.push_back(outputFile);
+ outputNames.push_back(outputFile); outputTypes["tree"].push_back(outputFile);
createTree();
//create a new filename
outputFile = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + treeCalculators[i]->getName() + "." + thisLookup[0]->getLabel() + ".tre";
- outputNames.push_back(outputFile);
+ outputNames.push_back(outputFile); outputTypes["tree"].push_back(outputFile);
for (int k = 0; k < thisLookup.size(); k++) {
for (int l = k; l < thisLookup.size(); l++) {