[Bioperl-l] Re: default RemoteBlast user agent

Richard Adams Richard.Adams at ed.ac.uk
Fri Oct 31 07:24:28 EST 2003


Hi Jason,
    Do you think it's worthwhile including error checking for sensible 
blast parameters or  is it acceptable to just let people figure out the 
blast failed submsiion html for themselves?

Richard
Jason Stajich wrote:

> Richard -
>
> Grateful that you are willing to take on RemoteBlast.  Not my cup of tea
> any more.  I think SearchIO should be able to handle bl2seq, megablast,
> and rpsblast outputs just fine now.  May have to cleanup any <pre> 
> tags if
> NCBI throws them in there.
>
> Here is some correspondance I've had with someone at NCBI - presumably 
> the
> simple script he sent is probably what you already knew - but I'm sending
> it along at any rate.
>
> Let me know if you have any questions, etc.
>
> Best,
> -jason
>
> -- 
> Jason Stajich
> Duke University
> jason at cgt.mc.duke.edu
>
> ---------- Forwarded message ----------
> Date: Wed, 22 Oct 2003 11:57:51 -0400
> From: George Coulouris <coulouri at ncbi.nlm.nih.gov>
> Cc: jason at bioperl.org
> Subject: Re: default RemoteBlast user agent?
>
> George Coulouris wrote:
>
>> Jason-
>>
>> On an unrelated note, are there plans to support multiple queries /
>> megablast nucleotide searches?
>>
>> -George
>
>
> Jason,
>
> I've attached some perl code that demonstrates how to do batch
> submission of multiple nucleotide sequences with megablast. Usage is:
>
> ./remote_megablastp.pl file1 file2..
>
> Input files should be in fasta format.
>
> It will emit the CGI output from which the RID can be obtained. Polling
> for results / obtaining results / formatting results can proceed as usual.
>
>------------------------------------------------------------------------
>
>#!/opt/local/bin/perl
>
>use URI::Escape;
>use LWP::UserAgent;
>use HTTP::Request::Common qw(POST);
>
>$ua = LWP::UserAgent->new;
>
># read and encode the queries
>foreach $query (@ARGV)
>{
>open(QUERY,$query);
>while(<QUERY>)
>{
>$encoded_query = $encoded_query . uri_escape($_);
>}
>}
>
>$args = 'CMD=Put&PROGRAM=blastn&DATABASE=nt&MEGABLAST=on&QUERY=' . $encoded_query;
>
>$req = new HTTP::Request POST => 'http://www.ncbi.nlm.nih.gov/blast/Blast.cgi';
>$req->content_type('application/x-www-form-urlencoded');
>$req->content($args);
>
>#print $req->as_string();
>
>$response = $ua->request($req);
>
>if ($response->is_success)
>{
>print $response->content;
>}
>else
>{
>print $response->error_as_HTML;
>}
>  
>

-- 
Dr Richard Adams
Bioinformatician,
Psychiatric Genetics Group,
Medical Genetics,
Molecular Medicine Centre,
Western General Hospital,
Crewe Rd West,
Edinburgh UK
EH4 2XU

Tel: 44 131 651 1084
richard.adams at ed.ac.uk





More information about the Bioperl-l mailing list