]> git.donarmstrong.com Git - mothur.git/blobdiff - doTaxonomy.h
finished work on classify.seqs bayesian method and various bug fixes
[mothur.git] / doTaxonomy.h
index c1ec3adfd0d81cf4f84893165f7b4dc2d36fa61c..6901d2757fb6630b980641c0de0dfb8390ac3f52 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef DOTAXONOMY_H
+#define DOTAXONOMY_H
+
 /*
  *  doTaxonomy.h
  *  
@@ -12,8 +15,8 @@
 /**************************************************************************************************/
 
 struct TaxNode {
-       vector<string> accessions;
-       map<string, int> children;
+       vector<string> accessions;      //names of seqs in this branch of tree
+       map<string, int> children;  //childs name to index in tree
        int parent, childNumber, level;
        string name, heirarchyID;
        
@@ -30,9 +33,17 @@ public:
        void addSeqToTree(string, string);
        void assignHeirarchyIDs(int);
        void print(ofstream&);
+       vector<int> 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;    }
 private:
        string getNextTaxon(string&);
        vector<TaxNode> tree;
+       vector<int> genusIndex; //holds the indexes in tree where the genus level taxonomies are stored
+       map<string, int> name2Taxonomy;  //maps name to index in tree
+       map<int, int> uniqueTaxonomies;  //map of unique taxonomies
        void print(int, ofstream&);
        int numNodes;
        int numSeqs;
@@ -40,3 +51,6 @@ private:
 
 /**************************************************************************************************/
 
+#endif
+
+