Skip to content

Instantly share code, notes, and snippets.

@Visgean
Created November 17, 2016 18:35
Show Gist options
  • Save Visgean/9e7d50d8ab5e53f777f8a9e079b08462 to your computer and use it in GitHub Desktop.
Save Visgean/9e7d50d8ab5e53f777f8a9e079b08462 to your computer and use it in GitHub Desktop.
# dictionnary with standard genetic code in form of 'codon':'aminoacid'
protein_seq = {
'TTT':'F','TTC':'F','TTA':'L','TTG':'L','CTT':'L','CTC':'L','CTA':'L','CTG':'L','ATT':'I','ATC':'I','ATA':'I','ATG':'M','GTT':'V','GTC':'V','GTA':'V','GTG':'V','TCT':'S','TCA':'S','TCG':'S','TCC':'S',
'CCT':'P','CCA':'P','CCG':'P','CCC':'P','ACT':'T','ACC':'T','ACG':'T','ACA':'T','GCT':'A','GCA':'A','GCG':'A','GCC':'A',
'TAT':'Y','TAC':'Y','TAA':'STOP','TAG':'STOP','CAT':'H','CAC':'H','CAA':'Q','CAG':'Q','AAT':'N','AAC':'N','AAA':'K','AAG':'K',
'GAT':'D','GAC':'D','GAA':'E','GAG':'E','TGT':'C','TGC':'C','TGA':'STOP','TGG':'W','CGT':'R','CGA':'R','CGG':'R','CGC':'R',
'AGA':'R','AGG':'R','AGT':'S','AGC':'S','GGT':'G','GGA':'G','GGC':'G','GGG':'G'
}
def protein_translation:
"This function translates DNA into proteins" #define the function necessary for the translation
with open ("cDNA_sequences.csv","r") as dna:
for line in dna:
name, seq = line.rstrip("\n").split(",") #remove end of line character and split at the commas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment