[Bioperl-l] Re: Running BLAST locally
Brian Osborne
b_i_osborne@hotmail.com
Thu, 24 Jan 2002 11:50:01 -0500
Simon,
I'm not sure what values you're after but using StandAloneBlast can be
simpler than what you've been attempting. Try something like :
my $blast_report = $factory->blastall($seq);
while ( my $sbjct = $blast_report->nextSbjct ){
while ( my $hsp = $sbjct->nextHSP ){
print $hsp->score . " " . $hsp->subject->seqname . "\n";
}
}
Take a look at BPlite.pm itself for the details on what it extracts, it does
much more than score and the subject's name. You're right of course, it's
not clear from the documentation that the BPlite parser can be invoked this
easily.
Brian O.
----- Original Message -----
From: "Simon Chan" <schan@xenongenetics.com>
To: <bioperl-l@bioperl.org>
Sent: Wednesday, January 23, 2002 5:01 PM
Subject: [Bioperl-l] Re: Running BLAST locally
> Hi All,
>
> *** Jason, thanks. Your sugggestion worked!
>
> So here's the code I've got:
>
> my $factory = Bio::Tools::Run::StandAloneBlast->new ( database =>
'refseq', program => 'blastn');
>
> my $seq_in = Bio::SeqIO->new ( -file => 'inputfilename', -format =>
'fasta');
>
> my $seq = $seq_in->next_seq();
>
> my $blast_report = $factory->blastall($seq);
>
> So now, I want to parse it. I'm using BPlite.pm. From the docs, this is
how we use BPlite:
>
> my $report = Bio::Tools::BPlite->new (-fh => \*STDIN);
>
> So $blast_report contains the BLAST output in object form. How would you
pass $blast_report into BPlite? I've tried outputting
> $blast_report into a file using SeqIO and then inputting it into
BPlite -file => "filename" (I know, that's a pretty odd way
> of doing it ;-) and I've also tried using a filehandle to read in value
like so:
>
> open (INPUT, "<filename");
> my $report = Bio::Tools::BPlite->new (-fh => \*INPUT);
>
> So how would the non-rookie bio-perl users pass $blast_report into BPlite?
:-) The Pasteur tutorial is very good at showing rookies how to use
modules, however, it doesn't spend too much time explaining them.
>
> Once again, many thanks, All.
>
> #############################################
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>