X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=heatmapsim.cpp;h=62965f9a3291d0052b6c216b6a800d6c97072f46;hp=9c5e780703a7d4f8d9117e38dddb693a40337bb0;hb=b206f634aae1b4ce13978d203247fb64757d5482;hpb=ca9ac1d80c62f57270b0dcd49410ebe08a8aecd6 diff --git a/heatmapsim.cpp b/heatmapsim.cpp index 9c5e780..62965f9 100644 --- a/heatmapsim.cpp +++ b/heatmapsim.cpp @@ -20,7 +20,7 @@ #include "sharedbraycurtis.h" //********************************************************************************************************************** -HeatMapSim::HeatMapSim(string dir, string i) : outputDir(dir), inputfile(i) { +HeatMapSim::HeatMapSim(string dir, string i, int f) : outputDir(dir), inputfile(i), fontSize(f) { m = MothurOut::getInstance(); } //********************************************************************************************************************** @@ -35,7 +35,7 @@ vector HeatMapSim::getPic(vector lookup, vectorcontrol_pressed) { return outputNames; } - string filenamesvg = outputDir + m->getRootName(m->getSimpleName(inputfile)) + lookup[0]->getLabel() + calcs[k]->getName() + ".heatmap.sim.svg"; + string filenamesvg = outputDir + m->getRootName(m->getSimpleName(inputfile)) + lookup[0]->getLabel() + "." + calcs[k]->getName() + ".heatmap.sim.svg"; m->openOutputFile(filenamesvg, outsvg); outputNames.push_back(filenamesvg); @@ -45,12 +45,12 @@ vector HeatMapSim::getPic(vector lookup, vector"; - outsvg << "Heatmap at distance " + lookup[0]->getLabel() + "\n"; + outsvg << "Heatmap at distance " + lookup[0]->getLabel() + "\n"; //column labels for (int h = 0; h < lookup.size(); h++) { - outsvg << "getGroup().length() / 2)) + "\" y=\"50\">" + lookup[h]->getGroup() + "\n"; - outsvg << "getGroup().length() / 2)) + "\" x=\"50\">" + lookup[h]->getGroup() + "\n"; + outsvg << "getGroup().length() / 2)) + "\" y=\"50\">" + lookup[h]->getGroup() + "\n"; + outsvg << "getGroup().length() / 2)) + "\" x=\"50\">" + lookup[h]->getGroup() + "\n"; } sims.clear(); @@ -69,7 +69,7 @@ vector HeatMapSim::getPic(vector lookup, vectorgetValues(subset); - sims.push_back(data[0]); + sims.push_back(1.0 - data[0]); //save biggest similairity to set relative sim // if (data[0] > biggest) { biggest = data[0]; } @@ -122,12 +122,12 @@ string HeatMapSim::getPic(vector< vector > dists, vector groups) //white backround outsvg << ""; - outsvg << "Heatmap for " + inputfile + "\n"; + outsvg << "Heatmap for " + inputfile + "\n"; //column labels for (int h = 0; h < groups.size(); h++) { - outsvg << "" + groups[h] + "\n"; - outsvg << "" + groups[h] + "\n"; + outsvg << "" + groups[h] + "\n"; + outsvg << "" + groups[h] + "\n"; } double biggest = -1; @@ -206,7 +206,7 @@ void HeatMapSim::printLegend(int y, float maxSim) { label /= 1000.0; string text = toString(label, 1); - outsvg << "" + text + "\n"; + outsvg << "" + text + "\n"; x += 153; } }