[Bioperl-l] RemoteBlast fixes

Wiepert, Mathieu Wiepert.Mathieu@mayo.edu
Wed, 11 Sep 2002 14:51:09 -0500


Hi,

I found a slight problem with RemoteBlast.  I created a factory object with an empty constructor like this:

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

and then tried to set some parameters like Brian Osborne suggested:
$Bio::Tools::Run::RemoteBlast::HEADER{'PROGRAM'} = 'blastp';
$Bio::Tools::Run::RemoteBlast::HEADER{'DATABASE'} = 'nr';
$Bio::Tools::Run::RemoteBlast::HEADER{'EXPECT'} = '200000';
$Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Homo sapiens [ORGN]';
...

When I use the empty constructor, and set values as above, the expect value was staying as 1e-3.  This is happening because the header method is setting the default values for PROGRAM, DATABASE, and EXPECT to the values in %BLAST_PARAMS.  This is only happening because I asked for a new RemoteBlast object with an empty constructor.  I figure that the BLAST_PARAMS exists to make sure there is at least the minimum set of parameters to send to the NCBI blast.  Do you think it is valid to invoke with an empty constructor?  If so, the defaults set in the program are used anyway.

One fix that seems to work is to change the expect method (and program and database accordingly) to

sub expect {
    my ($self, $val) = @_;
    if( defined $val ) {
#	$self->{'_expect'} = $val;
 	$HEADER{'EXPECT'} = $val;
    }
    return $HEADER{'EXPECT'};
}

Is this a bad idea, or a bad way to fix it?

I also fixed the query line in the submit_blast method, so that the remote blasts return the query.  Otherwise they were not.  

-Mat