X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=heatmapcommand.cpp;h=441eaf8a4dc4e77beb36c7e39c102f9aa13f0d53;hb=9b53f130ac9af5e95444ce2e817fce25ed19ff03;hp=57c4c86b44bf2ccf9368c2c8c26acc1e67d360af;hpb=55386dddad84cc1140d736cabaf4dd0ae16f2e01;p=mothur.git diff --git a/heatmapcommand.cpp b/heatmapcommand.cpp index 57c4c86..441eaf8 100644 --- a/heatmapcommand.cpp +++ b/heatmapcommand.cpp @@ -61,6 +61,28 @@ string HeatMapCommand::getHelpString(){ } } +//********************************************************************************************************************** + +string HeatMapCommand::getOutputFileNameTag(string type, string inputName=""){ + try { + string outputFileName = ""; + map >::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 == "svg") { outputFileName = "svg"; } + 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, "HeatMapCommand", "getOutputFileNameTag"); + exit(1); + } +} + //********************************************************************************************************************** HeatMapCommand::HeatMapCommand(){ try { @@ -151,27 +173,27 @@ HeatMapCommand::HeatMapCommand(string option) { //check for required parameters listfile = validParameter.validFile(parameters, "list", true); - if (listfile == "not open") { listfile = ""; abort = true; } + if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } else { format = "list"; inputfile = listfile; m->setListFile(listfile); } sabundfile = validParameter.validFile(parameters, "sabund", true); - if (sabundfile == "not open") { sabundfile = ""; abort = true; } + if (sabundfile == "not open") { abort = true; } else if (sabundfile == "not found") { sabundfile = ""; } else { format = "sabund"; inputfile = sabundfile; m->setSabundFile(sabundfile); } rabundfile = validParameter.validFile(parameters, "rabund", true); - if (rabundfile == "not open") { rabundfile = ""; abort = true; } + if (rabundfile == "not open") { abort = true; } else if (rabundfile == "not found") { rabundfile = ""; } else { format = "rabund"; inputfile = rabundfile; m->setRabundFile(rabundfile); } sharedfile = validParameter.validFile(parameters, "shared", true); - if (sharedfile == "not open") { sharedfile = ""; abort = true; } + if (sharedfile == "not open") { abort = true; } else if (sharedfile == "not found") { sharedfile = ""; } else { format = "sharedfile"; inputfile = sharedfile; m->setSharedFile(sharedfile); } relabundfile = validParameter.validFile(parameters, "relabund", true); - if (relabundfile == "not open") { relabundfile = ""; abort = true; } + if (relabundfile == "not open") { abort = true; } else if (relabundfile == "not found") { relabundfile = ""; } else { format = "relabund"; inputfile = relabundfile; m->setRelAbundFile(relabundfile); } @@ -226,10 +248,10 @@ HeatMapCommand::HeatMapCommand(string option) { } string temp = validParameter.validFile(parameters, "numotu", false); if (temp == "not found") { temp = "0"; } - convert(temp, numOTU); + m->mothurConvert(temp, numOTU); temp = validParameter.validFile(parameters, "fontsize", false); if (temp == "not found") { temp = "24"; } - convert(temp, fontSize); + m->mothurConvert(temp, fontSize); sorted = validParameter.validFile(parameters, "sorted", false); if (sorted == "not found") {