exit(1);
}
}
+//**********************************************************************************************************************
+string ParsimonyCommand::getOutputFileNameTag(string type, string inputName=""){
+ try {
+ string outputFileName = "";
+ map<string, vector<string> >::iterator it;
+
+ //is this a type this command creates
+ it = outputTypes.find(type);
+ if (it == outputTypes.end()) { m->mothurOut("[ERROR]: this command doesn't create a " + type + " output file.\n"); }
+ else {
+ if (type == "parsimony") { outputFileName = "parsimony"; }
+ else if (type == "psummary") { outputFileName = "psummary"; }
+ else { m->mothurOut("[ERROR]: No definition for type " + type + " output file tag.\n"); m->control_pressed = true; }
+ }
+ return outputFileName;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ParsimonyCommand", "getOutputFileNameTag");
+ exit(1);
+ }
+}
//**********************************************************************************************************************
ParsimonyCommand::ParsimonyCommand(){
delete reader;
if(outputDir == "") { outputDir += m->hasPath(treefile); }
- output = new ColumnFile(outputDir + m->getSimpleName(treefile) + ".parsimony", itersString);
- outputNames.push_back(outputDir + m->getSimpleName(treefile) + ".parsimony");
- outputTypes["parsimony"].push_back(outputDir + m->getSimpleName(treefile) + ".parsimony");
+ output = new ColumnFile(outputDir + m->getSimpleName(treefile) + "." + getOutputFileNameTag("parsimony"), itersString);
+ outputNames.push_back(outputDir + m->getSimpleName(treefile) + "." + getOutputFileNameTag("parsimony"));
+ outputTypes["parsimony"].push_back(outputDir + m->getSimpleName(treefile) + "." + getOutputFileNameTag("parsimony"));
- sumFile = outputDir + m->getSimpleName(treefile) + ".psummary";
+ sumFile = outputDir + m->getSimpleName(treefile) + "." + getOutputFileNameTag("psummary");
m->openOutputFile(sumFile, outSum);
outputNames.push_back(sumFile);
outputTypes["psummary"].push_back(sumFile);