]> git.donarmstrong.com Git - mothur.git/blob - unifracunweightedcommand.h
removed read.dist, read.otu, read.tree and globaldata. added current to defaults...
[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 #include "readtree.h"
19
20 class UnifracUnweightedCommand : public Command {
21         
22         public:
23                 UnifracUnweightedCommand(string);       
24                 UnifracUnweightedCommand();
25                 ~UnifracUnweightedCommand() {}
26         
27                 vector<string> setParameters();
28                 string getCommandName()                 { return "unifrac.unweighted";          }
29                 string getCommandCategory()             { return "Hypothesis Testing";          }
30                 string getHelpString(); 
31         
32                 int execute();
33                 void help() { m->mothurOut(getHelpString()); }
34         
35         
36         private:
37                 ReadTree* read;
38                 SharedUtil* util;
39                 FileOutput* output;
40                 vector<Tree*> T;           //user trees
41                 TreeMap* tmap;
42                 Unweighted* unweighted;
43                 string sumFile, allGroups;
44                 vector<string> groupComb; // AB. AC, BC...
45                 int iters, numGroups, numComp, counter, processors, numUniquesInName;
46                 EstOutput userData;                     //unweighted score info for user tree
47                 EstOutput randomData;           //unweighted score info for random trees
48                 vector< vector<float> > utreeScores; //scores for users trees for each comb.
49                 vector< vector<float> > UWScoreSig;  //tree score signifigance when compared to random trees - percentage of random trees with that score or higher.
50                 map<float, float>  validScores;  //map contains scores from random
51                 vector< map<float, float> > rscoreFreq;  //map <unweighted score, number of random trees with that score.> -vector entry for each combination.
52                 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.
53                 
54                 bool abort, phylip, random, includeRoot;
55                 string groups, itersString, outputDir, outputForm, treefile, groupfile, namefile;
56                 vector<string> Groups, outputNames; //holds groups to be used
57
58                 ofstream outSum, out;
59                 ifstream inFile;
60                 map<string, string> nameMap;
61                 
62                 void printUWSummaryFile(int);
63                 void printUnweightedFile();
64                 void createPhylipFile(int);
65                 int readNamesFile();
66                  
67                 
68 };
69
70 #endif