move mem_fill_scmat() to bwa.{h,c}
This commit is contained in:
parent
efd9769b07
commit
07921659cf
11
bwa.c
11
bwa.c
|
|
@ -69,6 +69,17 @@ bseq1_t *bseq_read(int chunk_size, int *n_, void *ks1_, void *ks2_)
|
||||||
* CIGAR related *
|
* CIGAR related *
|
||||||
*****************/
|
*****************/
|
||||||
|
|
||||||
|
void bwa_fill_scmat(int a, int b, int8_t mat[25])
|
||||||
|
{
|
||||||
|
int i, j, k;
|
||||||
|
for (i = k = 0; i < 4; ++i) {
|
||||||
|
for (j = 0; j < 4; ++j)
|
||||||
|
mat[k++] = i == j? a : -b;
|
||||||
|
mat[k++] = 0; // ambiguous base
|
||||||
|
}
|
||||||
|
for (j = 0; j < 5; ++j) mat[k++] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Generate CIGAR when the alignment end points are known
|
// Generate CIGAR when the alignment end points are known
|
||||||
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)
|
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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
1
bwa.h
1
bwa.h
|
|
@ -30,6 +30,7 @@ extern "C" {
|
||||||
|
|
||||||
bseq1_t *bseq_read(int chunk_size, int *n_, void *ks1_, void *ks2_);
|
bseq1_t *bseq_read(int chunk_size, int *n_, void *ks1_, void *ks2_);
|
||||||
|
|
||||||
|
void bwa_fill_scmat(int a, int b, int8_t mat[25]);
|
||||||
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);
|
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);
|
||||||
int bwa_fix_xref(const int8_t mat[25], int q, int r, int w, const bntseq_t *bns, const uint8_t *pac, uint8_t *query, int *qb, int *qe, int64_t *rb, int64_t *re);
|
int bwa_fix_xref(const int8_t mat[25], int q, int r, int w, const bntseq_t *bns, const uint8_t *pac, uint8_t *query, int *qb, int *qe, int64_t *rb, int64_t *re);
|
||||||
|
|
||||||
|
|
|
||||||
13
bwamem.c
13
bwamem.c
|
|
@ -58,21 +58,10 @@ mem_opt_t *mem_opt_init()
|
||||||
o->chunk_size = 10000000;
|
o->chunk_size = 10000000;
|
||||||
o->n_threads = 1;
|
o->n_threads = 1;
|
||||||
o->max_matesw = 100;
|
o->max_matesw = 100;
|
||||||
mem_fill_scmat(o->a, o->b, o->mat);
|
bwa_fill_scmat(o->a, o->b, o->mat);
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mem_fill_scmat(int a, int b, int8_t mat[25])
|
|
||||||
{
|
|
||||||
int i, j, k;
|
|
||||||
for (i = k = 0; i < 4; ++i) {
|
|
||||||
for (j = 0; j < 4; ++j)
|
|
||||||
mat[k++] = i == j? a : -b;
|
|
||||||
mat[k++] = 0; // ambiguous base
|
|
||||||
}
|
|
||||||
for (j = 0; j < 5; ++j) mat[k++] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***************************
|
/***************************
|
||||||
* SMEM iterator interface *
|
* SMEM iterator interface *
|
||||||
***************************/
|
***************************/
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ int main_mem(int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
mem_fill_scmat(opt->a, opt->b, opt->mat);
|
bwa_fill_scmat(opt->a, opt->b, opt->mat);
|
||||||
if ((idx = bwa_idx_load(argv[optind], BWA_IDX_ALL)) == 0) return 1; // FIXME: memory leak
|
if ((idx = bwa_idx_load(argv[optind], BWA_IDX_ALL)) == 0) return 1; // FIXME: memory leak
|
||||||
bwa_print_sam_hdr(idx->bns, rg_line);
|
bwa_print_sam_hdr(idx->bns, rg_line);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue