]> git.donarmstrong.com Git - mothur.git/blob - consensuscommand.h
added checks for ^C to quit command instead of program
[mothur.git] / consensuscommand.h
1 #ifndef CONCENSUSCOMMAND_H
2 #define CONCENSUSCOMMAND_H
3 /*
4  *  consensuscommand.h
5  *  Mothur
6  *
7  *  Created by Sarah Westcott on 4/29/09.
8  *  Copyright 2009 Schloss Lab UMASS AMherst. All rights reserved.
9  *
10  */
11
12 #include "command.hpp"
13 #include "tree.h"
14 #include "treemap.h"
15 #include "sharedutilities.h"
16         
17 class GlobalData;
18
19 class ConcensusCommand : public Command {
20         
21 public:
22         ConcensusCommand(string);       
23         ~ConcensusCommand();
24         int execute();
25         void help();    
26         
27 private:
28         GlobalData* globaldata;
29         SharedUtil* util;
30         vector<Tree*> t;
31         Tree* consensusTree;
32         bool abort;
33         vector<string> treeSet;         //set containing all members of the tree to start recursion.  filled in getSets().
34         map< vector<string>, int > nodePairs;  //<map of possible combinations these combos are the pcounts or descendants info, to how many times they occured
35                                                                                 // ie. combos FI and EGK would create nodePairs[vector containing F and I] = 1; nodePairs[vector containing E, G and K] = 1
36                                                                                 // if you saw the combo FI again in another tree you would then update nodePairs[vector containing F and I] = 2;
37                                                                                 // requires vectors to be sorted to find key.
38         map< vector<string>, vector< vector<string> > > bestSplit;  //maps a group to its best split
39         map< vector<string>, int > nodePairsInitialRate;
40         map< vector<string>, int > nodePairsInTree;
41         map<string, int>::iterator it;
42         map< vector<string>, int>::iterator it2;
43         string outputFile, notIncluded, filename;
44         ofstream out, out2;
45         int numNodes, numLeaves, count;  //count is the next available spot in the tree vector
46                                                                                 
47         int getSets();
48         int getSubgroupRating(vector<string>);
49         vector<string> getSmallest(map< vector<string>, int>);
50         vector<string> getNextAvailableSet(vector<string>, vector<string>&);  
51         vector<string> getRestSet(vector<string>, vector<string>);
52         bool isSubset(vector<string>, vector<string>); 
53         int findSpot(string); 
54         int buildConcensusTree(vector<string>);
55         
56 };
57
58 #endif
59