]> git.donarmstrong.com Git - mothur.git/blobdiff - counttable.cpp
added count file to trim.seqs, get.groups, get.lineage, get.seqs, heatmap.sim, list...
[mothur.git] / counttable.cpp
index 5307beee8379d8e758b946b3847dfa1be2d5a7b2..cd623ecbcf5fbea1cdd25fa8c9c2b872746da162 100644 (file)
@@ -447,6 +447,7 @@ int CountTable::addGroup(string groupName) {
             counts[i] = newCounts;
         }
         hasGroups = true;
+        m->setAllGroups(groups);
         
         return 0;
     }
@@ -660,6 +661,22 @@ vector<string> CountTable::getNamesOfSeqs() {
        }
 }
 /************************************************************/
+//returns the names of all unique sequences in file mapped to their seqCounts
+map<string, int> CountTable::getNameMap() {
+    try {
+        map<string, int> names;
+        for (map<string, int>::iterator it = indexNameMap.begin(); it != indexNameMap.end(); it++) {
+            names[it->first] = totals[it->second];
+        }
+        
+        return names;
+    }
+       catch(exception& e) {
+               m->errorOut(e, "CountTable", "getNameMap");
+               exit(1);
+       }
+}
+/************************************************************/
 //returns the names of all unique sequences in file
 vector<string> CountTable::getNamesOfSeqs(string group) {
     try {