X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=heatmap.h;h=922147ccb62d54f154f34796a7ad7786717841d6;hb=250e3b11b1c9c1e1ad458ab6c7e71ac2e67e11d9;hp=ffbe94675df2dc8b968134ad79ffc7307bb1d458;hpb=74844a60d80c6dd06e3fb02ee9b928424f9019b0;p=mothur.git diff --git a/heatmap.h b/heatmap.h index ffbe946..922147c 100644 --- a/heatmap.h +++ b/heatmap.h @@ -11,28 +11,63 @@ #include "rabundvector.hpp" #include "sharedrabundvector.h" +#include "sharedrabundfloatvector.h" #include "datavector.hpp" -#include "globaldata.hpp" + +/***********************************************************************/ +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(string, string, string); + HeatMap(string, string, int, int, string, string); ~HeatMap(){}; string getPic(RAbundVector*); string getPic(vector); + string getPic(vector); private: - void sortSharedVectors(vector& ); + vector sortSharedVectors(vector& ); + vector sortSharedVectors(vector& ); + int sortRabund(RAbundVector*&); void printLegend(int, float); - GlobalData* globaldata; - string format, sorted, groupComb, scaler, outputDir; + 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&); + };