Concept

Translation

Translating the messenger rna into a protein sequence :

messenger_rna = Seq("AUGGCCAUUGUAAUGGUAG") messenger_rna.translate() print(messenger_rna.translate())

Translating from the DNA coding sequence :

coding_dna = Seq("ATGGCCATTGTAATGGTAG") coding_dna.translate() print(coding_dna.translate())

When dealing with different types of sequences, the specific translation table can be specified :

coding_dna.translate(table="Vertebrate Mitochondrial") print (coding_dna.translate(table="Vertebrate Mitochondrial"))

You can also stop translating when it gets to the first in frame stop codon :

coding_dna2 = Seq("ATGGCCATTGTAATGGGCCGCTGAAAGGGTGCCCGATAG") translate_2 = coding_dna2.translate(to_stop = True) print(translate_2)

When printed, the result will be :

MAIVMV MAIVMV MAIVMV MAIVMGR

0

1

Updated 2021-08-24

Tags

Python Programming Language

Data Science

Related