Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Proteins and DNA are the basic building blocks of life. A protein is a sequence of amino acids of which there are 2 0 different
Proteins and DNA are the basic building blocks of life. A protein is a sequence of
amino acids of which there are different kinds. DNA is made up of nucleic
acids. There are four nucleic acids, abbreviated with the letters A C G and T A
sequence of three nucleic acids make up a codon eg AAT, GCT TAC Each
codon corresponds to one of the twenty amino acids.
You are to write a program called TranslateCodons.java put into the package
ds that does the following:
Read in the file datacodontoletteraa.txt already provided which specifies
the mapping from DNA codons to the amino acids. Using one of the symbol
table implementations in algs build a symbol table where the key is a
threeletter codon made up of the letters A C G or T and the value is the
threeletter abbreviation for an amino acid for example, "Ala", "Leu" For
example, the codon "TTA" should have the value "Leu", the codon "TAA"
should have the value Stp
Read in another file datasmallsequencestxt where each line consists of a
species name which may include spaces a tab character, and a DNA
sequence whose length is a multiple of For each line read in print four
lines:
the species name
the DNA sequence broken into threeletter groups ie codons
separated by whitespaces
the threeletter amino acid codes corresponding to the codons in the
DNA sequence separated by whitespaces
a blank line
For example, if the input line is:
Ailuropoda melanoleuca ATGTTCATTAACCGATGACTGTTTTCCACCAAA
your program should print:
Ailuropoda melanoleuca
ATG TTC ATT AAC CGA TGA CTG TTT TCC ACC AAA
Met Phe Ile Asn Arg Stp Leu Phe Ser Thr Lys
Notice that it is okay to have a trailing whitespace in the second and third line
that you print out.
Reading input from file
The names for the files that you read from should be specified as two separate
arguments from the command line, where the first argument points to the
location of the file codontoletteraa.txt and the second argument points to the
location of the file containing the species names and DNA sequences. For
example, one may run your program as follows:
java dsTranslateCodons datacodontoletteraa.txt
datasmallsequencestxt
This means that in your java code, the first filepath is stored in the variable
args and the second filepath is stored in the variable args You should
create two different objects of AlgsIn for reading the two files.
Do not hardcode the file path in your codes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started