[Bioperl-l] [BULK] can't parse blast file anymore
Jason Stajich
jason.stajich at duke.edu
Sun May 7 20:49:29 UTC 2006
The problem is in how SearchIO was being initialized, the code
basically looked like this:
my $x = new Foo() or die if not defined my $x;
which is invalid for two reason.
1) if not defined my $x;
Will ALWAYS be false.
2) my $x = new Foo() or die ;
Will cast the new object as a boolean.
Whenever things aren't working, take a look at the code and try and
walk through any shortcuts. For clarity make it a two-step process
my $x = new Foo();
die "no valid $x" unless defined $x;
Please note that currently BioPerl WILL die (via throw) if you try
and ask for an invalid file when you initialize a new IO object --
this is handled by code in Bio::Root::IO (line 313 in Bio/Root/IO.pm)
which all the IO objects use, so you don't really need to do a test
on the object after all.
--jason
On May 6, 2006, at 11:33 PM, Christopher Fields wrote:
> The -verbose flag was my suggestion; it should output a ton of
> debugging info
> from SearchIO::blast; if you see anything there, then it means that
> it's at least
> attempting to parse the report.
>
> Of course I can't test this myself at the moment since my wife's
> computer died
> (along with the bioperl setup); I'm using a loaner computer at the
> moment.
>
> Chris
>
> ---- Original message ----
>> Date: Sun, 07 May 2006 10:57:14 +1000
>> From: Torsten Seemann <torsten.seemann at infotech.monash.edu.au>
>> Subject: Re: [Bioperl-l] [BULK] can't parse blast file anymore
>> To: Hubert Prielinger <hubert.prielinger at gmx.at>
>> Cc: bioperl-l at bioperl.org
>>
>> Hubert Prielinger wrote:
>>> ok, thanks
>>> I have submitted the bug
>>> bug #1994
>>
>> This is a line from the script you sent to Bugzilla:
>>
>> my $search = new Bio::SearchIO (
>> -verbose => 1,-format => 'blast', -file => $file)
>> or die "could not open blast report" if not defined my $search;
>>
>> Althoygh syntactically correct, I don't think it is doing what you
>> want.
>> Please change it to this:
>>
>> my $search = new Bio::SearchIO(-format => 'blast', -file => $file)
>> or die
>> "could not open blast report";
>>
>> or alternatively, this:
>>
>> my $search = new Bio::SearchIO(-format => 'blast', -file => $file);
>> if (not defined $search) {
>> die "could not open blast report";
>> }
>>
>> and let us know what happens.
>>
>> all the example output you have supplied still suggests that
>> Bio::SearchIO can
>> not load or parse your blast report.
>>
>> --
>> Torsten Seemann
>> Victorian Bioinformatics Consortium, Monash University, Australia
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
--
Jason Stajich
Duke University
http://www.duke.edu/~jes12
More information about the Bioperl-l
mailing list