]> git.donarmstrong.com Git - mothur.git/blobdiff - groupmap.h
added citation function to commands
[mothur.git] / groupmap.h
index a6b6fd7c25158a4ee7195d0f8e0432dfdecd078a..54085a19bab041d0caf17981c8c6c81f05a0c8b9 100644 (file)
@@ -9,32 +9,39 @@
  *
  */
 
-#include <map>
-#include <string>
-#include <iostream>
-#include <fstream>
-#include "utilities.hpp"
+#include "mothur.h"
+#include "mothurout.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 readMap();
+       int readDesignMap();
        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.
-               
+       map<string, int> groupIndex;  //groupname, vectorIndex in namesOfGroups. - used by collectdisplays and libshuff commands.
+       int getNumSeqs()  {  return groupmap.size();  }
+       vector<string> getNamesSeqs();
+       vector<string> getNamesSeqs(vector<string>); //get names of seqs belonging to a group or set of groups
+       int getNumSeqs(string); //return the number of seqs in a given group
+                       
 private:
+       MothurOut* m;
        ifstream fileHandle;
        string groupFileName;
-       int numGroups, index;
+       int index;
        map<string, string>::iterator it;
        void setNamesOfGroups(string); 
        map<string, string> groupmap; //sequence name and groupname
+       map<string, int> seqsPerGroup;  //maps groupname to number of seqs in that group
 };
 
 #endif