Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/norm.symbolic.4.1.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
##fileformat=VCFv4.2
##FILTER=<ID=PASS,Description="All filters passed">
##INFO=<ID=END,Number=1,Type=Integer,Description="End position of the variant">
##INFO=<ID=SVLEN,Number=1,Type=Integer,Description="Difference in length between REF and ALT alleles">
##INFO=<ID=SVTYPE,Number=1,Type=String,Description="Type of structural variant">
##contig=<ID=1>
#CHROM POS ID REF ALT QUAL FILTER INFO
1 11 . G GGATTACA . PASS SVTYPE=DUP
1 11 . G <DUP> . PASS SVTYPE=DUP;END=18
1 11 . G <DUP> . PASS SVTYPE=DUP;SVLEN=7;END=18
8 changes: 8 additions & 0 deletions test/norm.symbolic.4.vcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##fileformat=VCFv4.2
##INFO=<ID=END,Number=1,Type=Integer,Description="End position of the variant">
##INFO=<ID=SVLEN,Number=1,Type=Integer,Description="Difference in length between REF and ALT alleles">
##INFO=<ID=SVTYPE,Number=1,Type=String,Description="Type of structural variant">
#CHROM POS ID REF ALT QUAL FILTER INFO
1 26 . G GATTACAG . PASS SVTYPE=DUP
1 26 . G <DUP> . PASS SVTYPE=DUP;END=33
1 26 . G <DUP> . PASS SVTYPE=DUP;SVLEN=7;END=33
1 change: 1 addition & 0 deletions test/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@
run_test(\&test_vcf_norm,$opts,in=>'norm.join-missing-ploidy',out=>'norm.join-missing-ploidy.1.out',args=>'-m +both');
run_test(\&test_vcf_norm,$opts,in=>'norm.split.5',out=>'norm.split.5.1.out',args=>'-m - --multi-overlaps .');
run_test(\&test_vcf_norm,$opts,in=>'norm.symbolic.3',out=>'norm.symbolic.3.1.out',fai=>'norm.symbolic.3',args=>'');
run_test(\&test_vcf_norm,$opts,in=>'norm.symbolic.4',out=>'norm.symbolic.4.1.out',fai=>'norm.symbolic.3',args=>'');
run_test(\&test_vcf_norm,$opts,in=>'norm',out=>'norm.out',fai=>'norm',args=>'-cx');
run_test(\&test_vcf_norm,$opts,in=>'norm.split',out=>'norm.split.out',args=>'-m-');
run_test(\&test_vcf_norm,$opts,in=>'norm.split',out=>'norm.split.1.out',args=>'-m- -a');
Expand Down
2 changes: 2 additions & 0 deletions vcfnorm.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,9 @@ static int realign(args_t *args, bcf1_t *line)
if ( !strncmp("<DEL",line->d.allele[i],4) ) sv_len = -line->rlen;
else if ( !strncmp("<DUP",line->d.allele[i],4) )
{
// the length of the duplication is given by INFO/SVLEN, or by INFO/END when SVLEN is absent
if ( bcf_get_info_int32(args->hdr,line,"SVLEN",&args->int32_arr,&args->nint32_arr)==1 ) sv_len = args->int32_arr[0];
else if ( bcf_get_info_int32(args->hdr,line,"END",&args->int32_arr,&args->nint32_arr)==1 ) sv_len = args->int32_arr[0] - (line->pos+1);
}
if ( !sv_len ) return ERR_SYMBOLIC;

Expand Down