|
"input": "gc = {'CTT': 'L', 'ACA': 'T', 'ACG': 'T', 'ATC': 'I', 'AAC': 'N',\n 'ATA': 'I', 'AGG': 'R', 'CCT': 'P', 'ACT': 'T', 'AGC': 'S', 'AAG': 'K',\n 'AGA': 'R', 'CAT': 'H', 'AAT': 'N', 'ATT': 'I', 'CTG': 'L', 'CTA': 'L',\n 'CTC': 'L', 'CAC': 'H', 'AAA': 'K', 'CCG': 'P', 'AGT': 'S', 'CCA': 'P',\n 'CAA': 'Q', 'CCC': 'P', 'TAT': 'Y', 'GGT': 'G', 'TGT': 'C', 'CGA': 'R',\n 'CAG': 'Q', 'TCT': 'S', 'GAT': 'D', 'CGG': 'R', 'TTT': 'F', 'TGC': 'C',\n 'GGG': 'G', 'GGA': 'G', 'TGG': 'W', 'GGC': 'G', 'TAC': 'Y',\n 'TTC': 'F', 'TCG': 'S', 'TTA': 'L', 'TTG': 'L', 'TCC': 'S', 'ACC': 'T',\n 'GCA': 'A', 'GTA': 'V', 'GCC': 'A', 'GTC': 'V', 'GCG': 'A','TAA': '*',\n 'GTG': 'V', 'GAG': 'E', 'GTT': 'V', 'GCT': 'A', 'GAC': 'D', 'CGT': 'R',\n 'GAA': 'E', 'TCA': 'S', 'ATG': 'M', 'CGC': 'R', 'TAG': '*', 'TGA': '*'}\n\n# the following would have been obtained from the user, rather than input directly\nrna_seq = \"ACCGTCGGATTACCGAAGGAA\"\n\nrna_seq_comp = rna_seq\nrna_seq_comp = rna_seq_comp.replace(\"T\",'a')\nrna_seq_comp = rna_seq_comp.replace(\"A\",'t')\nrna_seq_comp = rna_seq_comp.replace(\"G\",'c')\nrna_seq_comp = rna_seq_comp.replace(\"C\",'g')\nrna_seq_comp = rna_seq_comp.upper()\n\nprotein_seq = \"\"\nfor e in range(0,len(rna_seq),3):\n codon = rna_seq[e] + rna_seq[e+1] + rna_seq[e+2]\n aa = gc[codon]\n protein_seq = protein_seq + aa\n\nprint \"Forward orientation:\"\nprint protein_seq\n\nprotein_seq_comp = \"\"\nfor e in range(0,len(rna_seq_comp),3):\n codon = rna_seq_comp[e] + rna_seq_comp[e+1] + rna_seq_comp[e+2]\n aa = gc[codon]\n protein_seq_comp = protein_seq_comp + aa \n\nprint \"Forward complement orientation:\"\nprint protein_seq_comp", |