2013-02-24 04:30:46 +08:00
|
|
|
#ifndef BWA_H_
|
|
|
|
|
#define BWA_H_
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2013-02-24 04:55:55 +08:00
|
|
|
#include "bntseq.h"
|
|
|
|
|
#include "bwt.h"
|
|
|
|
|
|
|
|
|
|
#define BWA_IDX_BWT 0x1
|
|
|
|
|
#define BWA_IDX_BNS 0x2
|
|
|
|
|
#define BWA_IDX_PAC 0x4
|
|
|
|
|
#define BWA_IDX_ALL 0x7
|
|
|
|
|
|
2014-10-16 11:06:03 +08:00
|
|
|
#define BWA_CTL_SIZE 0x10000
|
2014-10-16 02:44:08 +08:00
|
|
|
|
2013-02-24 04:55:55 +08:00
|
|
|
typedef struct {
|
|
|
|
|
bwt_t *bwt; // FM-index
|
|
|
|
|
bntseq_t *bns; // information on the reference sequences
|
|
|
|
|
uint8_t *pac; // the actual 2-bit encoded reference sequences with 'N' converted to a random base
|
2014-10-16 00:27:45 +08:00
|
|
|
|
2014-10-16 02:44:08 +08:00
|
|
|
int is_shm;
|
2014-10-16 00:27:45 +08:00
|
|
|
int64_t l_mem;
|
2014-10-16 02:44:08 +08:00
|
|
|
uint8_t *mem;
|
2013-02-24 04:55:55 +08:00
|
|
|
} bwaidx_t;
|
2013-02-24 04:30:46 +08:00
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
int l_seq;
|
|
|
|
|
char *name, *comment, *seq, *qual, *sam;
|
|
|
|
|
} bseq1_t;
|
|
|
|
|
|
2013-02-24 05:10:48 +08:00
|
|
|
extern int bwa_verbose;
|
2013-02-24 05:41:44 +08:00
|
|
|
extern char bwa_rg_id[256];
|
2013-02-24 05:10:48 +08:00
|
|
|
|
2013-02-24 04:30:46 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
bseq1_t *bseq_read(int chunk_size, int *n_, void *ks1_, void *ks2_);
|
|
|
|
|
|
2013-03-05 22:38:12 +08:00
|
|
|
void bwa_fill_scmat(int a, int b, int8_t mat[25]);
|
2013-02-27 02:36:01 +08:00
|
|
|
uint32_t *bwa_gen_cigar(const int8_t mat[25], int q, int r, int w_, int64_t l_pac, const uint8_t *pac, int l_query, uint8_t *query, int64_t rb, int64_t re, int *score, int *n_cigar, int *NM);
|
2014-03-29 02:54:06 +08:00
|
|
|
uint32_t *bwa_gen_cigar2(const int8_t mat[25], int o_del, int e_del, int o_ins, int e_ins, int w_, int64_t l_pac, const uint8_t *pac, int l_query, uint8_t *query, int64_t rb, int64_t re, int *score, int *n_cigar, int *NM);
|
2013-02-24 04:30:46 +08:00
|
|
|
|
2013-02-24 05:10:48 +08:00
|
|
|
char *bwa_idx_infer_prefix(const char *hint);
|
|
|
|
|
bwt_t *bwa_idx_load_bwt(const char *hint);
|
2013-02-25 02:09:29 +08:00
|
|
|
|
2014-10-16 03:44:06 +08:00
|
|
|
bwaidx_t *bwa_idx_load_from_shm(const char *hint);
|
|
|
|
|
bwaidx_t *bwa_idx_load_from_disk(const char *hint, int which);
|
2013-02-24 05:10:48 +08:00
|
|
|
bwaidx_t *bwa_idx_load(const char *hint, int which);
|
2013-02-24 04:55:55 +08:00
|
|
|
void bwa_idx_destroy(bwaidx_t *idx);
|
2014-10-16 00:27:45 +08:00
|
|
|
int bwa_idx2mem(bwaidx_t *idx);
|
2014-10-16 02:44:08 +08:00
|
|
|
int bwa_mem2idx(int64_t l_mem, uint8_t *mem, bwaidx_t *idx);
|
2013-02-24 04:55:55 +08:00
|
|
|
|
2013-02-24 05:41:44 +08:00
|
|
|
void bwa_print_sam_hdr(const bntseq_t *bns, const char *rg_line);
|
|
|
|
|
char *bwa_set_rg(const char *s);
|
|
|
|
|
|
2013-02-24 04:30:46 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|