[Bioperl-l] RemoteBlast retrieve_blast cannot return
Bio::SearchIO::blasttable
Jason Stajich
jason.stajich at duke.edu
Fri Sep 16 13:03:09 EDT 2005
This is committed as well as support for the XML format. The
blasttable stuff took some work because one has to parse out the
<PRE></PRE> block from the result file so this is quite hacky, but
appears to work.
The t/RemoteBlast.t illustrates how to use the XML format. According
to NCBI this is the only real "approved" way of getting alignments
from the website that is guaranteed to be consistent. We may want to
change it to be the XML format as the default in the future.
Currently the user has to keep the readmethod and ALIGNMENT_VEW/
FORMAT_TYPE fields synchronized properly. Maybe someone will want to
work harder on this module in the future and control all of this with
a single method.
Cut+Paste from t/RemoteBlast.t
Here is how I get BLASTXML back -- the '-readmethod' is now 'xml' and
I set the FORMAT_TYPE retrieval header to 'XML'
my $remote_blastxml = Bio::Tools::Run::RemoteBlast->new
('-verbose' => $v,
'-prog' => $prog,
'-data' => $db,
'-readmethod' => 'xml',
'-expect' => $e_val,
);
$remote_blast->submit_parameter('ENTREZ_QUERY',
'Escherichia coli[ORGN]');
$remote_blastxml->retrieve_parameter('FORMAT_TYPE', 'XML');
$inputfilename = Bio::Root::IO->catfile("t","data","ecolitst.fa");
Here is blasttable in action
my $remote_blast2 = Bio::Tools::Run::RemoteBlast->new
('-verbose' => $v,
'-prog' => $prog,
'-data' => $db,
'-readmethod' => 'blasttable',
'-expect' => $e_val,
);
$remote_blast2->submit_parameter('ENTREZ_QUERY',
'Escherichia coli[ORGN]');
$remote_blast2->retrieve_parameter('ALIGNMENT_VIEW', 'Tabular');
$inputfilename = Bio::Root::IO->catfile("t","data","ecolitst.fa");
-jason
On Sep 1, 2005, at 3:52 PM, Paul G Cantalupo wrote:
> Hello,
>
> When using RemoteBlast with ALIGNMENT_VIEW = 'Tabular' (-m8 output)
> the method 'retrieve_blast' should return a
> Bio::SearchIO::blasttable object to handle the parsing of -m8
> output. I think the easiest way to do this is by changing
> 'retrieve_blast'
>
> FROM:
>
> if( $self->readmethod =~ /BPlite/ ) {
> $blastobj = new Bio::Tools::BPlite(-file => $tempfile);
> } else {
> $blastobj = new Bio::SearchIO( -file => $tempfile,
> -format => 'blast');
> }
>
>
> TO:
>
>
> if( $self->readmethod =~ /BPlite/ ) {
> $blastobj = new Bio::Tools::BPlite(-file => $tempfile);
> } elsif( $self->readmethod =~ /blasttable/ ) {
> $blastobj = new Bio::SearchIO( -file => $tempfile,
> -format => 'blasttable');
> } else {
> $blastobj = new Bio::SearchIO( -file => $tempfile,
> -format => 'blast');
> }
>
>
> Any suggestions/criticisms?
>
> Paul
>
>
> Paul Cantalupo
> Research Specialist/Systems Programmer
> 559 Crawford Hall
> Department of Biological Sciences
> University of Pittsburgh
> Pittsburgh, PA 15260
> Work: 412-624-4687
> Fax: 412-624-4759
>
> Ask me about Toastmasters: www.toastmasters.org
> Midday Club Treasurer
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
--
Jason Stajich
Duke University
http://www.duke.edu/~jes12
More information about the Bioperl-l
mailing list