else {
//valid paramters for this command
- string Array[] = {"iters","groups","step","form","cutoff"};
+ string Array[] = {"iters","groups","step","form","cutoff","outputdir","inputdir"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
}
+ //if the user changes the output directory command factory will send this info to us in the output parameter
+ outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){
+ outputDir = "";
+ outputDir += hasPath(globaldata->getPhylipFile()); //if user entered a file with a path then preserve it
+ }
+
//make sure the user has already run the read.dist command
if ((globaldata->gMatrix == NULL) || (globaldata->gGroupmap == NULL)) {
mothurOut("You must read in a matrix and groupfile using the read.dist command, before you use the libshuff command. "); mothurOutEndLine(); abort = true;;
try {
ofstream outCov;
- summaryFile = getRootName(globaldata->getPhylipFile()) + "libshuff.coverage";
+ summaryFile = outputDir + getRootName(getSimpleName(globaldata->getPhylipFile())) + "libshuff.coverage";
openOutputFile(summaryFile, outCov);
outCov.setf(ios::fixed, ios::floatfield); outCov.setf(ios::showpoint);
//cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint);
try {
ofstream outSum;
- summaryFile = getRootName(globaldata->getPhylipFile()) + "libshuff.summary";
+ summaryFile = outputDir + getRootName(getSimpleName(globaldata->getPhylipFile())) + "libshuff.summary";
openOutputFile(summaryFile, outSum);
outSum.setf(ios::fixed, ios::floatfield); outSum.setf(ios::showpoint);