Created
January 10, 2020 09:07
-
-
Save juanfal/09d7fb53bd367742127e17284b9c47bf to your computer and use it in GitHub Desktop.
Codon table in Python dict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codontab = { | |
'TCA': 'S', # Serina | |
'TCC': 'S', # Serina | |
'TCG': 'S', # Serina | |
'TCT': 'S', # Serina | |
'TTC': 'F', # Fenilalanina | |
'TTT': 'F', # Fenilalanina | |
'TTA': 'L', # Leucina | |
'TTG': 'L', # Leucina | |
'TAC': 'Y', # Tirosina | |
'TAT': 'Y', # Tirosina | |
'TAA': '*', # Stop | |
'TAG': '*', # Stop | |
'TGC': 'C', # Cisteina | |
'TGT': 'C', # Cisteina | |
'TGA': '*', # Stop | |
'TGG': 'W', # Triptofano | |
'CTA': 'L', # Leucina | |
'CTC': 'L', # Leucina | |
'CTG': 'L', # Leucina | |
'CTT': 'L', # Leucina | |
'CCA': 'P', # Prolina | |
'CCC': 'P', # Prolina | |
'CCG': 'P', # Prolina | |
'CCT': 'P', # Prolina | |
'CAC': 'H', # Histidina | |
'CAT': 'H', # Histidina | |
'CAA': 'Q', # Glutamina | |
'CAG': 'Q', # Glutamina | |
'CGA': 'R', # Arginina | |
'CGC': 'R', # Arginina | |
'CGG': 'R', # Arginina | |
'CGT': 'R', # Arginina | |
'ATA': 'I', # Isoleucina | |
'ATC': 'I', # Isoleucina | |
'ATT': 'I', # Isoleucina | |
'ATG': 'M', # Methionina | |
'ACA': 'T', # Treonina | |
'ACC': 'T', # Treonina | |
'ACG': 'T', # Treonina | |
'ACT': 'T', # Treonina | |
'AAC': 'N', # Asparagina | |
'AAT': 'N', # Asparagina | |
'AAA': 'K', # Lisina | |
'AAG': 'K', # Lisina | |
'AGC': 'S', # Serina | |
'AGT': 'S', # Serina | |
'AGA': 'R', # Arginina | |
'AGG': 'R', # Arginina | |
'GTA': 'V', # Valina | |
'GTC': 'V', # Valina | |
'GTG': 'V', # Valina | |
'GTT': 'V', # Valina | |
'GCA': 'A', # Alanina | |
'GCC': 'A', # Alanina | |
'GCG': 'A', # Alanina | |
'GCT': 'A', # Alanina | |
'GAC': 'D', # Acido Aspartico | |
'GAT': 'D', # Acido Aspartico | |
'GAA': 'E', # Acido Glutamico | |
'GAG': 'E', # Acido Glutamico | |
'GGA': 'G', # Glicina | |
'GGC': 'G', # Glicina | |
'GGG': 'G', # Glicina | |
'GGT': 'G' # Glicina | |
} |
Interesting, not only the defaultdict constructor, but the form to link a list of codons to every aa. It also could be done without resorting to that python library. In fact it returns some noise:
defaultdict(<class 'list'>, {'S': ['TCA',..
with:
aminotab = {}
for codon, aa in codontab.items():
if aa in aminotab:
aminotab[aa].append(codon)
else:
aminotab[aa] = [codon]
print(aminotab)
wich I suspect is faster, more independent (and easier to remember) and doesn't yield artefacts.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And the reverse table mapping amino acids to a list of codons
The contents of the amino table