[Biopython] Primer3Commandline rookie question

Peter biopython at maubp.freeserve.co.uk
Wed Nov 3 19:13:36 UTC 2010


On Wed, Nov 3, 2010 at 6:58 PM, Jukka-Pekka Verta <jp.verta at gmail.com> wrote:
> Hi all,
>
> I'm just starting with Python so mine's a rookie question.
>
> I'm trying to write a little program that would do primer design with
> Primer3Commandline, yet I can't figure out how to access the output.
> For example, when I try the same example as in the Application.py
> file under Primer3Commandline function
>
> ######
>
> from Bio.Emboss.Applications import Primer3Commandline
> from Bio.Emboss import Primer3
>
> sequence_handle = open("sequence", "w").write("...\n")

Here you've created a file called "sequence" (with no extension). I'd
have gone for something like "sequence.fasta" but it doesn't mater.

> test = Primer3Commandline(sequence = sequence_handle, auto=True, hybridprobe=True)

Here you should be passing the filename, in your case "sequence".
Maybe we should add a check here for people passing non-strings
to arguments expecting filenames.

Does that help?

Peter

[Note It is possible to avoid the temporary file by writing to the tool's
stdin but this is fiddly and requires you to work with the subprocess
module directly.]



More information about the Biopython mailing list