]> git.donarmstrong.com Git - mothur.git/blob - parsimonycommand.h
8907e2165c82ac291a902fe04ca3dd00638bd3db
[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
16 using namespace std;
17
18 class GlobalData;
19
20 class ParsimonyCommand : public Command {
21         
22         public:
23                 ParsimonyCommand();     
24                 ~ParsimonyCommand() { delete pars; }
25                 int execute();  
26         
27         private:
28                 GlobalData* globaldata;
29                 vector<Tree*> T;           //user trees
30                 Tree* randT;  //random tree
31                 Tree* copyUserTree; 
32                 TreeMap* tmap; 
33                 TreeMap* savetmap;
34                 Parsimony* pars;
35                 vector<string> groupComb; // AB. AC, BC...
36                 string parsFile, parsFileout, sumFile, randomtree;
37                 int iters, numGroups, numComp, counter;
38                 vector<int> numEachGroup; //vector containing the number of sequences in each group the users wants for random distrib.
39                 vector< vector<float> > userTreeScores; //scores for users trees for each comb.
40                 vector< vector<float> > UScoreSig;  //tree score signifigance when compared to random trees - percentage of random trees with that score or lower.
41                 EstOutput userData;                     //pscore info for user tree
42                 EstOutput randomData;           //pscore info for random trees
43                 map<int, double>  validScores;  //map contains scores from both user and random
44                 vector< map<int, double> > rscoreFreq;  //map <pscore, number of random trees with that score.> -vector entry for each combination.
45                 vector< map<int, double> > uscoreFreq;  //map <pscore, number of user trees with that score.> -vector entry for each combination.
46                 vector< map<int, double> > rCumul;  //map <pscore, cumulative percentage of number of random trees with that score or lower.> -vector entry for each combination.
47                 vector< map<int, double> > uCumul;  //map <pscore, cumulative percentage of number of user trees with that score or lower .> -vector entry for each combination.
48                 map<int, double>::iterator it;
49                 map<int, double>::iterator it2;
50                 
51                 ofstream out, outSum;
52                 ifstream inFile;
53                 
54                 void printParsimonyFile();  
55                 void printUSummaryFile();
56                 void getUserInput();
57                 void setGroups();
58                 void initFile(string);
59                 void output(vector<double>);
60                 void resetFile();
61
62                 
63 };
64
65
66 #endif