rashichauhan has asked for the wisdom of the Perl Monks concerning the following question:

Dear all I am using NCBI BLast for sequence alignment .The URL of NCBI blast is http://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastp&PAGE_TYPE=BlastSearch&LINK_LOC=blasthome I am using mechanize perl module to input my enteries and hoping to get the output result.My program is
use strict; use Data::Dumper; use Carp; use WWW::Mechanize; use WWW::Mechanize::Firefox; use WWW::Mechanize::Sleepy; my $address = 'http://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastn& +BLAST_PROGRAMS=megaBlast&PAGE_TYPE=BlastSearch&SHOW_DEFAULTS=on&LINK_ +LOC=blasthome'; my $outfile = "outnewww.htm"; my $file = "n.txt"; my $organism = "Aspergillus"; my $mech = WWW::Mechanize->new(); #my $mech = WWW::Mechanize::Sleepy->new(sleep=>1); $mech->get($address); sleep (10); $mech->field( 'QUERYFILE', $file); $mech->field( 'qorganism', $organism); $mech->set_fields( # But the rest of these fields are recognized 'QUERYFILE' => $file, 'qorganism' => $organism ); $mech->submit; #my $result = $mech->content(); #print "$result\n"; my $output_page = $mech->content(); open(OUTFILE, ">$outfile"); print OUTFILE "$output_page"; close(OUTFILE);
The program is running alright but the problem is that ncbi blast auomatically updated for some second and then final output come.So what this program store is the intermediate page where it is coming"This page will be automatically updated in 1 sec until serach is done."Not able to get final alignment result.Plz help me in this regard.
  • Comment on Perl WWW::Mechanize and pages that Perl WWW::Mechanize and pages that automatically updated in 1 sec until serch is done
  • Download Code

Replies are listed 'Best First'.
Re: Perl WWW::Mechanize and pages that Perl WWW::Mechanize and pages that automatically updated in 1 sec until serch is done ( Bio::Tools::Run::RemoteBlast - Object for remote execution of the NCBI Blast via HTTP )
by Anonymous Monk on Oct 20, 2014 at 07:28 UTC
    NCBI BLast ... use WWW::Mechanize; use WWW::Mechanize::Firefox; use WWW::Mechanize::Sleepy; ... my $mech = WWW::Mechanize->new(); #my $mech = WWW::Mechanize::Sleepy->new(sleep=>1); ... Not able to get final alignment result.Plz help me in this regard.

    My suggestion is to use something that is already written, good luck and go fish ncbi blast, ncbi blast, ncbi blast... Bio::Tools::Run::RemoteBlast - Object for remote execution of the NCBI Blast via HTTP