]> git.donarmstrong.com Git - samtools.git/blobdiff - bam_maqcns.c
* samtools-0.1.6-21 (r508)
[samtools.git] / bam_maqcns.c
index 7aed741ca9c5df15df51c0d72af743f23388ef0f..71c2185df0f27d53f74192d1d90625ca7ccb14ac 100644 (file)
@@ -399,6 +399,10 @@ bam_maqindel_ret_t *bam_maqindel(int n, int pos, const bam_maqindel_opt_t *mi, c
                left = pos > INDEL_WINDOW_SIZE? pos - INDEL_WINDOW_SIZE : 0;
                right = pos + INDEL_WINDOW_SIZE;
                if (types[0] < 0) right -= types[0];
+               // in case the alignments stand out the reference
+               for (i = pos; i < right; ++i)
+                       if (ref[i] == 0) break;
+               right = i;
        }
        { // the core part
                char *ref2, *rs, *inscns = 0;