[Bioperl-l] Run::Primer3 and no primer return

Roy Chaudhuri roy.chaudhuri at gmail.com
Wed Oct 22 17:43:55 UTC 2008


Hi Paola,

Please cc the bioperl-l mailing list in your replies, then others can 
contribute to the discussion.

I'm not sure I follow, I think you're saying that primer3_core works 
when run from the command line with a correctly formatted input file (as 
suggested by Dave and Scott), but when you run it via your script you 
get the usage message? That would indicate that Bioperl is finding and 
running primer3_core, but not producing a valid input file. Looking at 
the code, it seems that a temporary file is produced for the primer3 
input (using tempfile from Bio::Root::IO), so there could be a problem 
with that.

You haven't mentioned what BioPerl version you're using, but it'd be a 
good idea to upgrade to the latest (1.5.2) or even the one from 
Subversion, since there have been a few bugfixes to 
Bio::Tools::Run::Primer3 over the years. See:
http://www.bioperl.org/wiki/Getting_BioPerl
http://www.bioperl.org/wiki/Installing_BioPerl

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


Paola Bignone wrote:
> Hi Roy, 
> 
> Thank you for you quick response.
> 
> I normally run eprimer3 within a bash script, but I want to include the 
> searched primers in my perl script. I assumed that primer3_core was 
> working. 
> When I figured out the format of the input file, I managed to run 
> primer3_core from the command with the test sequence, giving me five 
> primers pairs. 
> 
> The output file is still empty. I have included the "use warnings; use 
> strict;" at the top of my script. 
> Even I changed the location of the file, to point to the executable 
> directly, rather the link.
> 
> Could it be that the perl script is not calling the primer3_core, as 
>  what it return is the usage message ?
> USAGE: primer3_core [-format_output] [-2x_compat] [-strict_tags]
> This is primer3 (primer3 release 1.0)
> Input must be provided on standard input.
> For example:
> $ primer3_core < my_input_file
> There were 0 primers
> 
> I will contact the system administrator, as it seems that it is not 
> 'bioperl' related, as the script was taken from the module documentation 
> and it run in your hands.
> Thanks again,
> Paola
> 
> 
> On Wed, Oct 22, 2008 at 3:36 PM, Roy Chaudhuri <rrc22 at cam.ac.uk 
> <mailto:rrc22 at cam.ac.uk>> wrote:
> 
>     Hi Paola,
> 
>     I tried your code using a sequence I had lying around, and it seemed
>     to work fine, designing 5 primers. I then tried it with a sequence
>     consisting of just As, so no primers were designed. However the
>     temp.out file was not empty, it still contained lines with the input
>     data (PRIMER_SEQUENCE_ID and SEQUENCE), so this suggests that
>     Primer3 is not running correctly for you. Perhaps there is a file
>     permissions issue? Is primer3_core executable?
> 
>     I notice that you haven't declared $results using "my". If you're
>     not doing so already, include "use warnings; use strict;" at the top
>     of your program, that might give you some more useful information on
>     why things are going wrong.
> 
>     Roy.
>     --
>     Dr. Roy Chaudhuri
>     Department of Veterinary Medicine
>     University of Cambridge, U.K.
> 
>     Paola Bignone wrote:
> 
>         Dear all,
> 
>         I trying to use Primer3 through Bioperl.
>         I copied the basic script from the Run::Primer3 documentation
>         module, and
>         although it is reading the sequence from the file, no primer is
>         designed.
>         If I use that sequence in the web-base interface of Primer3,
>         several primers
>         were obtained; so there is no problem with the sequence.
> 
>         It is a very basic problem, but I cannot get this to work.
>         I will appreciate any help as I'm stuck even before I started to
>         change the
>         code to suit my needs.
>         TIA,
>         Paola
> 
>         ----
>         use Bio::Tools::Run::Primer3;
>         use Bio::SeqIO;
> 
>           my $seqio=Bio::SeqIO->new(-file=>'data/test.fasta');
>           my $seq=$seqio->next_seq;
> 
>           my $primer3 = Bio::Tools::Run::Primer3 -> new(
>           -seq => $seq,
>           -outfile => 'data/temp.out',
>           -path => '/usr/local/pkgbin/primer3_core',
>           );
> 
>            unless ($primer3->executable) {
>            print STDERR "primer3 can not be found. Is it installed?\n";
>            exit(-1)
>           }
> 
>         $results=$primer3->run();
>         print "There were ", $results->number_of_results, " primers\n";
> 
>         ----
>         the data/temp.out file is created but it is empty.
>         _______________________________________________
>         Bioperl-l mailing list
>         Bioperl-l at lists.open-bio.org <mailto:Bioperl-l at lists.open-bio.org>
>         http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
> 
> 




More information about the Bioperl-l mailing list