Bio::T...eBlast(3pm)

๐Ÿ’– Bio::Tools::Run::RemoteBlast ๐Ÿ’–

okay bestie, buckle up โ€” this is the Bio::Tools::Run::RemoteBlast page, straight outta the User Contributed Perl Documentation collection. it's giving "run NCBI BLAST from really far away and pretend it's local." no cap. โœจ


๐ŸŒธ NAME ๐ŸŒธ

Bio::Tools::Run::RemoteBlast โ€” an object for remote execution of the NCBI Blast via HTTP ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

not me dropping the whole example on you, but it's literally all here, so read it, it's important iykyk
#Remote-blast "factory object" creation and blast-parameter initialization

use Bio::Tools::Run::RemoteBlast;
use strict;
my $prog = 'blastp';
my $db   = 'swissprot';
my $e_val= '1e-10';

my @params = ( '-prog' => $prog,
       '-data' => $db,
       '-expect' => $e_val,
       '-readmethod' => 'SearchIO' );

my $factory = Bio::Tools::Run::RemoteBlast->new(@params);

#change a query parameter
$Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Homo sapiens [ORGN]';

#change a retrieval parameter
$Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'DESCRIPTIONS'} = 1000;

#remove a parameter
delete $Bio::Tools::Run::RemoteBlast::HEADER{'FILTER'};

#$v is just to turn on and off the messages
my $v = 1;

my $str = Bio::SeqIO->new(-file=>'amino.fa' , -format => 'fasta' );

#optional: send BLAST request to a cloud service provider instead of NCBI
#$factory->set_url_base("http://host.my.cloud.service.provider.com/cgi-bin/blast.cgi");

while (my $input = $str->next_seq()){
  #Blast a sequence against a database:

  #Alternatively, you could  pass in a file with many
  #sequences rather than loop through sequence one at a time
  #Remove the loop starting 'while (my $input = $str->next_seq())'
  #and swap the two lines below for an example of that.
  my $r = $factory->submit_blast($input);
  #my $r = $factory->submit_blast('amino.fa');

  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 {
        my $result = $rc->next_result();
        #save the output
        my $filename = $result->query_name()."\.out";
        $factory->save_output($filename);
        $factory->remove_rid($rid);
        print "\nQuery Name: ", $result->query_name(), "\n";
        while ( my $hit = $result->next_hit ) {
          next unless ( $v > 0);
          print "\thit name is ", $hit->name, "\n";
          while( my $hsp = $hit->next_hsp ) {
            print "\t\tscore is ", $hsp->score, "\n";
          }
        }
      }
    }
  }
}

# This example shows how to change a CGI parameter:
$Bio::Tools::Run::RemoteBlast::HEADER{'MATRIX_NAME'} = 'BLOSUM45';
$Bio::Tools::Run::RemoteBlast::HEADER{'GAPCOSTS'} = '15 2';

# And this is how to delete a CGI parameter:
delete $Bio::Tools::Run::RemoteBlast::HEADER{'FILTER'};

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

Class for remote execution of the NCBI Blast via HTTP. ๐Ÿ’…

if you wanna know about the many CGI parameters, the receipts are right here:

https://www.ncbi.nlm.nih.gov/BLAST/Doc/urlapi.html

also, various additional options and input formats are available. obsessed. ๐ŸŒˆ


๐Ÿซถ FEEDBACK ๐Ÿซถ

๐Ÿ’Œ Mailing Lists

okay so user feedback is an integral part of the evolution of this module and all the other Bioperl modules. send your comments and suggestions preferably to one of the Bioperl mailing lists. your participation is much appreciated. fr fr. ๐Ÿฅน

bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

๐Ÿฉน Support

pls pls pls direct your usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

...and NOT to the module maintainer directly, bestie. there are tons of experienced and responsive experts on there who can look at the problem and address it fast. if at all possible, include a thorough description of the problem with code and data examples. give them the whole story, not just the vibe. ๐Ÿ’–

๐Ÿ› Reporting Bugs

