X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=groupmap.h;h=29c174134eee5689e5210775dbde2f220010d551;hb=8e3e7b1e124f45cb1f2ca9d764ff67fa9b2e532b;hp=fd6c14605065ea3fd1f12613d89b6bca9a1e0861;hpb=9354b70bb84f6dd52ff4a1955754bcbf7edeedbf;p=mothur.git diff --git a/groupmap.h b/groupmap.h index fd6c146..29c1741 100644 --- a/groupmap.h +++ b/groupmap.h @@ -2,7 +2,7 @@ #define GROUPMAP_H /* * groupmap.h - * Dotur + * Mothur * * Created by Sarah Westcott on 12/1/08. * Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved. @@ -10,6 +10,7 @@ */ #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. */ @@ -19,18 +20,28 @@ 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 namesOfGroups; + vector getNamesOfGroups() { + sort(namesOfGroups.begin(), namesOfGroups.end()); + groupIndex.clear(); + for (int i = 0; i < namesOfGroups.size(); i++) { groupIndex[namesOfGroups[i]] = i; } + return namesOfGroups; + } + void setNamesOfGroups(vector sn) { namesOfGroups = sn; } map groupIndex; //groupname, vectorIndex in namesOfGroups. - used by collectdisplays and libshuff commands. int getNumSeqs() { return groupmap.size(); } vector getNamesSeqs(); + vector getNamesSeqs(vector); //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: + vector namesOfGroups; + MothurOut* m; ifstream fileHandle; string groupFileName; int index;