Wednesday 20 September 2017

The Idea of DNA translation to Amino Acid Sequence

Python 3 provides a powerful yet easy to use tool to translate DNA sequences to amino acid sequences. below is one of the methods that one can use to translate a DNA sequence to amino-acid sequences:

note: codons are triplets of nucleotides that correspond to amino acids [except for stop codons]
one can find codon tables on-line : LINK
below is an example of 3 codons that code for different amino acids:

ATG codes for Methionine [Met] 

GTT codes for Valine [Val]
GCG codes for Alanine [Ala] 

So, the idea is that, the user enters a DNA sequence and you would like to see if there is occurrences of any of the three codons above. Once your software encounters anyone of them, directly changes it to the corresponding amino acid.

Example of User entry: "ATGGTTGCG"

In Python 3 IDLE, type the following commands:


>>> DNA = "ATGGTTGCG" # this is a variable that holds user entry
>>> Triplets = ([DNA[start:start+3] for start in range(0,len(DNA),3)]) # a command that changes user entry into arranged codons from codon position one.
>>> for i in Triplets: print(i, end = ',') # press enter, twice to see your codons.
ATG,GTT,GCG,   

>>> for i in Triplets: # a for loop to iterate through the previous variable i.e Triplets
    if (i == "ATG"): print("MET", end = ',')
    elif (i == "GTT"): print("Val", end = ',')
    elif (i == "GCG"): print("Ala", end = ',') # press enter, twice
   
MET,Val,Ala,






___________________________________________________________________________

was this helpful, somehow ??
 

Project Genetic Analysis Toolpack (GAT V1.0)

The name GAT stands for Genetic Analysis Toolpack and we are aiming to make it a useful molecular data analysis tool, and more importantly...