7 * Created by Sarah Westcott on 4/29/09.
8 * Copyright 2009 Schloss Lab UMASS AMherst. All rights reserved.
16 //NOTE: This class assumes all leaf nodes have 1 member.
17 // Mothur does allow for names files with trees which would make a tree with multiple members at one leaf.
18 // This class is currently only called internally by commands that have leaf node containing only 1 member.
19 // But if in the future, this changes things will need to be reworked in getSets and buildConsensus.
25 Consensus() { m = MothurOut::getInstance(); }
28 Tree* getTree(vector<Tree*>&);
34 vector<string> treeSet; //set containing all members of the tree to start recursion. filled in getSets().
35 map< vector<string>, int > nodePairs; //<map of possible combinations these combos are the pcounts or descendants info, to how many times they occured
36 // ie. combos FI and EGK would create nodePairs[vector containing F and I] = 1; nodePairs[vector containing E, G and K] = 1
37 // if you saw the combo FI again in another tree you would then update nodePairs[vector containing F and I] = 2;
38 // requires vectors to be sorted to find key.
39 map< vector<string>, vector< vector<string> > > bestSplit; //maps a group to its best split
40 map< vector<string>, int > nodePairsInitialRate;
41 map< vector<string>, int > nodePairsInTree;
42 map<string, int>::iterator it;
43 map< vector<string>, int>::iterator it2;
44 string outputFile, notIncluded, filename;
45 int numNodes, numLeaves, count, numTrees; //count is the next available spot in the tree vector
46 vector<string> outputNames;
48 int getSets(vector<Tree*>&);
49 int getSubgroupRating(vector<string>);
50 vector<string> getSmallest(map< vector<string>, int>);
51 vector<string> getNextAvailableSet(vector<string>, vector<string>&);
52 vector<string> getRestSet(vector<string>, vector<string>);
53 bool isSubset(vector<string>, vector<string>);
55 int buildConsensusTree(vector<string>);