[Bioperl-l] [BULK] Re: can't parse blast file anymore
Chris Fields
cjfields at uiuc.edu
Fri May 5 19:27:12 UTC 2006
Sorry, mail got sent before I finished it! Here I go again...
What happens if you add the verbose flag?
my $search = new Bio::SearchIO (-verbose => 1,
-format => 'blast',
-file => $file);
Added thought : you might want to look at File::Find for stepping through
your files and performing a task on each one, such as parsing output. It
changes into the working directory each time; you should be able to do
something like this:
use File::Find;
use Bio::SearchIO;
my @dirlist = ("/home/Hubert/test");
find (\&dir, @dirlist);
sub printdir {
return unless /txt$/;
return if (-d);
my $parser = Bio::SearchIO->new(-file => $_,
-format => 'blast');
while (my $result = $parser->next_result) {
while (my $hit = $result->next_hit) {
while (my $hsp = $hit->next_hsp) {
# do stuff here
}
}
}
}
Chris
> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Hubert Prielinger
> Sent: Friday, May 05, 2006 1:30 PM
> To: Torsten Seemann; bioperl-l at bioperl.org
> Subject: Re: [Bioperl-l] [BULK] Re: can't parse blast file anymore
>
> hi,
> I have done, as you suggested and I got the error message:
>
> Can't call method "next_result" on an undefined value at....
>
> then I looked up at the internet and found a thread which suggested to
> use strict and then the problem is solved....
> but I'm already using use strict..
>
> thanks
>
> Torsten Seemann wrote:
> > Hubert Prielinger wrote:
> >
> >> if I do so it returns:
> >> 0 undef
> >>
> >
> > That means the value of $search was undef.
> > That means that it could not parse or open the BLAST report.
> > I repeat the line that I put in my earlier email which you ignored.
> >
> > # your line
> > my $search = Bio::SearchIO->new( ..... );
> >
> > # then check if it was successful!
> > die "could not open blast report" if not defined $search;
> >
> > --Torsten
> > _______________________________________________
> > 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
More information about the Bioperl-l
mailing list