[Biopython-dev] [Biopython (old issues only) - Bug #3173] (Resolved) Bio.Emboss.Primer3 parser incompatibility with Primer3 version 2.2.3

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Thu Nov 17 21:06:42 UTC 2016


Issue #3173 has been updated by Markus Piotrowski.

Description updated
Status changed from New to Resolved
% Done changed from 0 to 100

This problem seems to be outdated. I cannot reproduce it with Biopython 1.68 and EMBOSS 6.5.0.0. The output is fine and contains the reverse primer's sequence.
<pre>
name,forward_primer,reverse_primer,forward_tm,reverse_tm,product_size
Human_DMD,TAAAGGCCTGTCCCCACTGC,CTCCAGCAGCTGCCTTAGCC,64.62,64.75,196
</pre>

----------------------------------------
Bug #3173: Bio.Emboss.Primer3 parser incompatibility with Primer3 version 2.2.3
https://redmine.open-bio.org/issues/3173#change-15382

* Author: Jukka-Pekka Verta
* Status: Resolved
* Priority: Normal
* Assignee: Biopython Dev Mailing List
* Category: Other
* Target version: 1.55
* URL: 
----------------------------------------
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.

---Files--------------------------------
eprimer3.c (39.1 KB)
output.pr3 (new version) (1.09 KB)
output.pr3 (old version) (1.4 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython-dev/attachments/20161117/fa1244d6/attachment.html>


More information about the Biopython-dev mailing list