Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SVTYPE when using IUPAC nucleotide codes #1636

Merged
merged 4 commits into from
Apr 8, 2024
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
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 8 additions & 2 deletions modules/Bio/EnsEMBL/VEP/Parser/VCF.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 !~ /^<?(DEL|INS|DUP|INV|CNV|CN=?[0-9]+)/) {
$type = $info->{SVTYPE};
}

my $so_term = $self->get_SO_term($type);
unless ($so_term) {
$skip_line = 1;
Expand Down
4 changes: 2 additions & 2 deletions t/Parser_VCF.t
Original file line number Diff line number Diff line change
Expand Up @@ -621,14 +621,14 @@ is_deeply($cvf, bless( {
'inner_start' => '774570',
'strand' => 1,
'seq_region_end' => 828435,
'class_SO_term' => '<CPX>',
'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";

Expand Down