Skip to content
Merged
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
5 changes: 1 addition & 4 deletions vcfnorm.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,7 @@ static int realign(args_t *args, bcf1_t *line)
// TODO: there should be check for symbolic allele length. If too big, perhaps should not attempt realignment
int32_t sv_len = 0;
if ( !strncmp("<DEL",line->d.allele[i],4) ) sv_len = -line->rlen;
else if ( !strncmp("<DUP",line->d.allele[i],4) )
{
if ( bcf_get_info_int32(args->hdr,line,"SVLEN",&args->int32_arr,&args->nint32_arr)==1 ) sv_len = args->int32_arr[0];
}
else if ( !strncmp("<DUP",line->d.allele[i],4) ) sv_len = line->rlen - 1; // like <DEL>, htslib sets rlen from INFO/END or INFO/SVLEN
if ( !sv_len ) return ERR_SYMBOLIC;

als[i].l = 0;
Expand Down