-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfastq.hpp
43 lines (36 loc) · 880 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
#ifndef FST_HPP
#define FST_HPP
#include <mutex>
#include <vector>
#include <string>
#include <iterator>
#include <unordered_map>
#ifdef __GNUC__
#pragma GCC system_header
#endif
#include <zlib.h>
#include "kseq.h"
KSEQ_INIT(gzFile, gzread)
struct fastq_entry_t {
std::string head ;
std::string seq ;
std::string qual ;
uint start ;
uint len ;
// constructor
fastq_entry_t(const std::string &h, const std::string &s, const std::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> {
std::size_t operator()(const fastq_entry_t& k) const {
return std::hash<std::string>()(k.seq) ;
}
};
}
#endif