Question: python code needed Rna2codon code: def rna2codon(triplet): genetic_code = { 'UUU': 'F', 'UUC': 'F', 'UUA': 'L', 'UUG': 'L', 'CUU': 'L', 'CUC': 'L', 'CUA': 'L', 'CUG':
python code needed
Rna2codon code:
| def rna2codon(triplet): | ||
| genetic_code = { | ||
| 'UUU': 'F', 'UUC': 'F', 'UUA': 'L', 'UUG': 'L', 'CUU': 'L', 'CUC': 'L', 'CUA': 'L', 'CUG': 'L', | ||
| 'AUU': 'I', 'AUC': 'I', 'AUA': 'I', 'AUG': 'M', 'GUU': 'V', 'GUC': 'V', 'GUA': 'V', 'GUG': 'V', | ||
| 'UCU': 'S', 'UCC': 'S', 'UCA': 'S', 'UCG': 'S', 'CCU': 'P', 'CCC': 'P', 'CCA': 'P', 'CCG': 'P', | ||
| 'ACU': 'T', 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'GCU': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', | ||
| 'UAU': 'Y', 'UAC': 'Y', 'UAA': '*', 'UAG': '*', 'CAU': 'H', 'CAC': 'H', 'CAA': 'Q', 'CAG': 'Q', | ||
| 'AAU': 'N', 'AAC': 'N', 'AAA': 'K', 'AAG': 'K', 'GAU': 'D', 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', | ||
| 'UGU': 'C', 'UGC': 'C', 'UGA': '*', 'UGG': 'W', 'CGU': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', | ||
| 'AGU': 'S', 'AGC': 'S', 'AGA': 'R', 'AGG': 'R', 'GGU': 'G', 'GGC': 'G', 'GGA': 'G', 'GGG': 'G', | ||
| } | ||
| allowed_codons = set('ACGU') | ||
| if triplet in genetic_code: | ||
| x=genetic_code[triplet] | ||
| return x | ||
| else: | ||
| return "Invalid" | ||
| def rna2codons(triplets): | ||
| amino= '' | ||
| for i in range( 0,int( len(triplets) / 3 ) ): | ||
| amino= amino+ rna2codon(triplets[ 3*i:3*i+3]) | ||
| return amino | ||
| return rna2codons(triplets) |

def source_rna(protein): This function takes in a string representing a sequence of proteins and returns the total number of different source RNA strings, modulo 1,000,000. Essentially, you are calculating how many strands of mRNA from which this particular protein could have been translated. (HINT: You'll want to use/manipulate the codon table from rna2codon()!) Example: Sample input protein string: "MA" The returned number of possible source RNA sequences: 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
