[ensembl-dev] Bug report and fix to variant_effect_predictor.pl

Will McLaren wm2 at ebi.ac.uk
Thu Apr 26 09:41:39 BST 2012


Hi Aliz,

Thanks very much for finding and reporting these - the fixes will
appear in the next version of the VEP.

Will McLaren
Ensembl Variation

On 25 April 2012 00:22, Aliz Raksi <aliz0611 at gmail.com> wrote:
> Dear Ensembl team,
>
> I am writing to report a bug in variant_effect_predictor.pl version 2.4. If
> you run the script with the optional parameter -o stdout, then "quiet" mode
> is forced too late in the program, and undesired debug statements are
> written in the beginning of the output.
> The API version used is 66.
>
> PROPOSED FIX:
>
> Move line 794 (debug("Reading configuration from $file") unless
> defined($config->{quiet});)
> to line 809, i.e. to after the while(<CONFIG>) {...} statement.
>
> Move lines 394-398:
>     # force quiet if outputting to STDOUT
>     if(defined($config->{output_file}) && $config->{output_file} =~
> /stdout/i) {
>         delete $config->{verbose} if defined($config->{verbose});
>         $config->{quiet} = 1;
>     }
> to line 807, i.e. to between the while(<CONFIG>) {...} statement and the new
> location of the just-moved debug statement.
>
> Therefore, the subroutine read_config_from_file should look like this:
>
> # reads config from a file
> sub read_config_from_file {
>     my $config = shift;
>     my $file = shift;
>
>     open CONFIG, $file or die "ERROR: Could not open config file
> \"$file\"\n";
>
>     while(<CONFIG>) {
>         next if /^\#/;
>         my @split = split /\s+|\=/;
>         my $key = shift @split;
>         $key =~ s/^\-//g;
>
>         if(defined($config->{$key}) && ref($config->{$key}) eq 'ARRAY') {
>             push @{$config->{$key}}, @split;
>         }
>         else {
>             $config->{$key} ||= $split[0];
>         }
>     }
>
>     # force quiet if outputting to STDOUT
>     if(defined($config->{output_file}) && $config->{output_file} =~
> /stdout/i) {
>         delete $config->{verbose} if defined($config->{verbose});
>         $config->{quiet} = 1;
>     }
>
>     debug("Reading configuration from $file") unless
> defined($config->{quiet});
>
>     close CONFIG;
> }
>
> Finally, some debug statements don't check for whether we're in quiet mode.
> Change those occurences of debug("..."); to
> debug("...") unless defined($config->{quiet});
>
> This occurs at the following lines:
> 838    debug("Failed to compile plugin $module: $@");
> 850    debug("Failed to instantiate plugin $module: $@");
> 869    debug("Warning: plugin $plugin version ($plugin_version) does not
> match the current VEP version ($VERSION)");
> 874    debug("Warning: plugin $plugin does not define a version number");
> 878    debug("You may experience unexpected behaviour with this plugin")
> unless $version_ok;
> 884    debug("Plugin $module doesn't implement a required method
> '$required', does it inherit from BaseVepPlugin?");
> 893    debug("Loaded plugin: $module");
> 898    debug("Fetching regulatory features for plugin: $module");
>
>
> Sincerely,
> Aliz R. Rao
>
> UCLA Geffen School of Medicine
> Department of Human Genetics, Nelson Lab
> 695 Charles E Young Drive S
> Gonda 5554A
>
> Los Angeles CA 90095-8348 USA
>
> alizrrao at gmail.com
>
> 714.548.1133
>
>
>
>
>
>
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe):
> http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
>




More information about the Dev mailing list