[Biopython-dev] [Bug 3173] New: Bio.Emboss.Primer3 parser incompatibility with Primer3 version 2.2.3
bugzilla-daemon at portal.open-bio.org
bugzilla-daemon at portal.open-bio.org
Tue Feb 1 18:00:54 UTC 2011
http://bugzilla.open-bio.org/show_bug.cgi?id=3173
Summary: Bio.Emboss.Primer3 parser incompatibility with Primer3
version 2.2.3
Product: Biopython
Version: 1.55
Platform: Macintosh
OS/Version: Mac OS
Status: NEW
Severity: normal
Priority: P2
Component: Other
AssignedTo: biopython-dev at biopython.org
ReportedBy: jp.verta at gmail.com
I'm running Biopython 1.55, Python 2.6 and EMBOSS version 6.3.1 on MacOS X 10.6
Snow Leopard.
The Bio.Emboss.Primer3 parser seems to be incompatible with the newer version
2.2.3 of the Whitehead Primer3 program and the corresponding Emboss eprimer3
program output. The parser output for the reverse primer seems to contain all
Primer -class members (primer.reverse_tm, primer.reverse_gc etc.) except the
reverser primer sequence (primer.reverse_seq). Yet the eprimer3 output seems
identical to that of old versions (see the output.pr3 -files attached).
Here is an example code for designing primers for a set of fasta sequences.
>>>
def design_primers(fasta_file, output_file):
from Bio import SeqIO
from Bio.Emboss.Applications import Primer3Commandline
from Bio.Emboss import Primer3
output = open(output_file, "w")
output.write("name,forward_primer,reverse_primer,forward_tm,reverse_tm,product_size\n")
for seq_record in SeqIO.parse(fasta_file, "fasta"):
if not(seq_record):
break
open("sequence",
"w").write(">"+str(seq_record.id)+"\n"+str(seq_record.seq)+"\n")
primer_cl = Primer3Commandline(sequence="sequence")
primer_cl.explainflag = True
primer_cl.osizeopt=20
primer_cl.psizeopt=200
primer_cl.otm=65
primer_cl.maxtm=70
primer_cl.mintm=60
primer_cl.gcclamp=1 #required number of Gs or Cs at the 3' end of the
primer
primer_cl.outfile = "output.pr3"
primer_cl()
output_handle = open("output.pr3","r")
primer_record = Primer3.read(output_handle)
if len(primer_record.primers) > 0:
primer = primer_record.primers[0]
output.write("%s,%s,%s,%s,%s,%s\n" % (seq_record.id,
primer.forward_seq, primer.reverse_seq,
primer.forward_tm,primer.reverse_tm,primer.size))
else:
print "No primers found for %s" % seq_record.id
>>>
This code, when executed on a file of fasta-sequences gives and output -file
with forward and reverse primer id, sequence, tm and size separated by commas.
When I execute it with the Primer3-2.2.3 and compatible eprimer3 versions, the
field for the reverse primer sequence appears blank.
I will attach the Primer3-2.2.3 compatible eprimer3 file to this report.
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Biopython-dev
mailing list