]> git.donarmstrong.com Git - mothur.git/blob - parsimonycommand.h
bbcd6af5595d186610dae2818836d4d74b15f0f3
[mothur.git] / parsimonycommand.h
1 #ifndef PARSIMONYCOMMAND_H
2 #define PARSIMONYCOMMAND_H
3 /*
4  *  parsimonycommand.h
5  *  Mothur
6  *
7  *  Created by Sarah Westcott on 1/26/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "command.hpp"
13 #include "parsimony.h"
14 #include "treemap.h"
15 #include "progress.hpp"
16 #include "sharedutilities.h"
17 #include "fileoutput.h"
18
19
20 class GlobalData;
21
22 class ParsimonyCommand : public Command {
23         
24         public:
25                 ParsimonyCommand(string);       
26                 ~ParsimonyCommand() { delete pars; delete util; delete output; }
27                 int execute();  
28                 void help();
29         
30         private:
31                 GlobalData* globaldata;
32                 SharedUtil* util;
33                 FileOutput* output;
34                 vector<Tree*> T;           //user trees
35                 Tree* randT;  //random tree
36                 Tree* copyUserTree; 
37                 TreeMap* tmap; 
38                 TreeMap* savetmap;
39                 Parsimony* pars;
40                 vector<string> groupComb; // AB. AC, BC...
41                 string sumFile, randomtree, allGroups;
42                 int iters, numGroups, numComp, counter;
43                 vector<int> numEachGroup; //vector containing the number of sequences in each group the users wants for random distrib.
44                 vector< vector<float> > userTreeScores; //scores for users trees for each comb.
45                 vector< vector<float> > UScoreSig;  //tree score signifigance when compared to random trees - percentage of random trees with that score or lower.
46                 EstOutput userData;                     //pscore info for user tree
47                 EstOutput randomData;           //pscore info for random trees
48                 map<int, double>  validScores;  //map contains scores from both user and random
49                 vector< map<int, double> > rscoreFreq;  //map <pscore, number of random trees with that score.> -vector entry for each combination.
50                 vector< map<int, double> > uscoreFreq;  //map <pscore, number of user trees with that score.> -vector entry for each combination.
51                 vector< map<int, double> > rCumul;  //map <pscore, cumulative percentage of number of random trees with that score or lower.> -vector entry for each combination.
52                 vector< map<int, double> > uCumul;  //map <pscore, cumulative percentage of number of user trees with that score or lower .> -vector entry for each combination.
53                 map<int, double>::iterator it;
54                 map<int, double>::iterator it2;
55                 
56                 ofstream out, outSum;
57                 ifstream inFile;
58                 
59                 OptionParser* parser;
60                 map<string, string> parameters;
61                 map<string, string>::iterator it4;
62                 bool abort;
63                 string groups, itersString;
64                 vector<string> Groups; //holds groups to be used
65
66                 void printParsimonyFile();  
67                 void printUSummaryFile();
68                 void getUserInput();
69                 
70 };
71
72
73 #endif