RNA.
translate
(genetic_code=1, *args, **kwargs)[source]¶Translate RNA sequence into protein sequence.
State: Stable as of 0.4.0.
Parameters: |
|
---|---|
Returns: | Translated sequence. |
Return type: |
Notes
RNA sequence’s metadata are included in the translated protein sequence. Positional metadata are not included.
Examples
Translate RNA into protein using NCBI’s standard genetic code (table ID 1, the default genetic code in scikit-bio):
>>> from skbio import RNA
>>> rna = RNA('AUGCCACUUUAA')
>>> rna.translate()
Protein
--------------------------
Stats:
length: 4
has gaps: False
has degenerates: False
has definites: True
has stops: True
--------------------------
0 MPL*
Translate the same RNA sequence using a different NCBI genetic code (table ID 3, the yeast mitochondrial code) and specify that translation must terminate at the first stop codon:
>>> rna.translate(3, stop='require')
Protein
--------------------------
Stats:
length: 3
has gaps: False
has degenerates: False
has definites: True
has stops: False
--------------------------
0 MPT