-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfx.h
56 lines (47 loc) · 1011 Bytes
/
fx.h
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
46
47
48
49
50
51
52
53
54
55
56
#ifndef _FX_H_
#define _FX_H_ 1
#include <string>
#include <iostream>
#include "kseq.hpp"
struct ReadPair {
kseq first;
kseq second;
void clear() {
first.clear();
second.clear();
}
void print(FILE * out) {
first.print(out);
second.print(out);
}
};
inline std::ostream& operator<<(std::ostream& out, ReadPair& pair) {
out << pair.first <<pair.second;
return out;
}
struct Fxstream {
Fxstream();
~Fxstream();
int open(const char * file1, const char * file2, bool interleaved);
int close();
int read (kseq& read1, kseq& read2);
int read (ReadPair& pair);
std::string getFile1()
{
return fileName1;
}
std::string getFile2()
{
return fileName2;
}
private:
FunctorZlib gzr;
kstream<gzFile, FunctorZlib> * ks1;
kstream<gzFile, FunctorZlib> * ks2;
gzFile in1;
gzFile in2;
std::string fileName1;
std::string fileName2;
bool interleaved;
};
#endif