.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Bio::Tools::Run::RemoteBlast 3pm" .TH Bio::Tools::Run::RemoteBlast 3pm "2018-10-27" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Tools::Run::RemoteBlast \- Object for remote execution of the NCBI Blast via HTTP .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& #Remote\-blast "factory object" creation and blast\-parameter initialization \& \& use Bio::Tools::Run::RemoteBlast; \& use strict; \& my $prog = \*(Aqblastp\*(Aq; \& my $db = \*(Aqswissprot\*(Aq; \& my $e_val= \*(Aq1e\-10\*(Aq; \& \& my @params = ( \*(Aq\-prog\*(Aq => $prog, \& \*(Aq\-data\*(Aq => $db, \& \*(Aq\-expect\*(Aq => $e_val, \& \*(Aq\-readmethod\*(Aq => \*(AqSearchIO\*(Aq ); \& \& my $factory = Bio::Tools::Run::RemoteBlast\->new(@params); \& \& #change a query parameter \& $Bio::Tools::Run::RemoteBlast::HEADER{\*(AqENTREZ_QUERY\*(Aq} = \*(AqHomo sapiens [ORGN]\*(Aq; \& \& #change a retrieval parameter \& $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{\*(AqDESCRIPTIONS\*(Aq} = 1000; \& \& #remove a parameter \& delete $Bio::Tools::Run::RemoteBlast::HEADER{\*(AqFILTER\*(Aq}; \& \& #$v is just to turn on and off the messages \& my $v = 1; \& \& my $str = Bio::SeqIO\->new(\-file=>\*(Aqamino.fa\*(Aq , \-format => \*(Aqfasta\*(Aq ); \& \& #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 \*(Aqwhile (my $input = $str\->next_seq())\*(Aq \& #and swap the two lines below for an example of that. \& my $r = $factory\->submit_blast($input); \& #my $r = $factory\->submit_blast(\*(Aqamino.fa\*(Aq); \& \& 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()."\e.out"; \& $factory\->save_output($filename); \& $factory\->remove_rid($rid); \& print "\enQuery Name: ", $result\->query_name(), "\en"; \& while ( my $hit = $result\->next_hit ) { \& next unless ( $v > 0); \& print "\ethit name is ", $hit\->name, "\en"; \& while( my $hsp = $hit\->next_hsp ) { \& print "\et\etscore is ", $hsp\->score, "\en"; \& } \& } \& } \& } \& } \& } \& \& # This example shows how to change a CGI parameter: \& $Bio::Tools::Run::RemoteBlast::HEADER{\*(AqMATRIX_NAME\*(Aq} = \*(AqBLOSUM45\*(Aq; \& $Bio::Tools::Run::RemoteBlast::HEADER{\*(AqGAPCOSTS\*(Aq} = \*(Aq15 2\*(Aq; \& \& # And this is how to delete a CGI parameter: \& delete $Bio::Tools::Run::RemoteBlast::HEADER{\*(AqFILTER\*(Aq}; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Class for remote execution of the \s-1NCBI\s0 Blast via \s-1HTTP.\s0 .PP For a description of the many \s-1CGI\s0 parameters see: https://www.ncbi.nlm.nih.gov/BLAST/Doc/urlapi.html .PP Various additional options and input formats are available. .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "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. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting Bugs" .IX Subsection "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 the web: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR" .IX Header "AUTHOR" Please do \s-1NOT\s0 contact Jason directly about this module. Please post to the bioperl mailing list (\s-1FEEDBACK\s0). If you would like to be the official maintainer of this module, please volunteer on the list and we will make it official in this \s-1POD.\s0 .PP First written by Jason Stajich, many others have helped keep it running. .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "retrieve_parameter" .IX Subsection "retrieve_parameter" .Vb 6 \& 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 .Ve .SS "submit_parameter" .IX Subsection "submit_parameter" .Vb 6 \& 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 .Ve .SS "header" .IX Subsection "header" .Vb 5 \& Title : header \& Usage : my $header = $self\->header \& Function: Get HTTP header for blast query \& Returns : string \& Args : none .Ve .SS "readmethod" .IX Subsection "readmethod" .Vb 5 \& Title : readmethod \& Usage : my $readmethod = $self\->readmethod \& Function: Get/Set the method to read the blast report \& Returns : string \& Args : string [ blast, blasttable, xml ] .Ve .SS "program" .IX Subsection "program" .Vb 5 \& 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 ] .Ve .SS "database" .IX Subsection "database" .Vb 5 \& 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... ] .Ve .SS "expect" .IX Subsection "expect" .Vb 5 \& Title : expect \& Usage : my $expect = $self\->expect \& Function: Get/Set the E value cutoff. Retained for backwards\-compatibility. \& Returns : string \& Args : string [ \*(Aq1e\-4\*(Aq ] .Ve .SS "ua" .IX Subsection "ua" .Vb 7 \& 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. .Ve .SS "proxy" .IX Subsection "proxy" .Vb 7 \& Title : proxy \& Usage : $httpproxy = $db\->proxy(\*(Aqhttp\*(Aq) or \& $db\->proxy([\*(Aqhttp\*(Aq,\*(Aqftp\*(Aq], \*(Aqhttp://myproxy\*(Aq ) \& 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 .Ve .SS "submit_blast" .IX Subsection "submit_blast" .Vb 8 \& 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 .Ve .SS "retrieve_blast" .IX Subsection "retrieve_blast" .Vb 10 \& 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) : \*(Aqjob not finished\*(Aq \& code on error: \& ERR_QBSTATUS (= 1) : return line matches \*(AqStatus=ERROR\*(Aq \& ERR_NOCONTENT (= 2): HTTP request successful, but no content \& returned \& ERR_HTTPFAIL (= 4) : HTTP request failed \& ERR_QBNONSPEC (= 8): return line matches \*(AqERROR\*(Aq (not status line) \& Args : Remote Blast ID (RID) .Ve .SS "save_output" .IX Subsection "save_output" .Vb 5 \& 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] .Ve .SS "set_url_base" .IX Subsection "set_url_base" .Vb 9 \& 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. .Ve .SS "get_url_base" .IX Subsection "get_url_base" .Vb 5 \& 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 .Ve .SS "get_rtoe" .IX Subsection "get_rtoe" .Vb 5 \& Title : get_rtoe \& Usage : my $url = $self\->rtoe \& Function: Retrieve the retrieval time (defined after submit_blast()) \& Returns : number \& Args : None .Ve