pydna.amplify
This module provide the Anneal
class and the pcr()
function
for PCR simulation. The pcr function is simpler to use, but expects only one
PCR product. The Anneal class should be used if more flexibility is required.
Primers with 5’ tails as well as inverse PCR on circular templates are handled correctly.
- class pydna.amplify.Anneal(primers, template, limit=13, **kwargs)[source]
Bases:
object
The Anneal class has the following important attributes:
- template
A copy of the template argument. Primers annealing sites has been added as features that can be visualized in a seqence editor such as ApE.
- Type:
- property products
- report()
returns a short report describing if or where primer anneal on the template.
- pydna.amplify.pcr(*args, **kwargs) Amplicon [source]
pcr is a convenience function for the Anneal class to simplify its usage, especially from the command line. If more than one or no PCR product is formed, a ValueError is raised.
args is any iterable of Dseqrecords or an iterable of iterables of Dseqrecords. args will be greedily flattened.
- Parameters:
args (iterable containing sequence objects) – Several arguments are also accepted.
limit (int = 13, optional) – limit length of the annealing part of the primers.
Notes
sequences in args could be of type:
string
Seq
SeqRecord (or subclass)
Dseqrecord (or sublcass)
The last sequence will be assumed to be the template while all preceeding sequences will be assumed to be primers.
This is a powerful function, use with care!
- Returns:
product – An
pydna.amplicon.Amplicon
object representing the PCR product. The direction of the PCR product will be the same as for the template sequence.- Return type:
Examples
>>> from pydna.dseqrecord import Dseqrecord >>> from pydna.readers import read >>> from pydna.amplify import pcr >>> from pydna.primer import Primer >>> template = Dseqrecord("tacactcaccgtctatcattatctactatcgactgtatcatctgatagcac") >>> from Bio.SeqRecord import SeqRecord >>> p1 = Primer("tacactcaccgtctatcattatc") >>> p2 = Primer("cgactgtatcatctgatagcac").reverse_complement() >>> pcr(p1, p2, template) Amplicon(51) >>> pcr([p1, p2], template) Amplicon(51) >>> pcr((p1,p2,), template) Amplicon(51) >>>