X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=heatmap.h;h=c291a4ded677b6394aa5da9819a0140cda75a8c6;hb=0e40e23448c2ee274268d85e0d0e65cb9eaeee6f;hp=a89500c004c9b61e2a73a37407c26b98979e5da0;hpb=c5c7502f435e1413c19e373dab1dfebcaa67588d;p=mothur.git diff --git a/heatmap.h b/heatmap.h index a89500c..c291a4d 100644 --- a/heatmap.h +++ b/heatmap.h @@ -9,44 +9,73 @@ * */ -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); + ~HeatMap(){}; - void getPic(OrderVector*); - void getPic(SharedOrderVector*); + string getPic(RAbundVector*); + string getPic(vector); + string getPic(vector); private: - void sortSharedVectors(); - + int sortSharedVectors(vector& ); + int sortSharedVectors(vector& ); + int sortRabund(RAbundVector*&); + void printLegend(int, float); + GlobalData* globaldata; - SharedUtil* util; - vector lookup; - RAbundVector rabund; - string format, sorted, groupComb, scaler; + string format, sorted, groupComb, scaler, outputDir; ofstream outsvg; - map colorScale; - map::iterator it; + MothurOut* m; + int numOTU, fontSize; + + map orderTopGroup(vector&); + map orderTopOtu(vector&); + map orderShared(vector&); + map orderTopGroup(vector&); + map orderTopOtu(vector&); + map orderShared(vector&); }; + /***********************************************************************/ #endif +