X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=heatmap.h;h=922147ccb62d54f154f34796a7ad7786717841d6;hp=e236ce389795e00e20fce97cd645377e83657c1b;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=69180c6a4fd3c9ad48974b402d398efe61a58fa7 diff --git a/heatmap.h b/heatmap.h index e236ce3..922147c 100644 --- a/heatmap.h +++ b/heatmap.h @@ -9,43 +9,72 @@ * */ -using namespace std; - -#include "ordervector.hpp" #include "rabundvector.hpp" #include "sharedrabundvector.h" -#include "sharedordervector.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(); + 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 getSharedVectors(SharedOrderVector*); - void sortSharedVectors(); - - GlobalData* globaldata; - vector lookup; - RAbundVector rabund; - string format, sorted, groupComb; + vector sortSharedVectors(vector& ); + vector sortSharedVectors(vector& ); + int sortRabund(RAbundVector*&); + void printLegend(int, float); + + string format, sorted, groupComb, scaler, outputDir, inputfile; 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 +