BFGraph
fastq.hpp
1 #ifndef FASTQ_H
2 #define FASTQ_H
3 
4 #include <stdio.h>
5 #include <string.h>
6 #include <zlib.h>
7 
8 
9 #include <vector>
10 #include <string>
11 
12 #include "Common.hpp"
13 
14 #ifndef KSEQ_INIT_READY
15 #define KSEQ_INIT_READY
16 #include "kseq.h"
17 KSEQ_INIT(gzFile, gzread);
18 #endif
19 
20 // initialize kseq structures
21 //KSEQ_INIT(gzFile, gzread);
22 
23 
24 class FastqFile {
25  public:
26  FastqFile(const vector<string> fnames);
27 
28  ~FastqFile();
29 
30  void close();
31  void reopen();
32  int read_next(char *read, size_t *read_len, string &seq, size_t *seq_len, unsigned int *file_id, char *qual = NULL);
33 
34  vector<string>::const_iterator fnit; // Current filename
35  unsigned int file_no;
36 
37  private:
38  vector<string>::const_iterator open_next(); // Method
39 
40  vector<string> fnames; // All fasta/fastq files
41  gzFile fp;
42  kseq_t *kseq;
43 };
44 
45 #endif // FASTQ_H
Definition: fastq.hpp:17
Definition: fastq.hpp:24