]> git.donarmstrong.com Git - mothur.git/blobdiff - groupmap.cpp
added ability for user to select which groups to analyze with the collect.shared...
[mothur.git] / groupmap.cpp
index 1f22013699014c6afa0b6de5b7ce1722c43acbc0..63fb4655da35529a694609dbb368094d9585a194 100644 (file)
@@ -71,3 +71,21 @@ void GroupMap::setNamesOfGroups(string seqGroup) {
                                index++;
                        }
 }
+/************************************************************/
+bool GroupMap::isValidGroup(string groupname) {
+       try {
+               for (int i = 0; i < namesOfGroups.size(); i++) {
+                       if (groupname == namesOfGroups[i]) { return true; }
+               }
+               
+               return false;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the GroupMap class Function isValidGroup. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the GroupMap class function isValidGroup. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}