Skip to content

Commit

Permalink
Merge pull request #813 from at7/bugfix100/minimal_intergenic
Browse files Browse the repository at this point in the history
Bugfix100/minimal intergenic
  • Loading branch information
at7 committed Jul 29, 2020
2 parents 4be118e + 3e813d3 commit 10932fa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/Constants.pm
Expand Up @@ -53,7 +53,7 @@ use warnings;
use base qw(Exporter);

our $VEP_VERSION = 100;
our $VEP_SUB_VERSION = 3;
our $VEP_SUB_VERSION = 4;

our @EXPORT_OK = qw(
@FLAG_FIELDS
Expand Down
9 changes: 6 additions & 3 deletions modules/Bio/EnsEMBL/VEP/OutputFactory.pm
Expand Up @@ -2125,12 +2125,15 @@ sub rejoin_variants_in_InputBuffer {
# there is only one, and no reference feature to key on
# means we have to copy over alleles manually
if(my $iv = $vf->{intergenic_variation}) {

my $bfvo = $original->{intergenic_variation};
$iv->base_variation_feature($original);

if(my $oiv = $original->{intergenic_variation}) {
push @{$oiv->{alt_alleles}}, @{$iv->{alt_alleles}};
$oiv->{_alleles_by_seq}->{$_->variation_feature_seq} = $_ for @{$oiv->{alt_alleles}};
foreach my $alt (@{$iv->{alt_alleles}}) {
$alt->base_variation_feature_overlap($bfvo);
push @{$oiv->{alt_alleles}}, $alt;
}
$oiv->{_alleles_by_seq}->{$_->variation_feature_seq} = $_ for @{$oiv->{alt_alleles}};
}

# this probably won't happen, but can't hurt to cover all bases
Expand Down
7 changes: 7 additions & 0 deletions t/OutputFactory.t
Expand Up @@ -1800,6 +1800,13 @@ $of->rejoin_variants_in_InputBuffer($ib);

is(scalar @{$ib->buffer}, 2, 'minimal - intergenic - rejoined count');

foreach my $vf (@{$ib->buffer}) {
my $vfoas = $of->get_all_VariationFeatureOverlapAlleles($vf);
foreach my $vfoa (@{$vfoas}) {
is(ref($vfoa->base_variation_feature_overlap), 'Bio::EnsEMBL::Variation::IntergenicVariation', 'base_variation_feature_overlap is set after rejoin');
}
}

is_deeply(
[map {$_->display_consequence} @{$ib->buffer}],
['intergenic_variant', 'intergenic_variant'],
Expand Down

0 comments on commit 10932fa

Please sign in to comment.