Skip to content

Commit

Permalink
Merge pull request #1618 from nuno-agostinho/fix/REST-SV-warnings
Browse files Browse the repository at this point in the history
Fix SV warnings for short variants in `region` format
  • Loading branch information
olaaustine authored Mar 4, 2024
2 parents 6f0ecfc + 1e5cc05 commit e10125c
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions modules/Bio/EnsEMBL/VEP/Parser/Region.pm
Original file line number Diff line number Diff line change
Expand Up @@ -184,33 +184,35 @@ sub create_VariationFeatures {

my $vf;

# sv?
my $so_term = $self->get_SO_term($allele);
if(defined($so_term)) {
$vf = Bio::EnsEMBL::Variation::StructuralVariationFeature->new_fast({
# normal vf
if ($allele =~ /^[ACGTN-]+$/) {
my $ref = ('N' x (($end - $start) + 1)) || '-';

$vf = Bio::EnsEMBL::Variation::VariationFeature->new_fast({
start => $start,
end => $end,
allele_string => $ref.'/'.$allele,
strand => $strand,
adaptor => $self->get_adaptor('variation', 'StructuralVariationFeature'),
map_weight => 1,
adaptor => $self->get_adaptor('variation', 'VariationFeature'),
variation_name => $region,
chr => $chr,
class_SO_term => $so_term,
});
}

# normal vf
# sv
else {
my $ref = ('N' x (($end - $start) + 1)) || '-';
my $so_term = $self->get_SO_term($allele);
return [] unless defined $so_term;

$vf = Bio::EnsEMBL::Variation::VariationFeature->new_fast({
$vf = Bio::EnsEMBL::Variation::StructuralVariationFeature->new_fast({
start => $start,
end => $end,
allele_string => $ref.'/'.$allele,
strand => $strand,
map_weight => 1,
adaptor => $self->get_adaptor('variation', 'VariationFeature'),
adaptor => $self->get_adaptor('variation', 'StructuralVariationFeature'),
variation_name => $region,
chr => $chr,
class_SO_term => $so_term,
});
}

Expand Down

0 comments on commit e10125c

Please sign in to comment.