[Bioperl-l] Trouble using RemoteBlast.pm

Barry Moore bmoore at genetics.utah.edu
Tue Jan 17 18:03:55 EST 2006


Nagesh,

Attached is an input file, script and output.  These work for me, and I
think they are the same that you are using.  Have a look and see if you
can find any differences that might be causing you problem.  Other than
that I don't know what to tell you.  If you are familiar with the perl
debugger you (and if you're not, now's probably a good time to become
familiar with it) you should step through you script and be sure that
all of you're objects are getting defined when they are supposed to be.
That can often help narrow down the problem.

Barry

> -----Original Message-----
> From: Nagesh Chakka [mailto:nagesh.chakka at anu.edu.au]
> Sent: Tuesday, January 17, 2006 1:57 PM
> To: Barry Moore
> Cc: Hubert Prielinger; bioperl-l at bioperl.org
> Subject: Re: [Bioperl-l] Trouble using RemoteBlast.pm
> 
> Bi  Barry,
> With the help of Hubert, I further modified the script but still have
the
> same
> problem. The problem is that from the point of submitting the blast
query,
> the script does not wait until the blast results are ready  for
retrieval
> and
> event of submission is immediately followed by retrieving and saving
the
> output. Since the results will not be ready (about a sec) this fast,
the
> output created is blank. I am able to retrieve the results online
using
> the
> RID which I am making the script to print.
> So  my main problem is making the program to wait after submitting the
> result.
> My input file has a single fasta sequence which I have pasted below.
> Its interesting to note that the script works on your system. Is it
> creating
> an output file with the blast report?
> Thanks very much for your attention.
> Regards
> Nagesh
> 
> blastInput.txt
> >MusDpl
>
MKNRLGTWWVAILCMLLASHLSTVKARGIKHRFKWNRKVLPSSGGQITEARVAENRPGAFIKQGRKLDIDFG
AE
> GNRYYA
>
ANYWQFPDGIYYEGCSEANVTKEMLVTSCVNATQAANQAEFSREKQDSKLHQRVLWRLIKEICSAKHCDFWL
ER
> GAAL
> RVAVDQPAMVCLLGFVWFIVK
> 
> On Wednesday 18 January 2006 05:34, Barry Moore wrote:
> > Nagesh-
> >
> > Did you get this figured out?  Your script works as is on my system.
> > You say temp.out is empty?  What does you input sequence
> > (blastInput.txt) look like?
> >
> > Barry
> >
> > > -----Original Message-----
> > > From: bioperl-l-bounces at portal.open-bio.org [mailto:bioperl-l-
> > > bounces at portal.open-bio.org] On Behalf Of Hubert Prielinger
> > > Sent: Monday, January 16, 2006 2:54 PM
> > > To: Nagesh Chakka; bioperl-l at portal.open-bio.org
> > > Subject: Re: [Bioperl-l] Trouble using RemoteBlast.pm
> > >
> > > Nagesh Chakka wrote:
> > > >Hi All,
> > > >I was trying to setup a system to perform a remote blast on
regular
> > >
> > > basis. I
> > >
> > > >thought this could be best achieved by using BioPerl module and
came
> > >
> > > across
> > >
> > > >RemoteBlast.pm
> > > >I had modified the sample script "bp_remote_blast.pl" which takes
a
> >
> > file
> >
> > > >containing single FASTA sequence as an input. Also I wanted the
blast
> > >
> > > report
> > >
> > > >to be saved in a file for latter use and
> > > >modified the code as follows
> > > >I am using the latest version of Bioperl (1.5) on a Fedora
platform.
> > >
> >
>#######################################################################
> > >
> > > >print "$Bio::Root::Version::VERSION\n";
> > > >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 paramter
> > > >$Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Homo
sapiens
> > > >[ORGN]';
> > > >
> > > >#remove a parameter
> > > >delete $Bio::Tools::Run::RemoteBlast::HEADER{'FILTER'};
> > > >
> > > >my $v = 1;
> > > >#$v is just to turn on and off the messages
> > > >
> > > >my $r = $factory->submit_blast('blastInput.txt');
> > > >
> > > >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
> > > >                {
> > > >                        print "RID $rid\n";
> > > >                        $factory->save_output('temp.out');
> > > >                        $factory->remove_rid($rid);
> > > >                }
> > > >        }
> > > >}
> > >
> >
>#######################################################################
> >
> > ##
> >
> > > ########
> > >
> > > >This script prints the RID and terminates immediately. Obviously
the
> > > >output file created is empty as the program did not wait for
getting
> >
> > the
> >
> > > >blast results from the RID.
> > > >Is there something I am doing wrong and what can I do for the
program
> >
> > to
> >
> > > wait
> > >
> > > >until the results are ready to be printed to the output file. I
could
> >
> > not
> >
> > > get
> > >
> > > >much information from the documentation and have no prior
experience
> >
> > with
> >
> > > >Bioperl.
> > > >Thanks very much for  your attention.
> > > >Regards
> > > >Nageshbi
> > > >_______________________________________________
> > > >Bioperl-l mailing list
> > > >Bioperl-l at portal.open-bio.org
> > > >http://portal.open-bio.org/mailman/listinfo/bioperl-l
> > >
> > > hi nagesh,
> > > try this, should work, I had the same problem:
> > >
> > > .......................
> > > .......................
> > >
> > > else
> > >                 {
> > >                         print "RID $rid\n";
> > >                         $factory->save_output('temp.out');
> > >
> > > 			my $checkinput = $factory->file;
> > >               		open(my $fh,"<$checkinput") or die $!;
> > >               		while(<$fh>){
> > >                 		print;
> > >               		}
> > >               		close $fh;
> > >
> > >
> > > 			$factory->remove_rid($rid);
> > >                 }
> > >         }
> > > }
> > >
> > > regards
> > > Hubert
> > >
> > > PS: are you using the composition based statistics parameter with
your
> > > blast search?
> > > if yes, is it working?
> > >
> > > _______________________________________________
> > > Bioperl-l mailing list
> > > Bioperl-l at portal.open-bio.org
> > > http://portal.open-bio.org/mailman/listinfo/bioperl-l
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bp_test.pl
Type: application/octet-stream
Size: 1281 bytes
Desc: bp_test.pl
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20060117/04a14cd4/bp_test-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp.out
Type: application/octet-stream
Size: 2615 bytes
Desc: temp.out
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20060117/04a14cd4/temp-0001.obj
-------------- next part --------------
>MusDpl
MKNRLGTWWVAILCMLLASHLSTVKARGIKHRFKWNRKVLPSSGGQITEARVAENRPGAFIKQGRKLDIDFGAEGNRYYA
ANYWQFPDGIYYEGCSEANVTKEMLVTSCVNATQAANQAEFSREKQDSKLHQRVLWRLIKEICSAKHCDFWLERGAAL
RVAVDQPAMVCLLGFVWFIVK


More information about the Bioperl-l mailing list