Skip to content

Commit

Permalink
Overlapping deletions must not be forgotten in subsequent records wit…
Browse files Browse the repository at this point in the history
…h -a N.

Fixes samtools#1155
  • Loading branch information
pd3 committed Feb 18, 2020
1 parent 3f96f33 commit f3203e3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions consensus.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ static void apply_absent(args_t *args, hts_pos_t pos)
}
static void freeze_ref(args_t *args, bcf1_t *rec)
{
if ( args->fa_frz_pos >= rec->pos + rec->rlen - 1 ) return;
args->fa_frz_pos = rec->pos + rec->rlen - 1;
args->fa_frz_mod = rec->pos - args->fa_ori_pos + args->fa_mod_off + rec->rlen;
}
Expand Down
2 changes: 2 additions & 0 deletions test/consensus.11.1.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>1
CGCGCACCCACGTATACGCGTA
2 changes: 2 additions & 0 deletions test/consensus.11.2.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>1
NNNNNNNNNNNNNNTNNNNNNN
2 changes: 2 additions & 0 deletions test/consensus.11.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>1
CGCGCACCCACGTATACGTGTACACGCGTA
7 changes: 7 additions & 0 deletions test/consensus.11.vcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
##fileformat=VCFv4.2
##contig=<ID=1,length=249250621>
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT smpl
1 15 . TACGTGTAC T . . . GT 0/1
1 18 . G A . . . GT 0/0
1 19 . T C . . . GT 1/1

0 comments on commit f3203e3

Please sign in to comment.