BjornFJohansson / pydna

Clone with Python! Data structures for double stranded DNA & simulation of homologous recombination, Gibson assembly, cut & paste cloning.
Other
166 stars 45 forks source link

Minimal primer design error #64

Closed mcrone closed 4 years ago

mcrone commented 4 years ago

Expected behaviour: generate primer set for sequence record Actual behaviour:

--> 908     if left_tmm in tmm_table:
    909         delta_h += tmm_table[left_tmm][d_h]
    910         delta_s += tmm_table[left_tmm][d_s]

TypeError: argument of type 'NoneType' is not iterable

Version of pydna: pydna-3.0.2

Code:

from pydna.design import primer_design
from pydna.dseqrecord import Dseqrecord

dssequence = Dseqrecord("atgactgctaacccttccttggtgttgaacaagatcgacgacatttcgttcgaaacttacgatg")
print(dssequence)
ampl = primer_design(dssequence)
print(ampl.forward_primer)

Output:

Dseqrecord
circular: False
size: 64
ID: id
Name: name
Description: description
Number of features: 0
Dseq(-64)
atga..gatg
tact..ctac
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
 in 
      4 dssequence = Dseqrecord("atgactgctaacccttccttggtgttgaacaagatcgacgacatttcgttcgaaacttacgatg")
      5 print(dssequence)
----> 6 ampl = primer_design(dssequence)
      7 print(ampl.forward_primer)

/usr/local/lib/python3.7/site-packages/pydna/design.py in primer_design(template, fp, rp, limit, target_tm, tm_func, **kwargs)
    156     elif not fp and not rp:
    157         _module_logger.debug("no primer given, design forward primer:")
--> 158         fp = _Primer((design(target_tm, template)))
    159         target_tm = tm_func(str(fp.seq))
    160         _module_logger.debug("no primer given, design reverse primer:")

/usr/local/lib/python3.7/site-packages/pydna/design.py in design(target_tm, template)
    138             length+=1
    139             p = str(template.seq[:length])
--> 140             tmp = tm_func(p)
    141         ps = p[:-1]
    142         tmps = tm_func(str(ps))

/usr/local/lib/python3.7/site-packages/pydna/tm.py in tm_default(seq, check, strict, c_seq, shift, nn_table, tmm_table, imm_table, de_table, dnac1, dnac2, selfcomp, Na, K, Tris, Mg, dNTPs, saltcorr, func)
     52                 Mg=Mg,
     53                 dNTPs=dNTPs,
---> 54                 saltcorr=saltcorr)
     55 
     56 

/usr/local/lib/python3.7/site-packages/Bio/SeqUtils/MeltingTemp.py in Tm_NN(seq, check, strict, c_seq, shift, nn_table, tmm_table, imm_table, de_table, dnac1, dnac2, selfcomp, Na, K, Tris, Mg, dNTPs, saltcorr)
    906     # Now for terminal mismatches
    907     left_tmm = tmp_cseq[:2][::-1] + '/' + tmp_seq[:2][::-1]
--> 908     if left_tmm in tmm_table:
    909         delta_h += tmm_table[left_tmm][d_h]
    910         delta_s += tmm_table[left_tmm][d_s]

TypeError: argument of type 'NoneType' is not iterable
mcrone commented 4 years ago

Installed new Biopython and this solved the issue. (1.72->1.76)