]> git.donarmstrong.com Git - mothur.git/blob - parsimonycommand.h
9e756b884fb087f95ca0d43c23027c8caaa33b3f
[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();
27         ~ParsimonyCommand() { if (abort == false) { delete pars; delete util; delete output; }  }
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         Tree* randT;  //random tree
41         Tree* copyUserTree; 
42         TreeMap* tmap; 
43         TreeMap* savetmap;
44         Parsimony* pars;
45         vector<string> groupComb; // AB. AC, BC...
46         string sumFile, randomtree, allGroups, outputDir;
47         int iters, numGroups, numComp, counter, processors;
48         vector<int> numEachGroup; //vector containing the number of sequences in each group the users wants for random distrib.
49         vector< vector<float> > userTreeScores; //scores for users trees for each comb.
50         vector< vector<float> > UScoreSig;  //tree score signifigance when compared to random trees - percentage of random trees with that score or lower.
51         EstOutput userData;                     //pscore info for user tree
52         EstOutput randomData;           //pscore info for random trees
53         map<int, double>  validScores;  //map contains scores from both user and random
54         vector< map<int, double> > rscoreFreq;  //map <pscore, number of random trees with that score.> -vector entry for each combination.
55         vector< map<int, double> > uscoreFreq;  //map <pscore, number of user trees with that score.> -vector entry for each combination.
56         vector< map<int, double> > rCumul;  //map <pscore, cumulative percentage of number of random trees with that score or lower.> -vector entry for each combination.
57         vector< map<int, double> > uCumul;  //map <pscore, cumulative percentage of number of user trees with that score or lower .> -vector entry for each combination.
58         
59         ofstream outSum;
60         
61
62         bool abort;
63         string groups, itersString;
64         vector<string> Groups, outputNames; //holds groups to be used
65         map<string, vector<string> > outputTypes;
66
67         void printParsimonyFile();  
68         int printUSummaryFile();
69         void getUserInput();
70         
71 };
72
73
74 #endif