Please solve only one exercise!

You must solve these exercises by using arrays
  1. Given the amino acid sequence of a polypeptide - Phe, Val, Asn, Gln, His, Leu, Cys, Gly, Ser - perform the following tasks with a Perl program:
    1. Define an array that contains the amino acids in the right order (use the three letters annotation, as above). Print it in one line (without a foreach loop).
    2. Determine the number of amino acids in the polypeptide and print it.
    3. Add the amino acid "His" to the end of the polypeptide (use the "push" function). Print the resulting array in one line (without a foreach loop).
    4. Create a "mutation": replace "Gly" with "Asp". Print the resulting array.
    5. Ask the user to enter a number between 1 and the number of amino acids in the polypeptide, and print the amino acid in that position (e.g. if the user enters "4" the program should print "Gln".)
    6. Create an inversion: get two positions in the sequence from the user and invert the sequence of the amino acids between them. For example, if the user enters 3 and then 6, the program should replace Asn, Gln, His, Leu with Leu, His, Gln, Asn. (Using "array slices" and the "reverse" function). Print the result.
    7. Create a string that will contain the amino acid sequence of the resulting polypeptide, in the format Phe-Val-Asn... (use string concatenation inside a foreach loop. Make sure not to leave a "-" before the first amino acid or after the last one). Print that string.


  2. Activity of a certain enzyme was measured in extracts from brain, heart and lung. In each tissue, the activity was measured several times, giving the following results (in arbitrary units):

    brain: 65, 69, 70, 63, 70, 68.
    heart: 102, 95, 98, 110.
    lung: 112, 115, 113, 109, 95, 98, 100.

    Write a program that calculates and prints the following information for each of the tissues:
    -number of measurments
    -average enzyme activity
    -standard deviation

    Use the following formulas (n is the number of measurments):

    Standard deviation:

    For example, values for enzyme activity in the brain are calculated as the following:

    Number of measurments:
    Standard deviation:


Course home page.