X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=fastamap.h;h=e1ff3dff2f9ceab1c663f0646141594fe1d20339;hp=355a8df51786bdac9c229aed9d4233bd46d41c3e;hb=d1c97b8c04bb75faca1e76ffad60b37a4d789d3d;hpb=c5c7502f435e1413c19e373dab1dfebcaa67588d diff --git a/fastamap.h b/fastamap.h index 355a8df..e1ff3df 100644 --- a/fastamap.h +++ b/fastamap.h @@ -10,9 +10,8 @@ * */ -using namespace std; - #include "mothur.h" +#include "mothurout.h" /* This class represents the fasta file. It reads a fasta file a populates the internal data structure "data". @@ -23,30 +22,28 @@ a list of the sequences names who have the same sequence and a number of how man class FastaMap { public: - FastaMap() {}; + FastaMap() { m = MothurOut::getInstance(); } ~FastaMap() {}; string getGroupName(string); //pass a sequence name get its group - int getGroupNumber(string); //pass a sequence name get number of sequence in its group string getNames(string); //pass a sequence get the string of names in the group separated by ','s. void push_back(string, string); //sequencename, sequence int sizeUnique(); //returns number of unique sequences - void printNamesFile(ostream&); //produces a 2 column file with the groupname in the first column and the names in the second column - a names file. - void printCondensedFasta(ostream&); //produces a fasta file. - void readFastaFile(ifstream&); + void printNamesFile(string); //produces a 2 column file with the groupname in the first column and the names in the second column - a names file. + void printCondensedFasta(string); //produces a fasta file. + void readFastaFile(string); + void readFastaFile(string, string); string getSequence(string); //pass it a name of a sequence, it returns the sequence. private: struct group { string groupname; //the group name for identical sequences, will be set to the first sequence found. - int groupnumber; //the number of sequence names with the same sequence. string names; //the names of the sequence separated by ','. }; map data; //sequence, groupinfo - condensed representation of file map seqmap; //name, sequence - uncondensed representation of file - map::iterator it; - map::iterator it2; + MothurOut* m; }; #endif