[ensembl-dev] Fwd: Bug report and fix to vax.pl

Michael Yourshaw myourshaw at ucla.edu
Tue Apr 24 22:21:55 BST 2012


send it to dev at ensembl.org

ॐ

Michael Yourshaw
UCLA Geffen School of Medicine
Department of Human Genetics, Nelson Lab
695 Charles E Young Drive S
Gonda 5554
Los Angeles CA 90095-8348 USA
myourshaw at ucla.edu
970.691.8299

This message is intended only for the use of the addressee and may contain information that is PRIVILEGED and CONFIDENTIAL, and/or may contain ATTORNEY WORK PRODUCT. If you are not the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please erase all copies of the message and its attachments and notify us immediately. Thank you.





Begin forwarded message:

> From: Aliz Raksi <aliz0611 at gmail.com>
> Subject: Bug report and fix to vax.pl
> Date: April 24, 2012 12:52:11 PM PDT
> To: "Yourshaw, Michael (BOL)" <myourshaw at ucla.edu>
> 
> Hi Michael,
> Who should I send the vax.pl bug report to? Can you give me an email address? - Aliz
> 
> ------------------------------------------------------------------------
> 
> 
> To whom it may concern,
> 
> I am writing to report a bug in vax.pl. 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.
> 
> 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 debug statement, which was moved in the previous step.
> 
> 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
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20120424/cfa8ded7/attachment.html>


More information about the Dev mailing list