]> git.donarmstrong.com Git - mothur.git/blob - heatmap.h
changing command name classify.shared to classifyrf.shared
[mothur.git] / heatmap.h
1 #ifndef HEATMAP_H
2 #define HEATMAP_H
3 /*
4  *  heatmap.h
5  *  Mothur
6  *
7  *  Created by Sarah Westcott on 3/25/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "rabundvector.hpp"
13 #include "sharedrabundvector.h"
14 #include "sharedrabundfloatvector.h"
15 #include "datavector.hpp"
16
17
18 /***********************************************************************/
19 struct binCount {
20                 int bin;
21                 int abund;
22                 binCount(int i, int j) : bin(i), abund(j) {}
23 };
24 /***********************************************************************/
25 struct binCountFloat {
26                 int bin;
27                 float abund;
28                 binCountFloat(int i, float j) : bin(i), abund(j) {}
29 };
30
31 /***********************************************************************/
32 //sorts highest abund to lowest
33 inline bool comparebinCounts(binCount left, binCount right){
34         return (left.abund > right.abund);      
35 }
36 /***********************************************************************/
37 //sorts highest abund to lowest
38 inline bool comparebinFloatCounts(binCountFloat left, binCountFloat right){
39         return (left.abund > right.abund);      
40 }
41 /***********************************************************************/
42
43 class HeatMap {
44         
45         public:
46                 HeatMap(string, string, int, int, string, string);
47                 ~HeatMap(){};
48         
49                 string getPic(RAbundVector*);
50                 string getPic(vector<SharedRAbundVector*>);
51                 string getPic(vector<SharedRAbundFloatVector*>);
52
53         private:
54                 int sortSharedVectors(vector<SharedRAbundVector*>& );
55                 int sortSharedVectors(vector<SharedRAbundFloatVector*>& );
56                 int sortRabund(RAbundVector*&);
57                 void printLegend(int, float);
58
59                 string format, sorted, groupComb, scaler, outputDir, inputfile;
60                 ofstream outsvg;
61                 MothurOut* m;
62                 int numOTU, fontSize;
63                 
64                 map<int, int> orderTopGroup(vector<SharedRAbundVector*>&);
65                 map<int, int> orderTopOtu(vector<SharedRAbundVector*>&);
66                 map<int, int> orderShared(vector<SharedRAbundVector*>&);
67                 map<int, int> orderTopGroup(vector<SharedRAbundFloatVector*>&);
68                 map<int, int> orderTopOtu(vector<SharedRAbundFloatVector*>&);
69                 map<int, int> orderShared(vector<SharedRAbundFloatVector*>&);
70
71                         
72 };
73
74 /***********************************************************************/
75
76 #endif
77
78
79
80