]> git.donarmstrong.com Git - mothur.git/blob - unifracunweightedcommand.h
started shared utilities, updates to venn and heatmap added tree.groups command
[mothur.git] / unifracunweightedcommand.h
1 #ifndef UNIFRACUNWEIGHTEDCOMMAND_H
2 #define UNIFRACUNWEIGHTEDCOMMAND_H
3
4 /*
5  *  unifracunweightedcommand.h
6  *  Mothur
7  *
8  *  Created by Sarah Westcott on 2/9/09.
9  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10  *
11  */
12
13 #include "command.hpp"
14 #include "unweighted.h"
15 #include "treemap.h"
16 #include "sharedutilities.h"
17
18
19 using namespace std;
20
21 class GlobalData;
22
23 class UnifracUnweightedCommand : public Command {
24         
25         public:
26                 UnifracUnweightedCommand();     
27                 ~UnifracUnweightedCommand() { delete unweighted; delete util; }
28                 int execute();  
29         
30         private:
31                 GlobalData* globaldata;
32                 SharedUtil* util;
33                 vector<Tree*> T;           //user trees
34                 TreeMap* tmap;
35                 Unweighted* unweighted;
36                 string sumFile, unweightedFile, unweightedFileout, allGroups;
37                 vector<string> groupComb; // AB. AC, BC...
38                 int iters, numGroups, numComp, counter;
39                 EstOutput userData;                     //unweighted score info for user tree
40                 EstOutput randomData;           //unweighted score info for random trees
41                 vector< vector<float> > utreeScores; //scores for users trees for each comb.
42                 vector< vector<float> > UWScoreSig;  //tree score signifigance when compared to random trees - percentage of random trees with that score or higher.
43                 map<float, float>  validScores;  //map contains scores from random
44                 vector< map<float, float> > rscoreFreq;  //map <unweighted score, number of random trees with that score.> -vector entry for each combination.
45                 vector< map<float, float> > rCumul;  //map <unweighted score, cumulative percentage of number of random trees with that score or higher.> -vector entry for each combination.
46                 map<float, float>::iterator it2;
47                 map<float, float>::iterator it;
48                 
49                 ofstream outSum, out;
50                 ifstream inFile;
51                 
52                 void printUWSummaryFile();
53                 void printUnweightedFile();
54                 void initFile(string);
55                 void output(vector<double>);
56                 void resetFile();
57  
58                 
59 };
60
61
62
63 #endif