2013-02-01 02:59:48 +08:00
|
|
|
#ifndef BWAMEM_H_
|
|
|
|
|
#define BWAMEM_H_
|
|
|
|
|
|
|
|
|
|
#include "bwt.h"
|
2013-02-08 02:13:43 +08:00
|
|
|
#include "bntseq.h"
|
2013-02-24 04:30:46 +08:00
|
|
|
#include "bwa.h"
|
2013-02-01 02:59:48 +08:00
|
|
|
|
2013-02-13 05:15:26 +08:00
|
|
|
#define MEM_MAPQ_COEF 40.0
|
2013-02-19 13:50:39 +08:00
|
|
|
#define MEM_MAPQ_MAX 60
|
2013-02-13 05:15:26 +08:00
|
|
|
|
2013-02-02 03:38:44 +08:00
|
|
|
struct __smem_i;
|
|
|
|
|
typedef struct __smem_i smem_i;
|
2013-02-01 02:59:48 +08:00
|
|
|
|
2013-02-19 05:33:06 +08:00
|
|
|
#define MEM_F_HARDCLIP 0x1
|
|
|
|
|
#define MEM_F_PE 0x2
|
|
|
|
|
#define MEM_F_NOPAIRING 0x4
|
|
|
|
|
|
2013-02-01 02:59:48 +08:00
|
|
|
typedef struct {
|
|
|
|
|
int a, b, q, r, w;
|
2013-02-19 05:33:06 +08:00
|
|
|
int flag;
|
2013-02-09 05:56:28 +08:00
|
|
|
int split_width;
|
2013-02-01 04:55:22 +08:00
|
|
|
int min_seed_len, max_occ, max_chain_gap;
|
2013-02-08 02:13:43 +08:00
|
|
|
int n_threads, chunk_size;
|
2013-02-19 05:33:06 +08:00
|
|
|
int pe_dir;
|
2013-02-22 01:52:00 +08:00
|
|
|
float mask_level;
|
|
|
|
|
float chain_drop_ratio;
|
|
|
|
|
float split_factor; // split into a seed if MEM is longer than min_seed_len*split_factor
|
2013-02-21 08:11:44 +08:00
|
|
|
int pen_unpaired; // phred-scaled penalty for unpaired reads
|
2013-02-11 23:59:38 +08:00
|
|
|
int max_ins; // maximum insert size
|
2013-02-08 02:13:43 +08:00
|
|
|
int8_t mat[25]; // scoring matrix; mat[0] == 0 if unset
|
2013-02-02 05:39:50 +08:00
|
|
|
} mem_opt_t;
|
2013-02-01 02:59:48 +08:00
|
|
|
|
2013-02-02 05:39:50 +08:00
|
|
|
typedef struct {
|
2013-02-07 01:25:49 +08:00
|
|
|
int64_t rb, re;
|
2013-02-09 03:46:57 +08:00
|
|
|
int score, qb, qe, seedcov, sub, csub; // sub: suboptimal score; csub: suboptimal inside the chain
|
2013-02-13 04:52:23 +08:00
|
|
|
int sub_n; // approximate number of suboptimal hits
|
|
|
|
|
int secondary; // non-negative if the hit is secondary
|
2013-02-07 02:59:32 +08:00
|
|
|
} mem_alnreg_t;
|
2013-02-01 04:55:22 +08:00
|
|
|
|
2013-02-11 23:59:38 +08:00
|
|
|
typedef struct {
|
|
|
|
|
int low, high, failed;
|
|
|
|
|
double avg, std;
|
|
|
|
|
} mem_pestat_t;
|
|
|
|
|
|
2013-02-12 04:29:03 +08:00
|
|
|
typedef struct {
|
|
|
|
|
int64_t rb, re;
|
|
|
|
|
int qb, qe, flag, qual;
|
|
|
|
|
// optional info
|
|
|
|
|
int score, sub;
|
|
|
|
|
} bwahit_t;
|
|
|
|
|
|
2013-02-12 23:36:15 +08:00
|
|
|
typedef struct { size_t n, m; mem_alnreg_t *a; } mem_alnreg_v;
|
2013-02-08 02:13:43 +08:00
|
|
|
|
2013-02-01 02:59:48 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-02-25 01:17:29 +08:00
|
|
|
smem_i *smem_itr_init(const bwt_t *bwt);
|
|
|
|
|
void smem_itr_destroy(smem_i *itr);
|
|
|
|
|
void smem_set_query(smem_i *itr, int len, const uint8_t *query);
|
|
|
|
|
const bwtintv_v *smem_next(smem_i *itr, int split_len, int split_width);
|
2013-02-01 02:59:48 +08:00
|
|
|
|
2013-02-25 01:17:29 +08:00
|
|
|
mem_opt_t *mem_opt_init(void);
|
|
|
|
|
void mem_fill_scmat(int a, int b, int8_t mat[25]);
|
2013-02-01 05:26:05 +08:00
|
|
|
|
2013-02-25 01:17:29 +08:00
|
|
|
int mem_process_seqs(const mem_opt_t *opt, const bwt_t *bwt, const bntseq_t *bns, const uint8_t *pac, int n, bseq1_t *seqs);
|
2013-02-08 02:13:43 +08:00
|
|
|
|
2013-02-25 01:17:29 +08:00
|
|
|
void mem_pestat(const mem_opt_t *opt, int64_t l_pac, int n, const mem_alnreg_v *regs, mem_pestat_t pes[4]);
|
2013-02-11 23:59:38 +08:00
|
|
|
|
2013-02-01 02:59:48 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|