[BioPython] Problems with Emboss.Primer3

Peter Cock p.j.a.cock at googlemail.com
Thu Nov 13 14:43:46 UTC 2008


Stefanie Lück wrote:
> Hi!
>
> I'm trying to generate a Primer3 file but I have some problems because
> my output file is allways empty.
> Unfortunatly I don't get an error message.

Hi Stefanie,

I have a couple of suggestions to try and work out what is wrong here...

> Here's my code:
>
> from Bio import Fasta
> from Bio.Emboss.Applications import Primer3Commandline
> from Bio.Application import generic_run
> from Bio.Emboss.Primer import Primer3Parser

Note Bio.Emboss.Primer was deprecated for Biopthon 1.49, I think
you'll want to use Bio.Emboss.Primer3 instead.

> primer_cl = Primer3Commandline()
> primer_cl.set_parameter("-sequence", "p3input.txt")
> primer_cl.set_parameter("-outfile", "out.pr3")
> primer_cl.set_parameter("-productsizerange", "350,10000")
> primer_cl.set_parameter("-target", "%s,%s" % (50, 500))
> result, messages, errors = generic_run(primer_cl)
> ...

What does this give:

print "Command line:"
print primer_cl
print "Return code:"
print result.return_code
print "Errors:"
print errors.read()
print "Messages":
print messages.read()

Also try running the command line by hand at the command prompt.  I
get this, which may mean a problem with the input file:

$ eprimer3 -sequence p3input.txt -outfile out.pr3 -target 50,500
-productsizerange 350,10000
Picks PCR primers and hybridization oligos
Error: Unable to read sequence 'p3input.txt'
Died: eprimer3 terminated: Bad value for '-sequence' and no prompt

Is your input file really expected to work?  Reading the docs I would
suggest trying a FASTA file as input, but I am not familiar with this
tool:
http://emboss.sourceforge.net/apps/release/6.0/emboss/apps/eprimer3.html

Peter




More information about the Biopython mailing list