DNA sequencing.
3-letter sequences encode amino acids in DNA. For example, TTT is phenylalanine and TTA is leucine. This program reads a DNA sequence stored in a file and outputs the number of a particular amino acid in the sequence requested by the user. E.g. in the sequence: ACGTTTGTATTT the sequence TTT appears twice.
Write a program that asks the user to enter three characters and outputs how many times that sequence of characters appears in a file.
Use this boilerplate code as a starting point:
Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.
`dna.txt` file:
ACAAGATGCCATTGTCCCCCGGCCTCCTGCTGCTGCTGCTCTCCGGGGCCACGGCCACCGCTGCCCTGC
CCTGGAGGGTGGCCCCACCGGCCGAGACAGCGAGCATATGCAGGAAGCGGCAGGAATAAGGAAAAGCGG
CTCCTGACTTTCCTCGCTTGGTGGTTTGAGTGGACCTCCCAGGCCAGTGCCGGGCCCCTCATAGGAGAG
Enter the amino acid to find: CCC
There are 4 CCC amino acids in the DNA sequence.
Enter the amino acid to find: GGT
There are 0 GGT amino acids in the DNA sequence.
Enter the amino acid to find: GGG
There are 3 GGG amino acids in the DNA sequence.
Use these resources as a reference to help you meet the success criteria.
Run the unit tests below to check that your program has met the success criteria.
Enter the amino acid to find: AAC
There are 0 AAC amino acids in the DNA sequence.
Enter the amino acid to find: AGF
Enter the amino acid to find: TAA
There are 0 TAA amino acids in the DNA sequence.
Enter the amino acid to find: CAC
There are 1 CAC amino acids in the DNA sequence.
Enter the amino acid to find: CCC
There are 4 CCC amino acids in the DNA sequence.
Enter the amino acid to find: GAG
There are 2 GAG amino acids in the DNA sequence.
Enter the amino acid to find: GCC
There are 3 GCC amino acids in the DNA sequence.
Check that you have: