[Bioperl-l] Bptutorial.pl
Peter Schattner
schattner@alum.mit.edu
Fri, 20 Dec 2002 15:29:25 -0800
Jason Stajich wrote:
> I'm confused about the error messages Paul was reporting, this is what I
> get on linux calling the non-existant class method:
>
> [jason@portabello core]$ perl bptutorial.pl 23
>
> Beginning run_standaloneblast example...
> Can't use string ("Bio::Tools::Run::StandAloneBlast") as a HASH ref while
> "strict refs" in use at
> /home/jason/bioperl/bioperl-run/Bio/Tools/Run/StandAloneBlast.pm line 366.
What was happening is that the AUTOLOAD function was being called when exists_blast
could not be found. The autoloader truncated the name of the method to one letter
(which is needed because the blast parameters are single letters) so $attr_letter =
'e' (at line 356). since '-e' is an acceptable option for Blast, StandAloneBlast
does not "throw" and instead looks for the "value" of the parameter -e in @_. (line
365) What it finds in @_ is the name of the module
(Bio::Tools::Run::StandAloneBlast) since the first argument of the method is the
name of the caller. Then in line 366 it attempts to return the (meaningless) hash
value that it has stored and it dies.
Anyway the correction you describe does fix that problem. Unfortunately the other
problems I described (and submitted as a bug report) in running the script
scripts/tools/standaloneblast.pl still remain.
> Also, let me explain why the changes were made.
>
> Because the object needs to store state for the actual location it needs
> to be an object method rather than a class method (ie it caches where it
> found the executable in the event that it needs to search the BLASTDIR env
> variable is not set).
>
> This was my interpretation if you want to be in a different way we can
> probably play some games behind the scenes to make it work.
I'm OK with your changes. It's just that with the interface changes I can no
longer figure out how to get the standaloneblast.pl script to work and I suspect
others will have similar difficulties.
Peter