]> git.donarmstrong.com Git - mothur.git/blob - consensuscommand.h
added command descriptions
[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 ConcensusCommand : public Command {
18         
19 public:
20         ConcensusCommand(string);       
21         ConcensusCommand();
22         ~ConcensusCommand() {}
23         
24         vector<string> setParameters();
25         string getCommandName()                 { return "consensus";   }
26         string getCommandCategory()             { return "Hidden";              }
27         string getHelpString(); 
28         string getCitation() { return "no citation"; }
29         string getDescription()         { return "consensus"; }
30
31         int execute(); 
32         void help() { m->mothurOut(getHelpString()); }  
33         
34         
35 private:
36         SharedUtil* util;
37         vector<Tree*> t;
38         Tree* consensusTree;
39         bool abort;
40         vector<string> treeSet;         //set containing all members of the tree to start recursion.  filled in getSets().
41         map< vector<string>, int > nodePairs;  //<map of possible combinations these combos are the pcounts or descendants info, to how many times they occured
42                                                                                 // ie. combos FI and EGK would create nodePairs[vector containing F and I] = 1; nodePairs[vector containing E, G and K] = 1
43                                                                                 // if you saw the combo FI again in another tree you would then update nodePairs[vector containing F and I] = 2;
44                                                                                 // requires vectors to be sorted to find key.
45         map< vector<string>, vector< vector<string> > > bestSplit;  //maps a group to its best split
46         map< vector<string>, int > nodePairsInitialRate;
47         map< vector<string>, int > nodePairsInTree;
48         map<string, int>::iterator it;
49         map< vector<string>, int>::iterator it2;
50         string outputFile, notIncluded, filename;
51         ofstream out, out2;
52         int numNodes, numLeaves, count;  //count is the next available spot in the tree vector
53         vector<string> outputNames;
54                                                                                 
55         int getSets();
56         int getSubgroupRating(vector<string>);
57         vector<string> getSmallest(map< vector<string>, int>);
58         vector<string> getNextAvailableSet(vector<string>, vector<string>&);  
59         vector<string> getRestSet(vector<string>, vector<string>);
60         bool isSubset(vector<string>, vector<string>); 
61         int findSpot(string); 
62         int buildConcensusTree(vector<string>);
63         
64 };
65
66 #endif
67