X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=heatmap.h;h=2b491767d57e48c4a05728aa6a48cbfc6939b38f;hp=528c96416211a223e710467dd6baeb4cdb063c8f;hb=d1c97b8c04bb75faca1e76ffad60b37a4d789d3d;hpb=e2373397d9316500ee0d196e60dcab75d208511a diff --git a/heatmap.h b/heatmap.h index 528c964..2b49176 100644 --- a/heatmap.h +++ b/heatmap.h @@ -9,35 +9,65 @@ * */ -using namespace std; - -#include "ordervector.hpp" #include "rabundvector.hpp" #include "sharedrabundvector.h" -#include "sharedordervector.h" +#include "sharedrabundfloatvector.h" #include "datavector.hpp" -#include "globaldata.hpp" -#include "sharedutilities.h" + +/***********************************************************************/ +struct binCount { + int bin; + int abund; + binCount(int i, int j) : bin(i), abund(j) {} +}; +/***********************************************************************/ +struct binCountFloat { + int bin; + float abund; + binCountFloat(int i, float j) : bin(i), abund(j) {} +}; + +/***********************************************************************/ +//sorts highest abund to lowest +inline bool comparebinCounts(binCount left, binCount right){ + return (left.abund > right.abund); +} +/***********************************************************************/ +//sorts highest abund to lowest +inline bool comparebinFloatCounts(binCountFloat left, binCountFloat right){ + return (left.abund > right.abund); +} /***********************************************************************/ class HeatMap { public: - HeatMap(); - ~HeatMap(){ delete util; }; + HeatMap(string, string, int, int, string, string); + ~HeatMap(){}; - void getPic(OrderVector*); - void getPic(SharedOrderVector*); + string getPic(RAbundVector*); + string getPic(vector); + string getPic(vector); private: - void sortSharedVectors(vector& ); + int sortSharedVectors(vector& ); + int sortSharedVectors(vector& ); + int sortRabund(RAbundVector*&); void printLegend(int, float); - GlobalData* globaldata; - SharedUtil* util; - string format, sorted, groupComb, scaler; + string format, sorted, groupComb, scaler, outputDir, inputfile; ofstream outsvg; + MothurOut* m; + int numOTU, fontSize; + + map orderTopGroup(vector&); + map orderTopOtu(vector&); + map orderShared(vector&); + map orderTopGroup(vector&); + map orderTopOtu(vector&); + map orderShared(vector&); + }; @@ -47,3 +77,4 @@ class HeatMap { +