Skip to content

Commit

Permalink
Turn on shift_3prime when shift_genomic is switched on (#729)
Browse files Browse the repository at this point in the history
* Turn on shift_3prime when shift_genomic is switched on

* fix warning

* Added shifting test

* Change eq checks to ==
  • Loading branch information
aparton authored Apr 28, 2020
1 parent f6100c2 commit 4e307de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/Bio/EnsEMBL/VEP/Runner.pm
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,17 @@ sub post_setup_checks {
$self->param('stats_html', 1);
}

if(defined($self->param('shift_hgvs')) && $self->param('shift_hgvs') eq 0) {
if(defined($self->param('shift_hgvs')) && $self->param('shift_hgvs') == 0) {
$self->status_msg("INFO: --shift_hgvs has been set to zero, setting shift_3prime to 0\n");
$self->param('shift_3prime', 0);
}

if(defined($self->param('shift_genomic')) && $self->param('shift_genomic')) {
if(defined($self->param('shift_3prime')) && $self->param('shift_3prime') == 0 ) {
$self->status_msg("INFO: --shift_genomic has been set to 1, setting shift_3prime to 1\n");
}
$self->param('shift_3prime', 1);
}

return 1;
}
Expand Down
4 changes: 4 additions & 0 deletions t/Runner.t
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ throws_ok {$runner->get_output_file_handle} qr/Output file .+ already exists/, '
$runner = Bio::EnsEMBL::VEP::Runner->new({%$cfg_hash, output_file => 'stdout'});
is($runner->get_output_file_handle, '*main::STDOUT', 'get_output_file_handle - stdout');

$runner = Bio::EnsEMBL::VEP::Runner->new({%$cfg_hash, shift_genomic => 1});
$runner->post_setup_checks;
is($runner->param('shift_3prime'), 1, 'shift_genomic switches on shift_3prime');

unlink($test_cfg->{user_file}.'.out');

$runner = Bio::EnsEMBL::VEP::Runner->new({
Expand Down

0 comments on commit 4e307de

Please sign in to comment.