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; } 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; 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";