]> git.donarmstrong.com Git - samtools.git/commitdiff
fixed a bug in realignment
authorHeng Li <lh3@live.co.uk>
Tue, 14 Sep 2010 23:25:10 +0000 (23:25 +0000)
committerHeng Li <lh3@live.co.uk>
Tue, 14 Sep 2010 23:25:10 +0000 (23:25 +0000)
Makefile
bam_maqcns.c
bam_md.c

index 3ff3272165c5e87e1bcda15bcade2baf100b53ad..77cda865c4b38df76fdafe338feae873dabde0e6 100644 (file)
--- 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
index dfc83e9407e3bf635be009af4d4be50240c13e61..5715f9aafca24abad9e0cc17e2ef1f567e9f3fc8 100644 (file)
@@ -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]]];
index 63c25e961d704b0c555eaea115fe69f38275e17b..a4f4e01ce2672556746c399af379a325b61273af 100644 (file)
--- 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