From cd65d352809ab157b72524d8542e1ee66e5a09c6 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Tue, 14 Sep 2010 23:25:10 +0000 Subject: [PATCH] fixed a bug in realignment --- Makefile | 2 +- bam_maqcns.c | 2 +- bam_md.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3ff3272..77cda86 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ bam_plcmd.o:bam.h faidx.h bam_maqcns.h glf.h bcftools/bcf.h bam2bcf.h bam_index.o:bam.h khash.h ksort.h razf.h bam_endian.h bam_lpileup.o:bam.h ksort.h bam_tview.o:bam.h faidx.h bam_maqcns.h -bam_maqcns.o:bam.h ksort.h bam_maqcns.h +bam_maqcns.o:bam.h ksort.h bam_maqcns.h kaln.h bam_sort.o:bam.h ksort.h razf.h bam_md.o:bam.h faidx.h glf.o:glf.h diff --git a/bam_maqcns.c b/bam_maqcns.c index dfc83e9..5715f9a 100644 --- a/bam_maqcns.c +++ b/bam_maqcns.c @@ -461,7 +461,7 @@ bam_maqindel_ret_t *bam_maqindel(int n, int pos, const bam_maqindel_opt_t *mi, c for (i = 0; i < n_types; ++i) { ka_param_t ap = ka_param_blast; ap.band_width = 2 * types[n_types - 1] + 2; - ap.gap_end = 0; + ap.gap_end_ext = 0; // write ref2 for (k = 0, j = left; j <= pos; ++j) ref2[k++] = bam_nt16_nt4_table[bam_nt16_table[(int)ref[j]]]; diff --git a/bam_md.c b/bam_md.c index 63c25e9..a4f4e01 100644 --- a/bam_md.c +++ b/bam_md.c @@ -142,6 +142,7 @@ int bam_realn(bam1_t *b, const char *ref) cigar = ka_global_core(s_ref, l_ref, s_read, c->l_qseq, &par, &score, &n_cigar); if (score <= 0) { // realignment failed free(cigar); free(s_ref); free(s_read); + return -1; } // copy over the alignment if (4 * (n_cigar - (int)c->n_cigar) + b->data_len > b->m_data) { // enlarge b->data -- 2.39.2