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