8 * Created by Pat Schloss on 6/17/09.
9 * Copyright 2009 Patrick D. Schloss. All rights reserved.
14 #include "mothurout.h"
16 /**************************************************************************************************/
19 vector<string> accessions; //names of seqs in this branch of tree
20 map<string, int> children; //childs name to index in tree
21 int parent, childNumber, level;
22 string name, heirarchyID;
24 TaxNode(string n) : name(n), level(0), parent(-1) { }
28 /**************************************************************************************************/
34 PhyloTree(string); //pass it a taxonomy file and it makes the tree
35 PhyloTree(ifstream&); //pass it a taxonomy file and it makes the train.tree
37 int addSeqToTree(string, string);
38 void assignHeirarchyIDs(int);
39 void print(ofstream&);
40 void printTreeNodes(string); //used by bayesian to save time
41 vector<int> getGenusNodes();
42 vector<int> getGenusTotals();
43 void binUnclassified();
45 TaxNode get(int i) { return tree[i]; }
46 TaxNode get(string seqName) { return tree[name2Taxonomy[seqName]]; }
47 int getIndex(string seqName) { return name2Taxonomy[seqName]; }
48 string getName(int i) { return tree[i].name; }
49 string getFullTaxonomy(string); //pass a sequence name return taxonomy
50 int getMaxLevel() { return maxLevel; }
51 int getNumSeqs() { return numSeqs; }
54 string getNextTaxon(string&);
56 vector<int> genusIndex; //holds the indexes in tree where the genus level taxonomies are stored
57 vector<int> totals; //holds the numSeqs at each genus level taxonomy
58 map<string, int> name2Taxonomy; //maps name to index in tree
59 map<int, int> uniqueTaxonomies; //map of unique taxonomies
60 void print(int, ofstream&);
68 /**************************************************************************************************/