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&, string); //pass it a taxonomy file and it makes the train.tree
37 int addSeqToTree(string, string);
38 void assignHeirarchyIDs(int);
39 void printTreeNodes(string); //used by bayesian to save time
40 vector<int> getGenusNodes();
41 vector<int> getGenusTotals();
42 void setUp(string); //used to create file needed for summary file if you use () constructor and add seqs manually instead of passing taxonomyfile
45 TaxNode get(string seqName);
46 string getName(int i);
47 int getGenusIndex(string seqName);
48 string getFullTaxonomy(string); //pass a sequence name return taxonomy
50 int getMaxLevel() { return maxLevel; }
51 int getNumSeqs() { return numSeqs; }
52 int getNumNodes() { return tree.size(); }
54 bool ErrorCheck(vector<string>);
57 string getNextTaxon(string&, string);
58 void print(ofstream&, vector<TaxNode>&); //used to create static reference taxonomy file
59 void fillOutTree(int, vector<TaxNode>&); //used to create static reference taxonomy file
60 void binUnclassified(string);
63 vector<int> genusIndex; //holds the indexes in tree where the genus level taxonomies are stored
64 vector<int> totals; //holds the numSeqs at each genus level taxonomy
65 map<string, int> name2Taxonomy; //maps name to index in tree
66 map<string, int> name2GenusNodeIndex;
67 set<int> uniqueTaxonomies; //map of unique taxonomies
68 map<int, int> leafNodes; //used to create static reference taxonomy file
69 //void print(int, ofstream&);
77 /**************************************************************************************************/