+ }else{
+ if (ignore) {
+
+ tree.push_back(rawTaxNode(taxon));
+ int index = tree.size() - 1;
+
+ tree[index].parent = currentNode;
+ tree[index].level = (level+1);
+ tree[currentNode].children[taxon] = index;
+ int thisCount = 1;
+
+ //initialize groupcounts
+ if (groupmap != NULL) {
+ vector<string> mGroups = groupmap->getNamesOfGroups();
+ for (int j = 0; j < mGroups.size(); j++) {
+ tree[index].groupCount[mGroups[j]] = 0;
+ }
+
+ //find out the sequences group
+ string group = groupmap->getGroup(seqName);
+
+ if (group == "not found") { m->mothurOut("[WARNING]: " + seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine(); }
+
+ //do you have a count for this group?
+ map<string, int>::iterator itGroup = tree[index].groupCount.find(group);
+
+ //if yes, increment it - there should not be a case where we can't find it since we load group in read
+ if (itGroup != tree[index].groupCount.end()) {
+ tree[index].groupCount[group]++;
+ }
+ }else if (ct != NULL) {
+ if (ct->hasGroupInfo()) {
+ vector<string> mGroups = ct->getNamesOfGroups();
+ for (int j = 0; j < mGroups.size(); j++) {
+ tree[index].groupCount[mGroups[j]] = 0;
+ }
+ vector<int> groupCounts = ct->getGroupCounts(seqName);
+ vector<string> groups = ct->getNamesOfGroups();
+
+ for (int i = 0; i < groups.size(); i++) {
+ if (groupCounts[i] != 0) {
+
+ //do you have a count for this group?
+ map<string, int>::iterator itGroup = tree[index].groupCount.find(groups[i]);
+
+ //if yes, increment it - there should not be a case where we can't find it since we load group in read
+ if (itGroup != tree[index].groupCount.end()) {
+ tree[index].groupCount[groups[i]]+=groupCounts[i];
+ }
+ }
+ }
+ }
+ thisCount = ct->getNumSeqs(seqName);
+ }
+
+ tree[index].total = thisCount;
+ currentNode = index;
+
+ }else{ //otherwise, error
+ m->mothurOut("Warning: cannot find taxon " + taxon + " in reference taxonomy tree at level " + toString(tree[currentNode].level) + " for " + seqName + ". This may cause totals of daughter levels not to add up in summary file."); m->mothurOutEndLine();
+ break;
+ }