From 3eda626bd613909e151b9b69c0221945bbd9e475 Mon Sep 17 00:00:00 2001 From: Nuno Agostinho Date: Thu, 14 Mar 2024 13:25:38 +0000 Subject: [PATCH 1/3] Fix SVTYPE when using IUPAC nucleotide codes --- modules/Bio/EnsEMBL/VEP/Parser/VCF.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/Bio/EnsEMBL/VEP/Parser/VCF.pm b/modules/Bio/EnsEMBL/VEP/Parser/VCF.pm index 8cebd55e8..bb5972e12 100644 --- a/modules/Bio/EnsEMBL/VEP/Parser/VCF.pm +++ b/modules/Bio/EnsEMBL/VEP/Parser/VCF.pm @@ -460,9 +460,15 @@ sub create_StructuralVariationFeatures { $parser->get_IDs, ); - ## get structural variant type from SVTYPE tag (deprecated in VCF 4.4) or ALT + ## get structural variant type from ALT or (deprecated) SVTYPE tag my $alt = join("/", @$alts); - my $type = $alt ne '.' ? $alt : $info->{SVTYPE}; + my $type = $alt; + + # replace with SVTYPE tag if ALT does not follow VCF 4.4 specs + if ($info->{SVTYPE} && $alt !~ /^{SVTYPE}; + } + my $so_term = $self->get_SO_term($type); unless ($so_term) { $skip_line = 1; From 0b706f2e21c46b22c70447961da88ff62961e2bb Mon Sep 17 00:00:00 2001 From: Nuno Agostinho Date: Thu, 14 Mar 2024 13:38:08 +0000 Subject: [PATCH 2/3] Improve warning message for unsupported SV types --- modules/Bio/EnsEMBL/VEP/Parser.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Bio/EnsEMBL/VEP/Parser.pm b/modules/Bio/EnsEMBL/VEP/Parser.pm index b328db8d5..5270770f4 100755 --- a/modules/Bio/EnsEMBL/VEP/Parser.pm +++ b/modules/Bio/EnsEMBL/VEP/Parser.pm @@ -723,7 +723,7 @@ sub get_SO_term { my $res = $terms{$abbrev}; ## unsupported SV types if ($self->isa('Bio::EnsEMBL::VEP::Parser')) { - $self->skipped_variant_msg("$abbrev type is not supported") unless $res; + $self->skipped_variant_msg("$abbrev is not a supported structural variant type") unless $res; } return $res; } From 486f60e56b70c0a76a5f7157876c4a0625953b1d Mon Sep 17 00:00:00 2001 From: Nuno Agostinho Date: Fri, 15 Mar 2024 11:45:25 +0000 Subject: [PATCH 3/3] Fix unit tests --- t/Parser_VCF.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/Parser_VCF.t b/t/Parser_VCF.t index 8c85691f8..86f800f20 100755 --- a/t/Parser_VCF.t +++ b/t/Parser_VCF.t @@ -621,14 +621,14 @@ is_deeply($cvf, bless( { 'inner_start' => '774570', 'strand' => 1, 'seq_region_end' => 828435, - 'class_SO_term' => '', + 'class_SO_term' => 'CPX', 'variation_name' => 'gnomAD_v2_CPX_1_1', 'start' => 774570 }, 'Bio::EnsEMBL::Variation::StructuralVariationFeature' ) , 'StructuralVariationFeature - CPX skipped'); -like($tmp, qr/CPX type is not supported/, 'StructuralVariationFeature - skip CPX warning'); +like($tmp, qr/CPX is not a supported structural variant type/, 'StructuralVariationFeature - skip CPX warning'); open(STDERR, ">&SAVE") or die "Can't restore STDERR\n";