else {
//valid paramters for this command
- string AlignArray[] = {"groups","label","sorted","scale"};
+ string AlignArray[] = {"groups","label","sorted","scale","outputdir","inputdir"};
vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/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->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;
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();
}
}
}
if ((anyLabelsToProcess(lookup[0]->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
+ string saveLabel = lookup[0]->getLabel();
+
for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; }
lookup = input->getSharedRAbundVectors(lastLabel);
mothurOut(lookup[0]->getLabel()); mothurOutEndLine();
processedLabels.insert(lookup[0]->getLabel());
userLabels.erase(lookup[0]->getLabel());
+
+ //restore real lastlabel to save below
+ lookup[0]->setLabel(saveLabel);
}
lastLabel = lookup[0]->getLabel();
}
if ((anyLabelsToProcess(rabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
-
+ string saveLabel = rabund->getLabel();
+
delete rabund;
rabund = input->getRAbundVector(lastLabel);
mothurOut(rabund->getLabel()); mothurOutEndLine();
processedLabels.insert(rabund->getLabel());
userLabels.erase(rabund->getLabel());
+
+ //restore real lastlabel to save below
+ rabund->setLabel(saveLabel);
}