X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=phylotree.h;h=e0002209e4d83aaaf9468573173858d9b0602b61;hp=f8365d53e7664f9a4ca02cb09dea59cabca11f0b;hb=615301e57c25e241356a9c2380648d117709458d;hpb=7a2154809d332281cf4006943a9bd94b8208c837 diff --git a/phylotree.h b/phylotree.h index f8365d5..e000220 100644 --- a/phylotree.h +++ b/phylotree.h @@ -11,6 +11,7 @@ */ #include "mothur.h" +#include "mothurout.h" /**************************************************************************************************/ @@ -31,24 +32,46 @@ class PhyloTree { public: PhyloTree(); PhyloTree(string); //pass it a taxonomy file and it makes the tree + PhyloTree(ifstream&, string); //pass it a taxonomy file and it makes the train.tree ~PhyloTree() {}; - void addSeqToTree(string, string); + int addSeqToTree(string, string); void assignHeirarchyIDs(int); - void print(ofstream&); - vector getGenusNodes(); - TaxNode get(int i) { return tree[i]; } - TaxNode get(string seqName) { return tree[name2Taxonomy[seqName]]; } - int getIndex(string seqName) { return name2Taxonomy[seqName]; } - string getName(int i) { return tree[i].name; } + void printTreeNodes(string); //used by bayesian to save time + vector getGenusNodes(); + vector getGenusTotals(); + void setUp(string); //used to create file needed for summary file if you use () constructor and add seqs manually instead of passing taxonomyfile + + TaxNode get(int i); + TaxNode get(string seqName); + string getName(int i); + int getGenusIndex(string seqName); + string getFullTaxonomy(string); //pass a sequence name return taxonomy + + int getMaxLevel() { return maxLevel; } + int getNumSeqs() { return numSeqs; } + int getNumNodes() { return tree.size(); } + + bool ErrorCheck(vector); + private: - string getNextTaxon(string&); + string getNextTaxon(string&, string); + void print(ofstream&, vector&); //used to create static reference taxonomy file + void fillOutTree(int, vector&); //used to create static reference taxonomy file + void binUnclassified(string); + vector tree; vector genusIndex; //holds the indexes in tree where the genus level taxonomies are stored + vector totals; //holds the numSeqs at each genus level taxonomy map name2Taxonomy; //maps name to index in tree - map uniqueTaxonomies; //map of unique taxonomies - void print(int, ofstream&); + map name2GenusNodeIndex; + set uniqueTaxonomies; //map of unique taxonomies + map leafNodes; //used to create static reference taxonomy file + //void print(int, ofstream&); int numNodes; int numSeqs; + int maxLevel; + bool calcTotals; + MothurOut* m; }; /**************************************************************************************************/