-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype.h
76 lines (61 loc) · 1.62 KB
/
type.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#pragma once
#include "const.h"
struct Alignment {
std::string cigar_string;
int ref_begin;
int mismatches;
};
struct Interval {
uint32_t s, e; // start, end position of the reference match to the whole read
};
struct Region {
uint32_t rs, re; // start, end position of the reference match to the whole read
uint32_t qs, qe; // start, end position of matched seed in the query (read)
uint16_t cov;
uint16_t embed_dist;
int score;
std::vector<uint32_t> matched_intervals; // list of start pos of matched seeds in read that indicate to this region
bool operator()(Region &X, Region &Y) {
if (X.rs == Y.rs)
return X.qs < Y.qs;
else
return X.rs < Y.rs;
}
};
struct Read {
char name[MAX_LEN], qua[MAX_LEN], seq[MAX_LEN], fwd[MAX_LEN], rev[MAX_LEN], rev_str[MAX_LEN], cigar[MAX_LEN];
int tid, as, nm, best, secBest;
uint32_t pos;
char strand;
short mapq, kmer_step; //kmer_step used that find the seed
Region best_region;
bool mapped_to_ga;
bool isAligned;
friend gzFile &operator>>(gzFile &in, Read &r);
Read() {
best = INT_MAX;
secBest = INT_MAX;
}
Read makeCopy() {
return *this;
}
};
class Reference {
public:
void load_index(const char *F, const char *ext);
Reference(const char *F, bool is_ga);
std::string ref;
std::vector<std::string> name;
std::vector<uint32_t> offset;
uint32_t *keyv, *posv;
uint32_t nposv, nkeyv;
~Reference();
};
typedef std::tuple<Read *, Read *, int> ReadCnt;
typedef std::tuple<Read *, Read *> ReadPair;
typedef struct {
uint32_t capacity;
uint32_t n_cigar;
int32_t dp_score;
uint32_t cigar[];
} Extension;