[Bioperl-l] Issues on Bio::Tools::Primer3->next_primer

Roy Chaudhuri roy.chaudhuri at gmail.com
Tue Jul 29 06:26:34 EDT 2008


Hi John,

I'm not sure if you want to run Primer3 using BioPerl, or just use 
BioPerl to parse an existing Primer3 output file.

For the former you need to specify a target using the -seq argument when 
you create your Bio::Tools::Run::Primer3 object (the argument value 
should be a Bio::Seq object). It's also possible to add the sequence 
between the new() and run() methods using add_targets(), but you snipped 
out that section so I can't tell if you did that and there is some other 
problem. The run() method does not seem to check if a target sequence is 
present, hence you only get an error when you call next_primer() on the 
returned Bio::Tools::Primer3 object.

If you just want to parse an existing Primer3 output file then you need 
to use Bio::Tools::Primer3, specifying the path to the ouput file using 
the -file argument to new(). The documentation to Bio::Tools::Run::Primer3:
http://search.cpan.org/~sendu/bioperl-run/Bio/Tools/Run/Primer3.pm#new()
suggests that you can also provide a -file argument in that module, but 
there doesn't seem to be any evidence of that in the code.


Hope this helps.
Roy.
--
Dr. Roy Chaudhuri
Department of Veterinary Medicine
University of Cambridge, U.K.

> I am trying a generic script to parse outputs for Primer3 results from
> Bio::Tools::Run::Primer3:
> 
> use Bio::Tools::Run::Primer3;
> use Bio::Tools::Primer3;
> use Bio::Seq::PrimedSeq;
> [...]
> my $primer3_handle=Bio::Tools::Run::Primer3->new(-path=>'foobar');
> [...]
> my $primer3_results=$primer3_handle->run();
> my $primer_test=$primer3_results->next_primer;
> [...]
> 
> Which is similar to what was on the docs, but when Perl gives the following
> error at running next_primer:
> 
> ------------- EXCEPTION: Bio::Root::Exception -------------
> MSG: No target sequence
> STACK: Error::throw
> STACK: Bio::Root::Root::throw
> /usr/lib/perl5/site_perl/5.10.0/Bio/Root/Root.pm:359
> STACK: Bio::Tools::Primer3::next_primer
> /usr/lib/perl5/site_perl/5.10.0/Bio/Tools/Primer3.pm:306
> STACK: /home/johnma/workspace/NCBI-test/NCBI-test.pl:208
> -----------------------------------------------------------
> 
> Whereas line 208 is the line that contained the next_primer.
> 
> I tried to access the results manually by primer_results() and hard-calling
> fields, but the output of primer_results() is a hash and not very convenient
> for further processing. Is there a way that I can go back to next_primer...?
> 
> Cheers,
> 
> John
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l



More information about the Bioperl-l mailing list