2011-01-14 09:52:12 +08:00
|
|
|
#ifndef LH3_BWTSW2_H
|
|
|
|
|
#define LH3_BWTSW2_H
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include "bntseq.h"
|
|
|
|
|
#include "bwt_lite.h"
|
|
|
|
|
#include "bwt.h"
|
|
|
|
|
|
2011-11-13 01:12:45 +08:00
|
|
|
#define BSW2_FLAG_MATESW 0x100
|
|
|
|
|
#define BSW2_FLAG_TANDEM 0x200
|
|
|
|
|
#define BSW2_FLAG_MOVED 0x400
|
|
|
|
|
#define BSW2_FLAG_RESCUED 0x800
|
2011-11-07 05:20:40 +08:00
|
|
|
|
2011-01-14 09:52:12 +08:00
|
|
|
typedef struct {
|
2012-10-27 00:54:32 +08:00
|
|
|
int skip_sw:8, cpy_cmt:8, hard_clip:16;
|
2012-06-29 02:51:02 +08:00
|
|
|
int a, b, q, r, t, qr, bw, max_ins, max_chain_gap;
|
2012-04-18 08:43:43 +08:00
|
|
|
int z, is, t_seeds, multi_2nd;
|
2011-11-24 12:30:14 +08:00
|
|
|
float mask_level, coef;
|
2011-01-14 09:52:12 +08:00
|
|
|
int n_threads, chunk_size;
|
|
|
|
|
} bsw2opt_t;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2011-10-22 01:32:45 +08:00
|
|
|
bwtint_t k, l;
|
2011-10-24 21:36:52 +08:00
|
|
|
uint32_t flag:18, n_seeds:13, is_rev:1;
|
2011-01-14 09:52:12 +08:00
|
|
|
int len, G, G2;
|
|
|
|
|
int beg, end;
|
|
|
|
|
} bsw2hit_t;
|
|
|
|
|
|
2011-11-12 13:49:21 +08:00
|
|
|
typedef struct {
|
2011-11-25 00:51:38 +08:00
|
|
|
int flag, nn, n_cigar, chr, pos, qual, mchr, mpos, pqual, isize, nm;
|
2011-11-12 13:49:21 +08:00
|
|
|
uint32_t *cigar;
|
|
|
|
|
} bsw2aux_t;
|
|
|
|
|
|
2011-01-14 09:52:12 +08:00
|
|
|
typedef struct {
|
|
|
|
|
int n, max;
|
|
|
|
|
bsw2hit_t *hits;
|
2011-11-12 13:49:21 +08:00
|
|
|
bsw2aux_t *aux;
|
2011-01-14 09:52:12 +08:00
|
|
|
} bwtsw2_t;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
void *stack;
|
|
|
|
|
int max_l;
|
|
|
|
|
uint8_t *aln_mem;
|
|
|
|
|
} bsw2global_t;
|
|
|
|
|
|
2011-11-06 11:17:52 +08:00
|
|
|
typedef struct {
|
|
|
|
|
int l, tid;
|
2012-10-27 00:54:32 +08:00
|
|
|
char *name, *seq, *qual, *sam, *comment;
|
2011-11-06 11:17:52 +08:00
|
|
|
} bsw2seq1_t;
|
|
|
|
|
|
2011-01-14 09:52:12 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
bsw2opt_t *bsw2_init_opt();
|
2011-10-24 21:36:52 +08:00
|
|
|
bwtsw2_t **bsw2_core(const bntseq_t *bns, const bsw2opt_t *opt, const bwtl_t *target, const bwt_t *query, bsw2global_t *pool);
|
2011-11-06 02:00:01 +08:00
|
|
|
void bsw2_aln(const bsw2opt_t *opt, const bntseq_t *bns, bwt_t * const target, const char *fn, const char *fn2);
|
2011-01-14 09:52:12 +08:00
|
|
|
void bsw2_destroy(bwtsw2_t *b);
|
|
|
|
|
|
|
|
|
|
bsw2global_t *bsw2_global_init();
|
|
|
|
|
void bsw2_global_destroy(bsw2global_t *_pool);
|
|
|
|
|
|
2011-11-07 05:20:40 +08:00
|
|
|
void bsw2_pair(const bsw2opt_t *opt, int64_t l_pac, const uint8_t *pac, int n, bsw2seq1_t *seq, bwtsw2_t **hit);
|
2011-11-06 11:17:52 +08:00
|
|
|
|
2011-01-14 09:52:12 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|