Skip to content

Commit

Permalink
Merge branch nuno-agostinho:fix/svtype into release/112
Browse files Browse the repository at this point in the history
  • Loading branch information
olaaustine committed Apr 8, 2024
2 parents 17054a0 + 5dafe4b commit 31a3581
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
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

0 comments on commit 31a3581

Please sign in to comment.