X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=counttable.h;h=51d0b4544bc73c7e832826bad702028f0143a549;hp=8baff3080a5f5124214e0b6b6834a899b356f0f9;hb=d1c97b8c04bb75faca1e76ffad60b37a4d789d3d;hpb=5a4ac4f954c4b4445bcee272f1f8220ddcc9c1e4 diff --git a/counttable.h b/counttable.h index 8baff30..51d0b45 100644 --- a/counttable.h +++ b/counttable.h @@ -38,32 +38,55 @@ #include "mothurout.h" #include "listvector.hpp" +#include "groupmap.h" class CountTable { public: - CountTable() { m = MothurOut::getInstance(); hasGroups = false; total = 0; } + CountTable() { m = MothurOut::getInstance(); hasGroups = false; total = 0; uniques = 0; } ~CountTable() {} - int readTable(string); + //reads and creates smart enough to eliminate groups with zero counts + int createTable(set&, map&, set&); //seqNames, seqName->group, groupNames + int createTable(string, string, bool); //namefile, groupfile, createGroup + int readTable(string, bool); + + int printTable(string); + int printHeaders(ofstream&); + int printSeq(ofstream&, string); + bool testGroups(string file); //used to check if file has group data without reading it. + int copy(CountTable*); bool hasGroupInfo() { return hasGroups; } int getNumGroups() { return groups.size(); } vector getNamesOfGroups() { return groups; } //returns group names, if no group info vector is blank. + int addGroup(string); + int removeGroup(string); + + int renameSeq(string, string); //used to change name of sequence for use with trees + int setAbund(string, string, int); //set abundance number of seqs for that group for that seq + int push_back(string); //add a sequence + int push_back(string, int); //add a sequence + int push_back(string, vector); //add a sequence with group info + int remove(string); //remove seq + int get(string); //returns unique sequence index for reading distance matrices like NameAssignment + int size() { return indexNameMap.size(); } + vector getGroups(string); //returns vector of groups represented by this sequences vector getGroupCounts(string); //returns group counts for a seq passed in, if no group info is in file vector is blank. Order is the same as the groups returned by getGroups function. int getGroupCount(string, string); //returns number of seqs for that group for that seq int getGroupCount(string); // returns total seqs for that group - int getNumSeqs(string); //returns total seqs for that seq + int getNumSeqs(string); //returns total seqs for that seq, 0 if not found int getNumSeqs() { return total; } //return total number of seqs int getNumUniqueSeqs() { return uniques; } //return number of unique/representative seqs int getGroupIndex(string); //returns index in getGroupCounts vector of specific group + vector getNamesOfSeqs(); + vector getNamesOfSeqs(string); int mergeCounts(string, string); //combines counts for 2 seqs, saving under the first name passed in. - int get(string); //returns unique sequence index for reading distance matrices like NameAssignment ListVector getListVector(); - int size() { return indexNameMap.size(); } + map getNameMap(); private: string filename;