translate
Translate a DNA pool into a protein pool using the standard genetic code.
Pass region= to translate only a named ORF segment; include_stop=False
omits the trailing stop codon from the output.
import poolparty as pp
pp.init()
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
DNA pool or plain sequence string to translate. |
|
|
|
Region name (from |
|
|
|
Reading frame ( |
|
|
|
When |
|
|
|
If |
|
|
|
Built-in code name or a custom codon table mapping. |
|
|
|
Iteration priority for downstream multi-pool iteration. |
|
|
|
Prefix for sequence names in the resulting pool. |
Note
Only the most commonly used parameters are shown above. For the full
parameter list, see translate() in the
API Reference.
Examples
Translate a 5-codon CDS
Translate the 15-nucleotide sequence ATGAAATTTGGGCCC to the 5-residue
peptide M-K-F-G-P.
import poolparty as pp
pp.init()
cds = pp.from_seq("ATGAAATTTGGGCCC")
protein = pp.translate(cds)
protein.print_library()
Translate a mutagenized CDS pool
Chain mutagenize_orf with translate. With mode="random", each
draw applies one random codon mutation; the protein pool is the translation
of that sampled CDS.
import poolparty as pp
pp.init()
cds = pp.from_seq("ATGAAATTTGGGCCC")
mutants = pp.mutagenize_orf(cds, num_mutations=1, mode="random")
protein = pp.translate(mutants)
protein.print_library()
Translate only the ORF region within a longer sequence
When the CDS is embedded in flanking UTR context, tag it with
annotate_orf and pass the region name to translate so only the
annotated ORF is translated.
import poolparty as pp
pp.init()
seq = pp.from_seq("TATAATGAAATTTGGGCCCTAA")
seq = pp.annotate_orf(seq, "gene", extent=(4, 19))
prot = pp.translate(seq, region="gene", include_stop=False)
prot.print_library()
See translate().