1 #ifndef SEQUENCEPARSER_H
2 #define SEQUENCEPARSER_H
3 
4 /*
5  *  sequenceParser.h
6  *  Mothur
7  *
8  *  Created by westcott on 9/9/11.
9  *  Copyright 2011 Schloss Lab. All rights reserved.
10  *
11  */
12 
13 
14 #include "utils.hpp"
15 #include "mothurout.h"
16 #include "sequence.hpp"
17 #include "groupmap.h"
18 #include "splitgroupscommand.h"
19 
20 /* This class reads a fasta and group file with a namesfile as optional and parses the data by group.
21 
22 	Note: The sum of all the groups unique sequences will be larger than the original number of unique sequences.
23 	This is because when we parse the name file we make a unique for each group instead of 1 unique for all
24 	groups.
25 
26  */
27 
28 class SequenceParser {
29 
30 	public:
31 
32 		SequenceParser(string, string, vector<string>);			//group, fasta, groups (if blanks then all) - file mismatches will set m->setControl_pressed(true)
33 		SequenceParser(string, string, string, vector<string>);	//group, fasta, name, groups (if blanks then all) - file mismatches will set m->setControl_pressed(true)
34 		~SequenceParser();
35 
36 		//general operations
37 		int getNumGroups();
38 		vector<string> getNamesOfGroups();
39 
40         vector<string> getFiles(string);  //returns fasta and count file a specific group.
getFiles()41         map<string, vector<string> > getFiles() { return groupToFiles; } //returns all files groupName - > vector of groups files (fasta, optionalName, group);
42 
43 	private:
44 		MothurOut* m;
45         Utils util;
46         bool hasName;
47 
48         map<string, vector<string> > groupToFiles; //groupName -> fasta, name, group or groupName -> fasta, group
49         vector<string> namesOfGroups; //namesOfGroups in same order as groupToSeqs;
50  };
51 
52 #endif
53 
54