[Bioperl-l] remoteblast result in text format
Damien Mattei
Damien.Mattei@unice.fr
Sun, 03 Nov 2002 20:24:41 +0100
Hello Mathieu,
sorry to haven't try your code earlier.
I try to use your save_output feature , but i can't understand what is
the parseBlastObject() function ?
here is the code:
my $factory = Bio::Tools::Run::RemoteBlast->new();
$Bio::Tools::Run::RemoteBlast::HEADER{'PROGRAM'} = 'blastn';
$Bio::Tools::Run::RemoteBlast::HEADER{'DATABASE'} = $blastdb;
$Bio::Tools::Run::RemoteBlast::HEADER{'EXPECT'} = $evalue;
#$Bio::Tools::Run::RemoteBlast::HEADER{'MATRIX_NAME'} = 'PAM30';
#$Bio::Tools::Run::RemoteBlast::HEADER{'GAPCOSTS'} = '9 1';
#$Bio::Tools::Run::RemoteBlast::HEADER{'WORD_SIZE'} = '2';
#$Bio::Tools::Run::RemoteBlast::HEADER{'NCBI_GI'} = 'on';
#$Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Homo sapiens
[ORGN]';
#Have to request the blast with the right amount of alignments,
$Bio::Tools::Run::RemoteBlast::HEADER{'ALIGNMENTS'} = $alignv;
$Bio::Tools::Run::RemoteBlast::HEADER{'DESCRIPTIONS'} = $descv;
#and then retrieve it that way as well
$Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'ALIGNMENTS'} = $alignv;
$Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'DESCRIPTIONS'} = $descv;
$Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'FORMAT_TYPE'} = 'Text';
my $r = $factory->submit_blast($seq);
print STDERR "waiting..." if( $r > 0 );
while ( my @rids = $factory->each_rid ) {
foreach my $rid ( @rids ) {
my $rc = $factory->retrieve_blast($rid);
if( !ref($rc) ) {
if( $rc < 0 ) {
#This is an error condition, should be a warning or something?
$factory->remove_rid($rid);
}
print STDERR "." if ( $r > 0 );
sleep 5;
} else {
print "Parsing $rid\n";
my $filename = parseBlastObject($rc);
$factory->save_output($rid, $filename);
$factory->remove_rid($rid);
}
}
}
$factory->DESTROY;
}
and the error i get:
waiting.........Parsing 1036349441-07089-15192
Tk::Error: Undefined subroutine &main::parseBlastObject called at
./genmap.pl line 2326.
what's in parseBlastObject , where this subroutine belongs from?
external code?
Thanks for your help.
Damien
Wiepert, Mathieu wrote:
> Hi,
>
> I am not quite sure what you mean by this request. Are you saying that you want to get the raw blast output? If so, I can send you a modified RemoteBlast file that you can try. I have been using it for about a week, testing it before I commit it to Bioperl.
>
> It is invoked like
>
> $factory->save_output($rid, $filename);
>
> Here is a sample script, assuming that you pass in a sequence file. The parameters set are the same as from the short nearly exact protein match blast page at NCBI, filtered for Homo Sapiens:
>
> my $factory = Bio::Tools::Run::RemoteBlast->new();
> $Bio::Tools::Run::RemoteBlast::HEADER{'PROGRAM'} = 'blastp';
> $Bio::Tools::Run::RemoteBlast::HEADER{'DATABASE'} = 'nr';
> $Bio::Tools::Run::RemoteBlast::HEADER{'EXPECT'} = '200000';
> $Bio::Tools::Run::RemoteBlast::HEADER{'MATRIX_NAME'} = 'PAM30';
> $Bio::Tools::Run::RemoteBlast::HEADER{'GAPCOSTS'} = '9 1';
> $Bio::Tools::Run::RemoteBlast::HEADER{'WORD_SIZE'} = '2';
> $Bio::Tools::Run::RemoteBlast::HEADER{'NCBI_GI'} = 'on';
> $Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Homo sapiens [ORGN]';
> #Have to request the blast with the right amount of alignments,
> $Bio::Tools::Run::RemoteBlast::HEADER{'ALIGNMENTS'} = '1000';
> $Bio::Tools::Run::RemoteBlast::HEADER{'DESCRIPTIONS'} = '1000';
> #and then retrieve it that way as well
> $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'ALIGNMENTS'} = '1000';
> $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'DESCRIPTIONS'} = '1000';
> $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'FORMAT_TYPE'} = 'Text';
>
> my $r = $factory->submit_blast($inseqfile);
> print STDERR "waiting..." if( $v > 0 );
> while ( my @rids = $factory->each_rid ) {
> foreach my $rid ( @rids ) {
> my $rc = $factory->retrieve_blast($rid);
> if( !ref($rc) ) {
> if( $rc < 0 ) {
> #This is an error condition, should be a warning or something?
> $factory->remove_rid($rid);
> }
> print STDERR "." if ( $v > 0 );
> sleep 5;
> } else {
> print "Parsing $rid\n";
> my $filename = parseBlastObject($rc);
> $factory->save_output($rid, $filename);
> $factory->remove_rid($rid);
> }
> }
> }
> $factory->DESTROY;
>
> Mathieu Wiepert
> Medical Information Resources
> Mayo Foundation
> (507) 266-2317 Fax (507)-284-0360
> wiepert.mathieu@mayo.edu
>
>
>
>>-----Original Message-----
>>From: Damien Mattei [mailto:Damien.Mattei@unice.fr]
>>Sent: Friday, September 13, 2002 6:28 PM
>>To: bioperl-l@bioperl.org
>>Subject: [Bioperl-l] remoteblast result in text format
>>
>>
>>i tried to find since a couple of hours how to retrieve the
>>basic text
>>result from a remoteblast , it seems that it was possible in older
>>version of bioperl but is there a way to get it now? am i missing
>>something? i know how to get the hits and other things from a
>>remoteblast but what i need is the same output as the one given by a
>>standalone blast. Should i have to use the qblast URL API directly ?
>>(http://www.ncbi.nlm.nih.gov/BLAST/Doc/urlapi.html)
>>or bioperl?
>>-----------------------------
>>Damien Mattei
>>C.N.R.S / U.N.S.A - UMR 6549
>>mailto:mattei@unice.fr
>>http://www-iag.unice.fr/
>>-----------------------------
>>
>>_______________________________________________
>>Bioperl-l mailing list
>>Bioperl-l@bioperl.org
>>http://bioperl.org/mailman/listinfo/bioperl-l
>>
>
>
----------------------------
Damien Mattei
C.N.R.S / U.N.S.A - UMR 6549
mailto:mattei@unice.fr
http://www-iag.unice.fr/
--------------------------------------