[Bioperl-l] problems with: Bio::Tools::Run::RemoteBlast
Bertrand Beckert
B.Beckert at ibmc.u-strasbg.fr
Tue Oct 17 13:59:30 UTC 2006
hi,
I am running a large number of blasts via a connexion to ncbi blast
page ('http://www.ncbi.nlm.nih.gov/blast/Blast.cgi').
I try to use 'Bio::Tools::Run::RemoteBlast' but unfortunately I have
some problems. I make a simple example with only one sequence in
order to understand how work this module. This is my simple input
file, a DNA sequence in fasta form:
> test
>
TTTTGATGAGGCGCATCAATCATGAGTAAAGTTTAGATTACTGTCTGCTAACAGCTGAAT
TTGAAAGGGTGCGATGCCGAAGCGATTATAATAGCAGTTATAATTTGTTGGACTTTTTGG
TTAAGAGCTGAGAGTTTGTCATTATTTAAAAATAATGGAGTGCATCACTTGTA
I have made some modification of the example available in doc of
bioperl.
It give me a RID which contain the results of my blast but I have a
problem with the "$result=$factory->retrieve_blast($rid)" in my script.
In the documentation it wrote that $result=$factory->retrieve_blast
($rid) return when it work a Bio::Tools::Bplite or Bio::Tools::Blast
object. In my case it returns a Bio::SearchIO::blast... I don't
understand why I don't have the good type of object return (see PART I).
I also try to resolve the problem by replace the foreach loop in my
script by a new one in order to explore the blast page result but it
also don't work (see part II).
could you help me please. Thank you
Bertrand Beckert.
PART I:
Here is my script with a little annotation and also the shell window
printing:
------------------------------------------------------------------------
----------------------------
#!/usr/bin/perl -w
use Bio::Tools::Run::RemoteBlast;
use Bio::SearchIO;
sub blast {
my $prog='blastn';
my $db='refseq_genomic';
my $e_val='1e-10';
my $Input='Seq.fasta';
my @params = ('-prog' => $prog, '-data' => $db, '-expect' =>
$e_val, '-readmethod' => 'SearchIO');
my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
#changes parameters
$Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'}='Bacteria [ORGN]';
$Bio::Tools::Run::RemoteBlast::HEADER{'MATRIX_NAME'}='BLOSUM25';
$factory->submit_blast($Input);
print STDERR "waiting...\n";
while (my @rids=$factory->each_rid) {
print "my rid: ", at rids,"\n";
#return me the ID of the submited blast i.e. RID:
1161079157-766-185099855365.BLASTQ2
#this page contains the result of my blast...
foreach my $rid (@rids) {
$result=$factory->retrieve_blast($rid);
#line in order to understand what type of object is
return by
retrieve_blast
print "rc:", $result,"\n";
}
}
}
&blast;
------------------------------------------------------------------------
----------------------------
here you can see the shell window:
bbeckert at tatooine:~/Script_perl$ ./test.pl
waiting...
my rid: 1161079157-766-185099855365.BLASTQ2
rc:Bio::SearchIO::blast=HASH(0x890bc54)
my rid: 1161079157-766-185099855365.BLASTQ2
rc:Bio::SearchIO::blast=HASH(0x890bc30)
my rid: 1161079157-766-185099855365.BLASTQ2
rc:Bio::SearchIO::blast=HASH(0x89eb7f4)
my rid: 1161079157-766-185099855365.BLASTQ2
rc:Bio::SearchIO::blast=HASH(0x8a2cc74)
my rid: 1161079157-766-185099855365.BLASTQ2
...
my rid: 1161079157-766-185099855365.BLASTQ2
Parsing of undecoded UTF-8 will give garbage when decoding entities
at /usr/share/perl5/LWP/Protocol.pm line 137.
rc:Bio::SearchIO::blast=HASH(0x886bbac)
my rid: 1161079157-766-185099855365.BLASTQ2
Parsing of undecoded UTF-8 will give garbage when decoding entities
at /usr/share/perl5/LWP/Protocol.pm line 137.
rc:Bio::SearchIO::blast=HASH(0x89eb5f0)
my rid: 1161079157-766-185099855365.BLASTQ2
Parsing of undecoded UTF-8 will give garbage when decoding entities
at /usr/share/perl5/LWP/Protocol.pm line 137.
rc:Bio::SearchIO::blast=HASH(0x8a2d2d4)
my rid: 1161079157-766-185099855365.BLASTQ2
Parsing of undecoded UTF-8 will give garbage when decoding entities
at /usr/share/perl5/LWP/Protocol.pm line 137.
rc:Bio::SearchIO::blast=HASH(0x84fa054)
...
PARTII:
I also try to resolve the problem by replace the foreach loop in my
script by:
------------------------------------------------------------------------
----------------------------
foreach my $rid (@rids) {
while(1) {
$result=$factory->retrieve_blast($rid)->next_result();
print "rc:", $result,"\n";
if ($result) {
print $result->num_hits(),"\n";
}
------------------------------------------------------------------------
----------------------------
With tis loop I could explore the result Blast page. that is what I
obtain in the shell window:
bbeckert at tatooine:~/Script_perl$ ./test.pl
waiting...
my rid: 1161088606-9905-123050755601.BLASTQ4
Use of uninitialized value in print at ./retrieve_blast.pl line 30.
rc:
Use of uninitialized value in print at ./retrieve_blast.pl line 30.
rc:
Parsing of undecoded UTF-8 will give garbage when decoding entities
at /usr/share/perl5/LWP/Protocol.pm line 137.
rc:Bio::Search::Result::BlastResult=HASH(0x84fb8b8)
0
Parsing of undecoded UTF-8 will give garbage when decoding entities
at /usr/share/perl5/LWP/Protocol.pm line 137.
rc:Bio::Search::Result::BlastResult=HASH(0x84fba8c)
0
Parsing of undecoded UTF-8 will give garbage when decoding entities
at /usr/share/perl5/LWP/Protocol.pm line 137.
rc:Bio::Search::Result::BlastResult=HASH(0x84fb834)
----
--
Berrtrand BECKERT
PhD student
IBMC - UPR 9002 du CNRS - ARN
15, rue Rene Descartes
F-67084 STRASBOURG Cedex
b.beckert at ibmc.u-strasbg.fr
More information about the Bioperl-l
mailing list