NAME
Bio::Tools::Run::RemoteBlast - Object for remote execution of the NCBI Blast via HTTP
SYNOPSIS
Remote-blast "factory object" creation and blast-parameter initialization:
use Bio::Tools::Run::RemoteBlast;
use strict;
my $v = 1;
my $prog = 'blastp';
my $db = 'swissprot';
my $e_val= '1e-10';
my @params = ( '-prog' => $prog,
'-data' => $db,
'-expect' => $e_val );
my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
$v = 1;
my $str = Bio::SeqIO->new(-file=>'amino.fa' , '-format' => 'fasta' );
my $input = $str->next_seq();
# Blast a sequence against a database:
my $r = $factory->submit_blast($input);
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 ) {
$factory->remove_rid($rid);
}
print STDERR "." if ( $v > 0 );
sleep 5;
} else {
$factory->remove_rid($rid);
my $result = $rc->next_result;
print "db is ", $result->database_name(), "\n";
my $count = 0;
while( my $hit = $result->next_hit ) {
$count++;
next unless ( $v > 0);
print "hit name is ", $hit->name, "\n";
while( my $hsp = $hit->next_hsp ) {
print "score is ", $hsp->score, "\n";
}
}
}
}
}
Various additional options and input formats are available. See the DESCRIPTION section for details.
DESCRIPTION
Class for remote execution of the NCBI Blast via HTTP.
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bio.perl.org/MailList.html - About the mailing lists
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via email or the web:
bioperl-bugs@bio.perl.org
http://bio.perl.org/bioperl-bugs/
AUTHOR - Jason Stajich
Email jason@bioperl.org
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
header
Title : header
Usage : my $header = $self->header
Function: Get/Set HTTP header for blast query
Returns : string
Args : none
readmethod
Title : readmethod
Usage : my $readmethod = $self->readmethod
Function: Get/Set the method to read the blast report
Returns : string
Args : string [ Blast, BPlite ]
program
Title : program
Usage : my $prog = $self->program
Function: Get/Set the program to run
Returns : string
Args : string [ blastp, blastn, blastx, tblastn, tblastx ]
database
Title : database
Usage : my $db = $self->database
Function: Get/Set the database to search
Returns : string
Args : string [ swissprot, nr, nt, etc... ]
expect
Title : expect
Usage : my $expect = $self->expect
Function: Get/Set the E value cutoff
Returns : string
Args : string [ '1e-4' ]
ua
Title : ua
Usage : my $ua = $self->ua or
$self->ua($ua)
Function: Get/Set a LWP::UserAgent for use
Returns : reference to LWP::UserAgent Object
Args : none
Comments: Will create a UserAgent if none has been requested before.
proxy
Title : proxy
Usage : $httpproxy = $db->proxy('http') or
$db->proxy(['http','ftp'], 'http://myproxy' )
Function: Get/Set a proxy for use of proxy
Returns : a string indicating the proxy
Args : $protocol : an array ref of the protocol(s) to set/get
$proxyurl : url of the proxy to use for the specified protocol
submit_blast
Title : submit_blast
Usage : $self->submit_blast([$seq1,$seq2]);
Function: Submit blast jobs to ncbi blast queue on sequence(s)
Returns : Blast report object as defined by $self->readmethod
Args : input can be:
* sequence object
* array ref of sequence objects
* filename of file containing fasta formatted sequences
retrieve_blast
Title : retrieve_blast
Usage : my $blastreport = $blastfactory->retrieve_blast($rid);
Function: Attempts to retrieve a blast report from remote blast queue
Returns : -1 on error,
0 on 'job not finished',
Bio::Tools::BPlite or Bio::Tools::Blast object
(depending on how object was initialized) on success
Args : Remote Blast ID (RID)