forked from abyzovlab/CNVnator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FastaParser.hh
36 lines (30 loc) · 833 Bytes
/
FastaParser.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __FASTAPARSER__
#define __FASTAPARSER__
#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <sstream>
#include <vector>
#include <algorithm>
#include <zlib.h>
using namespace std;
// Parse genome data from .fasta.gz file
class FastaParser {
private:
gzFile inFile;
string buff;
string c_name;
string c_data;
int n_cinb;
bool eof;
static const int sbuffs;
char *sbuff;
public:
inline string getName() {return c_name;} // returuns the name of current chromosome
inline string getData() {return c_data;} // returns the the content of current chormosome
bool nextChromosome(); // go to next chromosome in fasta file (returns false if eof)
FastaParser(string fileName); // constructor - takes fa.gz filename as argument
~FastaParser(); // destructor
};
#endif