Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Primer3 - BioPerl

by blarsen20 (Initiate)
on Feb 06, 2012 at 18:10 UTC ( [id://952128]=perlquestion: print w/replies, xml ) Need Help??

blarsen20 has asked for the wisdom of the Perl Monks concerning the following question:

Greetings monks! I come in seek of help regarding a perl module from bioperl tools, Primer3. Whenever I run it normally get something such as "unallowed parameter". It calls all the modules correctly though, seen in:

#!/usr/local/bin/perl use warnings; use strict; use Bio::SeqIO; use Bio::Seq; use Bio::Tools::Primer3; use Data::Dumper;

However, when I call something such as $primer3->arguments to see the list of arguments, it doesn't work. Code within the program:

my $seqio = new Bio::SeqIO( -file => "<(PRIVATE)/fastaUplist.fa", + -format =>'fasta'); my $seq = $seqio->next_seq; my $primer3 = Bio::Tools::Primer3->new( -seq=>$seq, -path=>"(PRIVATE)/primer3_core" ); my $argref = $primer3->arguments(); print Dumper($argref);

Any ideas as to why this is not working?? Could there be an error due to the .pm file often referring to itself as Bio::Tools::Run::Primer3 instead of Bio::Tools::Primer3 as it's packaged now? Thanks!

UPDATE: Whenever I run it now I get 0 results back seen in the $results section via data dumper where:

 'maximum_primers_returned' => -1,

Also, if running it a different way I get nonsense about "thermodynamic approach chosen, but path to thermodynamic parameters not specified". Meh? It's weird since it can be ran from the command line with the example in the primer3 manual seen here: http://umbc.rnet.missouri.edu/resources/primer3_manual.htm#example However, when running with our own file there were errors (thermodynamic approach... as mentioned above). This was just to test the executable primer3_core though, because we want to use the module for development elsewhere. Any suggestions?

Replies are listed 'Best First'.
Re: Primer3 - BioPerl
by Corion (Patriarch) on Feb 06, 2012 at 18:22 UTC

    There is something that you are not telling us. The only instance of "unallowed parameter" in the source code of Bio::Tools::Primer3 is

    $self->throw("Unallowed parameter: $attr !") unless $OK_FIELD{$attr};

    So, why don't you tell us which parameter it does not like? And why do you try to pass a wrong parameter at all? My guess is that the error also has a line number or other stack trace. Why do you keep it secret from us?

      a) It wasn't a wrong parameter...followed the documentation and code seen elsewhere...not that stupid.

      b) Originally I was just testing to see if it would even show arguments, as shown in the code provided ($primer3->arguments), though other examples all point to the same line which you provided due to the nature of the program.

      However, it seems for some reason there are multiple Primer3.pm files available, one modified from '01 and another in '03. Changing which file was contained within the library for some reason has allowed it to run.

      My only error now is "Executable was not found. Do not know where primer3 is!" via:

      my $results = $primer3->run;

      Error seen in Primer3.pm:452.

Re: Primer3 - BioPerl
by Khen1950fx (Canon) on Feb 06, 2012 at 19:05 UTC
      After installing BioPerl last week, Primer3 was contained in the main Bio::Tools, not Bio::Tools::Run; not sure as to why this is, but it's how it was set-up.

        It can be confusing sometimes:). You seem to be using BioPerl, so, yes, you want to write your script according to the documentation for Bio::Tools::Primer3, which is part of the BioPerl distribution. The code that you posted, however, was written according to the documentation for BioPerl-Run, which is a different distribution altogether. You were going by Bio::Tools::Run::Primer3 instead of Bio::Tools::Primer3, which is the module that you want to use.

        Update: You need to install primer3

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://952128]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found