1. Engineering
  2. Computer Science
  3. 2 7 points the following questions refer to the perl...

Question: 2 7 points the following questions refer to the perl...

Question details

2. (7 points) The following questions refer to the Perl program, chap01a.pl, shown on page 18 in the textbook, for Case Study 1.1 Translation of a DNA sequence to an amino acid sequence using the standard genetic code. Read the Perl program, and try to understand what each statement in the program does. You may also search the Web for documentation about the unpack() function (e.g., type Perl unpack for a Google search). Then, answer the following questions 2a (2 points) The current program takes an input nucleotide sequence in lowercase letters (e.g atgcatccc). Describe how to modify the code so that it can also take an input nucleotide sequence in uppercase letters (e.g., ATGCATCCC). 2b (2 points) The program uses the while loop to read all the lines of input data (appearing after END through the predefined DATA stream. Explain the condition in which the while loop terminates. What is the value of Sline when the while loop terminates? 2c (1 point) The Perl program uses the function chop), instead of chomp0, to remove a newline character that may be present at the end of the input line. In your opinion, is it a good programming practice to use chopO for this purpose? Why or why not? No. O o is better 2d (2 points) A user-defined filehandle is often preferred over the predefined DATA stream for data input. Describe how to modify the Perl program so that it can input data from the file named input file.txt and output results to the file named output file.txt.
1 Translation of a DNA sequence to an amino acid se CASE STUDY 1. using the standard genetic code # /usr/bin/perl stranelate.pl translate nucleic aeld sequence to protein sequence according to standard genetie code # set up table of standard genetie code Istandardgeneticcode Trp cgaArg An.agc- atc>Ile.acc Thr aac> t process input data while (şline <DATA) read in line of input # transcribe to output print $line: remove # end-of-line etriplets . unpack (a3 x (length (Sine) /3). foreach scodon (atriplets) ( character 11 out successive triplets $1ine); pu # loop over triplets # print out translation of each # end loop on triplets # skip line on output # end loop on input lines print $standardgeneticcode($codon) print Inn # what follows is input data END atgcatccctttaat tetgtetga Running this program on the given input data produces the output atgcatccctttaat MetHisPropheAsn tctgtctga SerValTER
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution