]> git.donarmstrong.com Git - mothur.git/blob - fastamap.h
deconvolute command
[mothur.git] / fastamap.h
1 #ifndef FASTAMAP_H
2 #define FASTAMAP_H
3
4 /*
5  *  fastamap.h
6  *  mothur
7  *
8  *  Created by Sarah Westcott on 1/16/09.
9  *  Copyright 2009 Schloss Lab UMASS AMherst. All rights reserved.
10  *
11  */
12  
13 using namespace std;
14  
15 #include <iostream>
16 #include <fstream>
17 #include <string>
18 #include <map>
19 #include "utilities.hpp"
20
21
22 class FastaMap  {
23
24 public:
25         FastaMap() {};
26         ~FastaMap() {};
27         
28         string getGroupName(string);  //pass a sequence name get its group
29         int getGroupNumber(string);  //pass a sequence name get number of sequence in its group
30         string getNames(string);        //pass a sequence get the string of names in the group separated by ','s.
31         void push_back(string, string); //sequencename, groupname
32         void set(string, string, string); //sequencename, groupname, groupnumber, names.
33         void clear();
34         int size();                                     //returns number of unique sequences
35         void print(ostream&);
36         void readFastaFile(ifstream&);
37
38 private:
39         struct group {
40                 string groupname;                                       //the group name for identical sequences, will be set to the first sequence found.
41                 int groupnumber;                                        //the number of sequence names with the same sequence.
42                 string names;                                           //the names of the sequence separated by ','.
43         };
44
45         map<string, group>  data;  //sequence, groupinfo
46         map<string, group>::iterator it;
47 };
48
49 #endif