X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=heatmapcommand.cpp;h=04f12456a49b623a82bf3e009929d7a31870da35;hb=315e38cf393c82be238da5b32574f225a020d25c;hp=1992ce593a7e65c2638f7d5ac0c5f39e4f50b5f9;hpb=c99f3846e7a7b6f06ab46508baa5409204ad6290;p=mothur.git diff --git a/heatmapcommand.cpp b/heatmapcommand.cpp index 1992ce5..04f1245 100644 --- a/heatmapcommand.cpp +++ b/heatmapcommand.cpp @@ -24,7 +24,7 @@ HeatMapCommand::HeatMapCommand(string option){ else { //valid paramters for this command - string AlignArray[] = {"groups","label","sorted","scale"}; + string AlignArray[] = {"groups","label","sorted","scale","outputdir","inputdir"}; vector myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string))); OptionParser parser(option); @@ -37,6 +37,12 @@ HeatMapCommand::HeatMapCommand(string 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->inputFileName); //if user entered a file with a path then preserve it + } + //make sure the user has already run the read.otu command if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "") && (globaldata->getSharedFile() == "")) { mothurOut("You must read a list, rabund, sabund, or a list and a group, or a shared before you can use the heatmap.bin command."); mothurOutEndLine(); abort = true; @@ -69,7 +75,7 @@ HeatMapCommand::HeatMapCommand(string option){ scale = validParameter.validFile(parameters, "scale", false); if (scale == "not found") { scale = "log10"; } if (abort == false) { - heatmap = new HeatMap(sorted, scale); + heatmap = new HeatMap(sorted, scale, outputDir); format = globaldata->getFormat(); } }