-
Notifications
You must be signed in to change notification settings - Fork 3
/
align.h
49 lines (40 loc) · 1.21 KB
/
align.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
#ifndef RB3_ALIGN_H
#define RB3_ALIGN_H
#include "fm-index.h"
#define RB3_SWF_E2E 0x1
#define RB3_SWF_HAPDIV 0x2
#define RB3_SWF_KEEP_RS 0x4
typedef struct {
uint32_t flag;
int32_t n_best;
int32_t min_sc, end_len, min_mem_len;
int32_t match, mis;
int32_t e2e_drop;
int32_t gap_open, gap_ext;
int32_t r2cache_size;
} rb3_swopt_t;
typedef struct {
int32_t score;
int32_t qlen, rlen;
int32_t n_cigar, cs_len;
int32_t n_qoff, blen, mlen;
int64_t lo, hi; // SA interval
int64_t sid, pos; // contig ID and position of a semi-random hit in [lo,hi)
uint8_t *rseq; // reference sequence in the alignment
uint32_t *cigar; // cigar in the BAM encoding
int32_t *qoff; // list of query offsets for the same hit
char *cs;
} rb3_swhit_t;
typedef struct {
int32_t n;
rb3_swhit_t *a;
} rb3_swrst_t;
#define RB2_SW_MAX_ED 6
typedef struct {
int32_t n_al, max_ed, n_hap[RB2_SW_MAX_ED + 1];
} rb3_hapdiv_t;
void rb3_swopt_init(rb3_swopt_t *opt);
void rb3_sw(void *km, const rb3_swopt_t *opt, const rb3_fmi_t *f, int len, const uint8_t *seq, rb3_swrst_t *rst);
void rb3_hapdiv(void *km, const rb3_swopt_t *opt, const rb3_fmi_t *f, int len, const uint8_t *seq, rb3_hapdiv_t *hd);
void rb3_swrst_free(rb3_swrst_t *rst);
#endif