]> git.donarmstrong.com Git - mothur.git/blob - unifracweightedcommand.h
started shared utilities, updates to venn and heatmap added tree.groups command
[mothur.git] / unifracweightedcommand.h
1 #ifndef UNIFRACWEIGHTEDCOMMAND_H
2 #define UNIFRACWEIGHTEDCOMMAND_H
3
4 /*
5  *  unifracweightedcommand.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 "weighted.h"
15 #include "treemap.h"
16 #include "progress.hpp"
17 #include "sharedutilities.h"
18 #include "fileoutput.h"
19
20 using namespace std;
21
22 class GlobalData;
23
24 class UnifracWeightedCommand : public Command {
25         
26         public:
27                 UnifracWeightedCommand();       
28                 ~UnifracWeightedCommand() { delete weighted; delete util; }
29                 int execute();  
30         
31         private:
32                 GlobalData* globaldata;
33                 SharedUtil* util;
34                 FileOutput* output;
35                 vector<Tree*> T;           //user trees
36                 vector<double> utreeScores;  //user tree unweighted scores
37                 vector<double> WScoreSig;  //tree weighted score signifigance when compared to random trees - percentage of random trees with that score or lower.
38                 vector<string> groupComb; // AB. AC, BC...
39                 Tree* randT;  //random tree
40                 TreeMap* tmap;
41                 Weighted* weighted;
42                 string weightedFile, weightedFileout, sumFile;
43                 int iters, numGroups, numComp, counter;
44                 EstOutput userData;                     //weighted score info for user tree
45                 EstOutput randomData;           //weighted score info for random trees
46                 vector< vector<double> > rScores;  //vector<weighted scores for random trees.> each group comb has an entry
47                 vector< vector<double> > uScores;  //vector<weighted scores for user trees.> each group comb has an entry
48                 vector< map<float, float> > rScoreFreq;  //map <weighted score, number of random trees with that score.> -vector entry for each combination.
49                 vector< map<float, float> > rCumul;  //map <weighted score, cumulative percentage of number of random trees with that score or higher.> -vector entry for each c                                                                
50                 map<float, float>  validScores;  //map contains scores from random
51                 map<float, float>::iterator it2;
52                 map<float, float>::iterator it;
53                 
54                 ofstream outSum, out;
55                 ifstream inFile;
56                 
57                 void printWSummaryFile();
58                 void printWeightedFile();  
59                 //void removeValidScoresDuplicates();
60                 int findIndex(float, int);
61                 void calculateFreqsCumuls();
62                 //void initFile(string);
63                 //void output(vector<double>);
64                 //void resetFile();
65
66 };
67
68
69
70 #endif