[Bioperl-l] A possible fix for Bio::Tools::Run::Primer3::run().

George Hartzell hartzell at kestrel.alerce.com
Sun Jun 12 20:52:24 EDT 2005


Me again,

Can someone review this patch?

Bio::Tools::Primer3::_separate refers to $self->{input_options}, which
it expects to be a reference to a hash containing the arguments that
were passed to primer3, to help it figure out what is a result and
what's not.

Unfortunately, it doesn't look like it's ever set in the results
object that's passed back, so if you use $results->primer_results(0),
you end up with the input arguments mixed in.

I think that this fixes it.

I'm sure there's a way to do it in one line.....

g.

*** Bio/Tools/Run/Primer3.pm.orig	Tue Mar  1 18:26:31 2005
--- Bio/Tools/Run/Primer3.pm	Sun Jun 12 17:41:51 2005
***************
*** 452,457 ****
--- 452,466 ----
  	$self->{results_obj} = new Bio::Tools::Primer3;
  	$self->{results_obj}->_set_variable('results', $self->{results});
  	$self->{results_obj}->_set_variable('seqobject', $self->{seqobject});
+ 	# Bio::Tools::Primer3::_separate needs a hash of the primer3 arguments,
+ 	# with the arg as the key and the value as the value (surprise!).
+ 	my %input_hash;
+ 	foreach my $line (@{$self->{'primer3_input'}}) {
+ 	  my ($key, $value) = split '=', $line;
+ 	  $input_hash{$key} = $value;
+ 	}
+ 	$self->{results_obj}->_set_variable('input_options', \%input_hash);
+ 
  	$self->{results_separated}= $self->{results_obj}->_separate();
  	return $self->{results_obj};
  }


More information about the Bioperl-l mailing list