Example #1
0
 def gc(self):
     '''Returns GC content'''
     return round(_GC(str(self.seq)), 1)
Example #2
0
    def program(self):

        r'''Returns a string containing a text representation of a proposed
       PCR program using Taq or similar polymerase.

       ::

        Taq (rate 30 nt/s)
        Three-step|         30 cycles     |      |Tm formula: Biopython Tm_NN
        94.0°C    |94.0°C                 |      |SaltC 50mM
        __________|_____          72.0°C  |72.0°C|
        04min00s  |30s  \         ________|______|
                  |      \ 46.0°C/ 0min 1s|10min |
                  |       \_____/         |      |
                  |         30s           |      |4-8°C

       '''


        # Primer melting temperatures are calculated with the Tm_NN formula from
        # biopython
        # simple salt concentration correction is used and the template concentration
        # is ignored. dnac1 = primer concentration
        
        tmf = _Tm_NN(str(self.forward_primer.footprint),
                     dnac1=self.fprimerc,
                     Na=self.saltc)
        tmr = _Tm_NN(str(self.reverse_primer.footprint),
                     dnac1=self.fprimerc,
                     Na=self.saltc)

        # Ta calculation according to
        # Rychlik, Spencer, and Rhoads, 1990, Optimization of the anneal
        # ing temperature for DNA amplification in vitro
        # http://www.ncbi.nlm.nih.gov/pubmed/2243783
        # The formula described uses the length and GC content of the product and
        # salt concentration (monovalent cations).

        #GC_prod=GC(str(self.seq))

        tmp = 81.5 + 0.41*_GC(str(self.seq)) + 16.6*_math.log10(self.saltc/1000.0) - 675/len(self)
        tml = min(tmf,tmr)
        ta = 0.3*tml+0.7*tmp-14.9

        # Taq polymerase extension rate is set to 30 nt/s
        # see https://www.thermofisher.com/pt/en/home/life-science/pcr/pcr-enzymes-master-mixes/taq-dna-polymerase-enzymes/taq-dna-polymerase.html
        taq_extension_rate = 30  # seconds/kB PCR product length
        extension_time_taq = int(round(taq_extension_rate * len(self) / 1000)) # seconds
        f  = _textwrap.dedent(r'''
                              Taq ({rate} nt/s) 35 cycles             
                              |  95.0°C |95.0°C                 |      |tm:
                              |_________|_____          72.0°C  |72.0°C|Salt {saltc:2} mM
                              | 03min00s|30s  \         ________|______|fp {forward_primer_concentration:3} µM
                              |         |      \ {ta}°C/{0:2}min{1:2}s| 5min |rp {reverse_primer_concentration:3} µM
                              |         |       \_____/         |      |GC {GC_prod}%
                              |         |         30s           |      |{size} bp'''[1:].format(rate=taq_extension_rate,
                                                                                             forward_primer_concentration=self.fprimerc/1000,
                                                                                             reverse_primer_concentration=self.rprimerc/1000,
                                                                                             ta=round(ta,1),
                                                                                             saltc=self.saltc,
                                                                                             *divmod(extension_time_taq,60),
                                                                                             size= len(self.seq),
                                                                                             GC_prod= int(self.gc()) ))
        return _pretty_str(f)
Example #3
0
 def gc(self):
     """Return GC content."""
     return round(_GC(str(self.seq)) / 100.0, 3)
Example #4
0
 def gc(self):
     """Returns GC content"""
     return round(_GC(str(self.seq)), 1)