]> git.donarmstrong.com Git - mothur.git/blob - unifracweightedcommand.h
changed unweighted and weighted score cumulatives to be that score or higher instead...
[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 <iostream>
14 #include <fstream>
15 #include <vector>
16 #include <map>
17 #include <cmath>
18 #include "command.hpp"
19 #include "weighted.h"
20 #include "treemap.h"
21
22 using namespace std;
23
24 class GlobalData;
25
26 class UnifracWeightedCommand : public Command {
27         
28         public:
29                 UnifracWeightedCommand();       
30                 ~UnifracWeightedCommand() { delete weighted; }
31                 int execute();  
32         
33         private:
34                 GlobalData* globaldata;
35                 vector<Tree*> T;           //user trees
36                 vector<float> utreeScores;  //user tree unweighted scores
37                 vector<float> 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, sumFile, distFile;
43                 int iters, numGroups, numComp;
44                 EstOutput userData;                     //weighted score info for user tree
45                 EstOutput randomData;           //weighted score info for random trees
46                 vector< map<float, float> > validScores;  //vector<contains scores from both user and random> each group comb has an entry
47                 vector< map<float, float> > rscoreFreq;  //vector<weighted score, number of random trees with that score.> each group comb has an entry
48                 vector< map<float, float> > uscoreFreq;  //vector<weighted, number of user trees with that score.> each group comb has an entry
49                 vector< map<float, float> > totalrscoreFreq;  //vector<weighted score, number of random trees with that score.> each group comb has an entry
50                 vector< map<float, float> > rCumul;  //vector<weighted score, number of random trees with that score or higher.> each group comb has an entry
51                 vector< map<float, float> > uCumul;  //vector<weighted, cumulative percentage of number of user trees with that score or higher.> each group comb has an entry
52                 map<float, float>::iterator it;
53                 map<float, float>::iterator it2;
54                 
55                 ofstream outSum, outDist, out;
56                 
57                 void printWSummaryFile();
58                 void printWeightedFile();  
59                 void saveRandomScores(); 
60 };
61
62
63
64 #endif