]> git.donarmstrong.com Git - mothur.git/blobdiff - heatmapsim.cpp
paralellized seq.error and dist.shared added some error checks to libshuff and dist...
[mothur.git] / heatmapsim.cpp
index 4fb3e37365fdba3dbec421a5c7495314803a6755..9c5e780703a7d4f8d9117e38dddb693a40337bb0 100644 (file)
@@ -20,8 +20,7 @@
 #include "sharedbraycurtis.h"
 
 //**********************************************************************************************************************
-HeatMapSim::HeatMapSim(string dir) : outputDir(dir) {
-               globaldata = GlobalData::getInstance();
+HeatMapSim::HeatMapSim(string dir, string i) : outputDir(dir), inputfile(i) {
                m = MothurOut::getInstance();
 }
 //**********************************************************************************************************************
@@ -36,8 +35,8 @@ vector<string> HeatMapSim::getPic(vector<SharedRAbundVector*> lookup, vector<Cal
                
                        if (m->control_pressed) { return outputNames; }
                
-                       string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + lookup[0]->getLabel() + calcs[k]->getName() + ".heatmap.sim.svg";
-                       openOutputFile(filenamesvg, outsvg);
+                       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);
                        
                        //svg image
@@ -114,8 +113,8 @@ string HeatMapSim::getPic(vector< vector<double> > dists, vector<string> groups)
                
                vector<double> sims;
                
-               string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + "heatmap.sim.svg";
-               openOutputFile(filenamesvg, outsvg);
+               string filenamesvg = outputDir + m->getRootName(m->getSimpleName(inputfile)) + "heatmap.sim.svg";
+               m->openOutputFile(filenamesvg, outsvg);
                        
                //svg image
                outsvg << "<svg xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 " + toString((dists.size() * 150) + 160) + " " + toString((dists.size() * 150) + 160)  + "\">\n";
@@ -123,7 +122,7 @@ string HeatMapSim::getPic(vector< vector<double> > dists, vector<string> groups)
                
                //white backround
                outsvg << "<rect fill=\"white\" stroke=\"white\" x=\"0\" y=\"0\" width=\"" + toString((dists.size() * 150) + 160) + "\" height=\"" + toString((dists.size() * 150) + 160)  + "\"/>"; 
-               outsvg << "<text fill=\"black\" class=\"seri\" x=\"" + toString((dists.size() * 75) - 40) + "\" y=\"25\">Heatmap for " + globaldata->inputFileName + "</text>\n";
+               outsvg << "<text fill=\"black\" class=\"seri\" x=\"" + toString((dists.size() * 75) - 40) + "\" y=\"25\">Heatmap for " + inputfile + "</text>\n";
                
                //column labels
                for (int h = 0; h < groups.size(); h++) {