GeneticCode.
translate_six_frames
(sequence, start='ignore', stop='ignore')[source]¶Translate RNA into protein using six possible reading frames.
State: Stable as of 0.4.0.
The six possible reading frames are:
Translated sequences are yielded in this order.
Parameters: |
|
---|---|
Yields: | Protein – Translated sequence in the current reading frame. |
See also
Notes
This method is faster than (and equivalent to) performing six independent translations using, for example:
(gc.translate(seq, reading_frame=rf)
for rf in GeneticCode.reading_frames)
Input RNA sequence metadata are included in each translated protein sequence. Positional metadata are not included.
Examples
Translate RNA into protein using the six possible reading frames and NCBI’s standard genetic code (table ID 1, the default genetic code in scikit-bio):
>>> from skbio import RNA, GeneticCode
>>> rna = RNA('AUGCCACUUUAA')
>>> sgc = GeneticCode.from_ncbi()
>>> for protein in sgc.translate_six_frames(rna):
... protein
... print('')
Protein
--------------------------
Stats:
length: 4
has gaps: False
has degenerates: False
has definites: True
has stops: True
--------------------------
0 MPL*
<BLANKLINE>
Protein
--------------------------
Stats:
length: 3
has gaps: False
has degenerates: False
has definites: True
has stops: False
--------------------------
0 CHF
<BLANKLINE>
Protein
--------------------------
Stats:
length: 3
has gaps: False
has degenerates: False
has definites: True
has stops: False
--------------------------
0 ATL
<BLANKLINE>
Protein
--------------------------
Stats:
length: 4
has gaps: False
has degenerates: False
has definites: True
has stops: False
--------------------------
0 LKWH
<BLANKLINE>
Protein
--------------------------
Stats:
length: 3
has gaps: False
has degenerates: False
has definites: True
has stops: True
--------------------------
0 *SG
<BLANKLINE>
Protein
--------------------------
Stats:
length: 3
has gaps: False
has degenerates: False
has definites: True
has stops: False
--------------------------
0 KVA
<BLANKLINE>