forked from Parsoa/SVDSS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fastq.hpp
45 lines (37 loc) · 820 Bytes
/
fastq.hpp
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
37
38
39
40
41
42
43
44
45
#ifndef FST_HPP
#define FST_HPP
#include <iterator>
#include <mutex>
#include <string>
#include <unordered_map>
#include <vector>
#include <zlib.h>
#include <kseq.h>
#ifdef __GNUC__
#pragma GCC system_header
#endif
KSEQ_INIT(gzFile, gzread)
using namespace std;
struct fastq_entry_t {
string head;
string seq;
string qual;
uint start;
uint len;
// constructor
fastq_entry_t(const string &h, const string &s, const string &q,
const uint st = 0, const uint l = 0)
: head(h), seq(s), qual(q) {
len = l;
start = st;
}
bool operator==(const fastq_entry_t &o) const { return seq == o.seq; }
};
namespace std {
template <> struct hash<fastq_entry_t> {
size_t operator()(const fastq_entry_t &k) const {
return hash<string>()(k.seq);
}
};
} // namespace std
#endif