bioperl / bioperl-live-redmine

Legacy tickets migrated from the OBF Redmine issue tracker: http://redmine.open-bio.org
0 stars 0 forks source link

Bio::Tools::Run::StandAloneBlastPlus "entrez_query" option #90

Open cjfields opened 8 years ago

cjfields commented 8 years ago

Author Name: Remi empty (Remi empty) Original Redmine Issue: 3150, https://redmine.open-bio.org/issues/3150 Original Date: 2010-10-27 Original Assignee: Bioperl Guts


When running this code:

my $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => ‘nr’, -remote => 1, );

my $result = $fac->blastp( -query => ‘NP_861128.fasta’, -outfile => ‘query.bls’, -method_args => [ -entrez_query => ‘txid2759[ORGN]’, ], );

the option ‘-entrez_query’ doesn’t work. I’ve looked to the code of Bio::Tools::Run::StandAloneBlastPlus and it seems that in the AUTOLOAD method, the options in -method_args are overwritten:

push @args, (‘-method_args’ => [’remote’ => 1] ) if ($self>is_remote);

If I put the -entrez_query option directly in the AUTOLOAD method, it works.

push @args, (‘-method_args’ => [(‘-remote’ => 1,entrez_query => ’txid2759[ORGN]’)] ) if ($self>is_remote);

cjfields commented 8 years ago

Original Redmine Comment Author Name: Remi empty Original Date: 2010-10-27T08:27:05Z


Created an attachment (id=1551) Dirty patch

cjfields commented 8 years ago

Original Redmine Comment Author Name: Remi empty Original Date: 2010-10-27T08:29:42Z


(From update of attachment 1551)

diff —git a/lib/Bio/Tools/Run/StandAloneBlastPlus.pm b/lib/Bio/Tools/Run/StandAloneBlastPlus.pm index b13f464..cef2057 100755 —- a/lib/Bio/Tools/Run/StandAloneBlastPlus.pm *_+ b/lib/Bio/Tools/Run/StandAloneBlastPlus.pm @ -1289,6 +1289,7@ Finally, if $AUTOLOAD is pointing to a blast query method, AUTOLOAD runs C with the C<-method> parameter appropriately set.

=cut

sub AUTOLOAD { my $self = shift; @ -1297,8 +1298,13@ sub AUTOLOAD { $method =~ s/._:://; my `ret;

if (grep /^$method$/, `Bio::Tools::Run::StandAloneBlastPlus::BlastMethods) {

- push `args, ('-method_args' => ['-remote' => 1] ) if ($self->is_remote);

  • return $self->run( -method => $method, args ); \>+ if ($self-\>is\_remote) { \>+ my %argsHash =args;
  • push( {$argsHash{-method\_args}} ,(‘-remote’ =\> 1) ); \>+ \# pushargs, ('-method_args' => ['-remote' => 1] ) if ($self->is_remote);
  • args = %argsHash; \>+ } \>+ return $self-\>run( -method =\> $method,args ); } if ($self->factory and $self->factory->can($method)) { # factory method return $self->factory->$method(`args);
cjfields commented 8 years ago

Original Redmine Comment Author Name: Remi empty Original Date: 2010-10-27T08:43:25Z


Bug 3151 has been marked as a duplicate of this bug.