+void PhyloTree::fillOutTree(int index, vector<TaxNode>& copy) {
+ try {
+ map<string,int>::iterator it;
+
+ it = copy[index].children.find("unclassified");
+ if (it == copy[index].children.end()) { //no unclassified at this level
+ string taxon = "unclassified";
+ copy.push_back(TaxNode(taxon));
+ copy[index].children[taxon] = copy.size()-1;
+ copy[copy.size()-1].parent = index;
+ copy[copy.size()-1].level = copy[index].level + 1;
+ }
+
+ if (tree[index].level <= maxLevel) {
+ for(it=tree[index].children.begin();it!=tree[index].children.end();it++){ //check your children
+ fillOutTree(it->second, copy);
+ }
+ }
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "PhyloTree", "fillOutTree");
+ exit(1);
+ }
+}
+/**************************************************************************************************/