]> git.donarmstrong.com Git - mothur.git/blobdiff - groupmap.h
adding more error checking for list and group files. outputs missing.names or missin...
[mothur.git] / groupmap.h
index a3b923cd4da60ce601c58d1553e2a95f6b9f4ab9..e52ada56056e14cf8df6f4a2b7e541d7c8b1fcc7 100644 (file)
@@ -9,28 +9,30 @@
  *
  */
 
-#include <map>
-#include <string>
-#include <iostream>
-#include <fstream>
-#include "utilities.hpp"
+#include "mothur.h"
 
 /* This class is a representation of the groupfile.  It is used by all the shared commands to determine what group a 
        certain sequence belongs to. */
 
 class GroupMap {
 public:
+       GroupMap() {};
        GroupMap(string);
        ~GroupMap();
        void readMap();
        int getNumGroups();
+       bool isValidGroup(string);  //return true if string is a valid group
        string getGroup(string);
+       void setGroup(string, string);
        vector<string> namesOfGroups;
-               
+       map<string, int> groupIndex;  //groupname, vectorIndex in namesOfGroups. - used by collectdisplays.
+       int getNumSeqs()  {  return groupmap.size();  }
+       vector<string> getNamesSeqs();
+                       
 private:
        ifstream fileHandle;
        string groupFileName;
-       int numGroups;
+       int index;
        map<string, string>::iterator it;
        void setNamesOfGroups(string); 
        map<string, string> groupmap; //sequence name and groupname