report bugs to the Bioperl bug tracking system so we can keep track of the bugs and their resolution. bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

please do NOT contact Jason directly about this module. post to the bioperl mailing list instead (see FEEDBACK up there โฌ†๏ธ). and if you'd like to be the official maintainer of this module?? volunteer on the list and it will be made official in this POD. main character energy, honestly. ๐ŸŽ€

first written by Jason Stajich, and many others have helped keep it running. ๐ŸŒŸ


๐Ÿ”ฎ APPENDIX ๐Ÿ”ฎ

the rest of the documentation details each of the object methods. internal methods are usually preceded with a _ โ€” iykyk. ๐Ÿฆ‹

๐Ÿ’œ retrieve_parameter

  • Title : retrieve_parameter
  • Usage : my $db = $self->retrieve_parameter
  • Function: Get/Set the named parameter for the retrieve_blast operation.
  • Returns : string
  • Args : $name : name of GET parameter $val : optional value to set the parameter to

๐Ÿ’œ submit_parameter

  • Title : submit_parameter
  • Usage : my $db = $self->submit_parameter
  • Function: Get/Set the named parameter for the submit_blast operation.
  • Returns : string
  • Args : $name : name of PUT parameter $val : optional value to set the parameter to
  • Title : header
  • Usage : my $header = $self->header
  • Function: Get 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, blasttable, xml ]

๐Ÿ’œ program

  • Title : program
  • Usage : my $prog = $self->program
  • Function: Get/Set the program to run. Retained for backwards-compatibility.
  • Returns : string
  • Args : string [ blastp, blastn, blastx, tblastn, tblastx ]

๐Ÿ’œ database

  • Title : database
  • Usage : my $db = $self->database
  • Function: Get/Set the database to search. Retained for backwards-compatibility.
  • Returns : string
  • Args : string [ swissprot, nr, nt, etc... ]

๐Ÿ’œ expect

  • Title : expect
  • Usage : my $expect = $self->expect
  • Function: Get/Set the E value cutoff. Retained for backwards-compatibility.
  • 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 : scalar int (constant) or Bio::SearchIO object Constants:
    • NOT_FINISHED (= 0) : 'job not finished'
    • code on error:
      • ERR_QBSTATUS (= 1) : return line matches 'Status=ERROR'
      • ERR_NOCONTENT (= 2): HTTP request successful, but no content returned
      • ERR_HTTPFAIL (= 4) : HTTP request failed
      • ERR_QBNONSPEC (= 8): return line matches 'ERROR' (not status line)
  • Args : Remote Blast ID (RID)

๐Ÿ’œ save_output

  • Title : saveoutput
  • Usage : my $saveoutput = $self->save_output($filename)
  • Function: Method to save the blast report
  • Returns : 1 (throws error otherwise)
  • Args : string [ rid, filename ]

๐Ÿ’œ set_url_base

  • Title : set_url_base
  • Usage : $self->set_url_base($url)
  • Function: Method to override the default URL to access the NCBI BLAST web service
  • Returns : None
  • Args : string (URL used for remote BLAST searches)
  • NOTE : This is highly experimental; we cannot maintain support on web services other than the default NCBI BLAST web service at this time. Only some URL parameters may be supported by other BLAST web services.

๐Ÿ’œ get_url_base

  • Title : get_url_base
  • Usage : my $url = $self->set_url_base
  • Function: Get the current URL for BLAST searching
  • Returns : string (URL used for remote blast searches)
  • Args : None

๐Ÿ’œ get_rtoe

  • Title : get_rtoe
  • Usage : my $url = $self->rtoe
  • Function: Retrieve the retrieval time (defined after submit_blast())
  • Returns : number
  • Args : None

and that's the whole page, bestie!! ๐Ÿฆ‹โœจ๐ŸŽ€

this one was brought to you by perl v5.30.0, dated 2020-05-12 โ€” so yes it's a lil vintage but she still slays ๐Ÿ’… go forth and blast remotely, you got this ๐Ÿ’–

๐Ÿ“ฆ where this page comes from