]> git.donarmstrong.com Git - mothur.git/blob - unifracunweightedcommand.h
unifrac.weighted
[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
17 using namespace std;
18
19 class GlobalData;
20
21 class UnifracUnweightedCommand : public Command {
22         
23         public:
24                 UnifracUnweightedCommand();     
25                 ~UnifracUnweightedCommand() { delete unweighted; }
26                 int execute();  
27         
28         private:
29                 GlobalData* globaldata;
30                 vector<Tree*> T;           //user trees
31                 TreeMap* tmap;
32                 Unweighted* unweighted;
33                 string sumFile, unweightedFile, unweightedFileout;
34                 vector<string> groupComb; // AB. AC, BC...
35                 int iters, numGroups, numComp, counter;
36                 EstOutput userData;                     //unweighted score info for user tree
37                 EstOutput randomData;           //unweighted score info for random trees
38                 vector< vector<float> > utreeScores; //scores for users trees for each comb.
39                 vector< vector<float> > UWScoreSig;  //tree score signifigance when compared to random trees - percentage of random trees with that score or higher.
40                 map<float, float>  validScores;  //map contains scores from random
41                 vector< map<float, float> > rscoreFreq;  //map <unweighted score, number of random trees with that score.> -vector entry for each combination.
42                 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.
43                 map<float, float>::iterator it2;
44                 map<float, float>::iterator it;
45                 
46                 ofstream outSum, out;
47                 ifstream inFile;
48                 
49                 void printUWSummaryFile();
50                 void printUnweightedFile();
51                 void setGroups();  
52                 void initFile(string);
53                 void output(vector<double>);
54                 void resetFile();
55  
56                 
57 };
58
59
60
61 #endif