]> git.donarmstrong.com Git - mothur.git/blob - unifracunweightedcommand.h
added root parameter to the unifrac commands so you can choose to include the entire...
[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 #include "fileoutput.h"
18
19
20 class GlobalData;
21
22 class UnifracUnweightedCommand : public Command {
23         
24         public:
25                 UnifracUnweightedCommand(string);       
26                 UnifracUnweightedCommand();
27                 ~UnifracUnweightedCommand() { globaldata->Groups.clear();  if (abort == false) { delete unweighted; delete util; } }
28                 vector<string> getRequiredParameters();
29                 vector<string> getValidParameters();
30                 vector<string> getRequiredFiles();
31                 map<string, vector<string> > getOutputFiles() { return outputTypes; }
32                 int execute();
33                 void help();    
34         
35         private:
36                 GlobalData* globaldata;
37                 SharedUtil* util;
38                 FileOutput* output;
39                 vector<Tree*> T;           //user trees
40                 TreeMap* tmap;
41                 Unweighted* unweighted;
42                 string sumFile, allGroups;
43                 vector<string> groupComb; // AB. AC, BC...
44                 int iters, numGroups, numComp, counter, processors;
45                 EstOutput userData;                     //unweighted score info for user tree
46                 EstOutput randomData;           //unweighted score info for random trees
47                 vector< vector<float> > utreeScores; //scores for users trees for each comb.
48                 vector< vector<float> > UWScoreSig;  //tree score signifigance when compared to random trees - percentage of random trees with that score or higher.
49                 map<float, float>  validScores;  //map contains scores from random
50                 vector< map<float, float> > rscoreFreq;  //map <unweighted score, number of random trees with that score.> -vector entry for each combination.
51                 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.
52                 
53                 bool abort, phylip, random, includeRoot;
54                 string groups, itersString, outputDir, outputForm;
55                 vector<string> Groups, outputNames; //holds groups to be used
56                 map<string, vector<string> > outputTypes;
57
58                 ofstream outSum, out;
59                 ifstream inFile;
60                 
61                 void printUWSummaryFile(int);
62                 void printUnweightedFile();
63                 void createPhylipFile(int);
64                  
65                 
66 };
67
68 #endif