DNA.
translate_six_frames
(*args, **kwargs)[source]¶Translate DNA into protein using six possible reading frames.
State: Stable as of 0.4.0.
DNA sequence is assumed to be the coding strand. DNA sequence is first transcribed into RNA and then translated into protein. The six possible reading frames are:
Translated sequences are yielded in this order.
Parameters: | args : tuple
kwargs : dict
|
---|---|
Yields: | Protein
|
See also
Notes
This method is faster than (and equivalent to) performing six independent translations using, for example:
(seq.translate(reading_frame=rf)
for rf in GeneticCode.reading_frames)
DNA sequence’s metadata are included in each translated protein sequence. Positional metadata are not included.
Examples
Translate DNA 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 DNA
>>> dna = DNA('ATGCCACTTTAA')
>>> for protein in dna.translate_six_frames():
... protein
... print('')
Protein
--------------------------
Stats:
length: 4
has gaps: False
has degenerates: False
has definites: True
has stops: True
--------------------------
0 MPL*
Protein
--------------------------
Stats:
length: 3
has gaps: False
has degenerates: False
has definites: True
has stops: False
--------------------------
0 CHF
Protein
--------------------------
Stats:
length: 3
has gaps: False
has degenerates: False
has definites: True
has stops: False
--------------------------
0 ATL
Protein
--------------------------
Stats:
length: 4
has gaps: False
has degenerates: False
has definites: True
has stops: False
--------------------------
0 LKWH
Protein
--------------------------
Stats:
length: 3
has gaps: False
has degenerates: False
has definites: True
has stops: True
--------------------------
0 *SG
Protein
--------------------------
Stats:
length: 3
has gaps: False
has degenerates: False
has definites: True
has stops: False
--------------------------
0 KVA