]> git.donarmstrong.com Git - mothur.git/blobdiff - treemap.cpp
added errorchecking and help info on new unifrac and treeclimber code
[mothur.git] / treemap.cpp
index bee0d11ed21323ee9dff1bc38c860a3042231150..6314eb04d04006ba5c57808f6927bddec89d6a00 100644 (file)
@@ -100,7 +100,24 @@ void TreeMap::setNamesOfGroups(string seqGroup) {
                                namesOfGroups.push_back(seqGroup); //new group
                        }
 }
-
+/************************************************************/
+bool TreeMap::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 TreeMap class Function isValidGroup. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the TreeMap class function isValidGroup. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
 /***********************************************************************/
 
 void TreeMap::print(ostream& output){