]> git.donarmstrong.com Git - mothur.git/blob - unifracunweightedcommand.h
changed unweighted and weighted score cumulatives to be that score or higher instead...
[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 <iostream>
14 #include <fstream>
15 #include <vector>
16 #include <map>
17 #include <cmath>
18 #include "command.hpp"
19 #include "unweighted.h"
20 #include "treemap.h"
21
22 using namespace std;
23
24 class GlobalData;
25
26 class UnifracUnweightedCommand : public Command {
27         
28         public:
29                 UnifracUnweightedCommand();     
30                 ~UnifracUnweightedCommand() { delete unweighted; }
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> UWScoreSig;  //tree unweighted score signifigance when compared to random trees - percentage of random trees with that score or lower.
38                 Tree* randT;  //random tree
39                 TreeMap* tmap;
40                 Unweighted* unweighted;
41                 string sumFile, distFile, unweightedFile;
42                 int iters;
43                 EstOutput userData;                     //unweighted score info for user tree
44                 EstOutput randomData;           //unweighted score info for random trees
45                 map<float, float> validScores;  //contains scores from both user and random
46                 map<float, float> rscoreFreq;  //unweighted score, number of random trees with that score.
47                 map<float, float> uscoreFreq;  //unweighted, number of user trees with that score.
48                 map<float, float> totalrscoreFreq;  //unweighted score, number of random trees with that score.
49                 map<float, float> rCumul;               //unweighted score, cumulative percentage of number of random trees with that score or higher.
50                 map<float, float> uCumul;  //unweighted, cumulative percentage of number of user trees with that score or higher .
51                 map<float, float>::iterator it;
52                 map<float, float>::iterator it2;
53                 
54                 ofstream outSum, outDist, out;
55                 
56                 void printUWSummaryFile();
57                 void printUnweightedFile();
58                 void saveRandomScores();    
59                 
60 };
61
62
63
64 #endif