From f0e05905cf2007e27a1f0eb9d9cb0b3a2ebb1daa Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 22:52:44 +0000 Subject: [PATCH] sweep: Create src/utils/codonMapping.js --- src/utils/codonMapping.js | 93 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 src/utils/codonMapping.js diff --git a/src/utils/codonMapping.js b/src/utils/codonMapping.js new file mode 100644 index 0000000..f622374 --- /dev/null +++ b/src/utils/codonMapping.js @@ -0,0 +1,93 @@ +const codonToAminoAcid = (codon) => { + switch (codon) { + case "TTT": + case "TTC": + return "F"; + case "TTA": + case "TTG": + case "CTT": + case "CTC": + case "CTA": + case "CTG": + return "L"; + case "ATT": + case "ATC": + case "ATA": + return "I"; + case "ATG": + return "M"; + case "GTT": + case "GTC": + case "GTA": + case "GTG": + return "V"; + case "TCT": + case "TCC": + case "TCA": + case "TCG": + case "AGT": + case "AGC": + return "S"; + case "CCT": + case "CCC": + case "CCA": + case "CCG": + return "P"; + case "ACT": + case "ACC": + case "ACA": + case "ACG": + return "T"; + case "GCT": + case "GCC": + case "GCA": + case "GCG": + return "A"; + case "TAT": + case "TAC": + return "Y"; + case "TAA": + case "TAG": + case "TGA": + return "*"; + case "CAT": + case "CAC": + return "H"; + case "CAA": + case "CAG": + return "Q"; + case "AAT": + case "AAC": + return "N"; + case "AAA": + case "AAG": + return "K"; + case "GAT": + case "GAC": + return "D"; + case "GAA": + case "GAG": + return "E"; + case "TGT": + case "TGC": + return "C"; + case "TGG": + return "W"; + case "CGT": + case "CGC": + case "CGA": + case "CGG": + case "AGA": + case "AGG": + return "R"; + case "GGT": + case "GGC": + case "GGA": + case "GGG": + return "G"; + default: + return "X"; + } +}; + +export default codonToAminoAcid; \ No newline at end of file