Skip to content

Instantly share code, notes, and snippets.

View shrividhatri's full-sized avatar

Shri Vidhatri shrividhatri

View GitHub Profile
# Read the file and get the RNA string
file = open('sample_rna.txt', 'r')
rna = file.read()
print "RNA String: ", rna
# RNA codon table
rna_codon = {"UUU" : "F", "CUU" : "L", "AUU" : "I", "GUU" : "V",
"UUC" : "F", "CUC" : "L", "AUC" : "I", "GUC" : "V",
"UUA" : "L", "CUA" : "L", "AUA" : "I", "GUA" : "V",
# Read the file and get the DNA string
file = open('sample_dna.txt', 'r')
dna = file.read()
print "DNA: ", dna
rna = ""
# Generate the RNA string
for i in dna:
# Replace all occurrences of T with U