''' Jon Beck translate.py A program to read a mRNA sequence from a fasta file, pre-process it by removing the start codon, translate it according to the standard genetic code, and print the resulting amino acid sequence to the screen. This program assumes the sequence in the fasta file appears 5' to 3'. ''' from rna2aa import rna2aa from readfasta import readfasta def main(): # read in the rna from disk # we assume there is exactly one sequence in the fasta file rnainfo = readfasta('maizefragment.fasta') rnasequence = rnainfo[0][2] # remove the start codon rnasequence = rnasequence[3:] # we now assume that rnasequence contains a stop codon an exact multiple # of 3 nucleotides from the beginning # translate it aasequence = rna2aa(rnasequence) # print the results print('The resulting amino acid sequence is:') print(aasequence) main()