1 #ifndef CONCENSUSCOMMAND_H
2 #define CONCENSUSCOMMAND_H
7 * Created by Sarah Westcott on 4/29/09.
8 * Copyright 2009 Schloss Lab UMASS AMherst. All rights reserved.
12 #include "command.hpp"
15 #include "sharedutilities.h"
17 class ConcensusCommand : public Command {
20 ConcensusCommand(string);
22 ~ConcensusCommand() {}
24 vector<string> setParameters();
25 string getCommandName() { return "concensus"; }
26 string getCommandCategory() { return "Hidden"; }
27 string getHelpString();
30 void help() { m->mothurOut(getHelpString()); }
38 vector<string> treeSet; //set containing all members of the tree to start recursion. filled in getSets().
39 map< vector<string>, int > nodePairs; //<map of possible combinations these combos are the pcounts or descendants info, to how many times they occured
40 // ie. combos FI and EGK would create nodePairs[vector containing F and I] = 1; nodePairs[vector containing E, G and K] = 1
41 // if you saw the combo FI again in another tree you would then update nodePairs[vector containing F and I] = 2;
42 // requires vectors to be sorted to find key.
43 map< vector<string>, vector< vector<string> > > bestSplit; //maps a group to its best split
44 map< vector<string>, int > nodePairsInitialRate;
45 map< vector<string>, int > nodePairsInTree;
46 map<string, int>::iterator it;
47 map< vector<string>, int>::iterator it2;
48 string outputFile, notIncluded, filename;
50 int numNodes, numLeaves, count; //count is the next available spot in the tree vector
51 vector<string> outputNames;
54 int getSubgroupRating(vector<string>);
55 vector<string> getSmallest(map< vector<string>, int>);
56 vector<string> getNextAvailableSet(vector<string>, vector<string>&);
57 vector<string> getRestSet(vector<string>, vector<string>);
58 bool isSubset(vector<string>, vector<string>);
60 int buildConcensusTree(vector<string>);