Skip to content

Commit

Permalink
fix isolated upstream bug
Browse files Browse the repository at this point in the history
  • Loading branch information
William McLaren committed Sep 4, 2017
1 parent 4dd84f6 commit a813178
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/VEP/AnnotationSource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ sub get_all_regions_by_InputBuffer {
$max = $vf_e if $vf_e > $max;

# convert to region-size
my ($r_s, $r_e) = map {int(($_ - 1) / $cache_region_size)} ($vf_s, $vf_e);
my ($r_s, $r_e) = map {int(($_ - 1) / $cache_region_size)} ($vf_s - $up_down_size, $vf_e + $up_down_size);

# add all regions between r_s and r_e inclusive
for(my $s = $r_s; $s <= $r_e; $s++) {
Expand Down
21 changes: 21 additions & 0 deletions t/AnnotationSource_Database_Transcript.t
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,27 @@ SKIP: {
$ib->next();
is_deeply($as->get_all_features_by_InputBuffer($ib), [], 'get_all_features_by_InputBuffer on empty buffer');

# test upstream
$p = Bio::EnsEMBL::VEP::Parser::VCF->new({config => $cfg, file => $test_cfg->create_input_file([qw(21 13002936 . C A)])});
$ib = Bio::EnsEMBL::VEP::InputBuffer->new({config => $cfg, parser => $p});
$ib->next();

is_deeply(
$as->get_all_regions_by_InputBuffer($ib),
[
[
'21',
259
],
[
'21',
260
],
],
'get_all_regions_by_InputBuffer - include upstream'
);


# reset
$p = Bio::EnsEMBL::VEP::Parser::VCF->new({config => $cfg, file => $test_cfg->{test_vcf}});
$ib = Bio::EnsEMBL::VEP::InputBuffer->new({config => $cfg, parser => $p});
Expand Down

0 comments on commit a813178

Please sign in to comment.