Bioinformatics (2012/2013)

Practical 2

Perl (1)

Aims

Objectives

After this practical you will:

Exercises

  1. Try out some of the scripts from the lectures. Some of these are in directory /chalmers/users/kemp/MVE360/lecture2/.

  2. This question refers to the program countdown.pl from the lecture.

    1. Copy the program countdown.pl and modify it so that it counts down from a number entered by the user in response to a prompt, e.g.

      unix> ./countdown_a.pl
      Type in a number: 3
      3...
      2...
      1...
      BOOM!
      unix>
      
    2. Copy your solution for part (a) and modify it so that it uses a "for" loop instead of a "while" loop.

    3. Copy your solution for part (b) and modify it so that it counts down from a number given as a command line argument.

      unix> ./countdown_c.pl 3
      3...
      2...
      1...
      BOOM!
      unix>
      
  3. In an alanine scan experiment, each residue in a peptide is mutated to alanine (one letter code 'A') in turn, and the resulting peptides are tested to identify which of the original peptide's residues are necessary for the peptide's biological function.

    For example, in an alanine scan of the peptide with sequence LFEIFEIER, ten new peptides are constructed, and these have the following sequences:

    AFEIFEIER
    LAEIFEIER
    LFAIFEIER
    LFEAFEIER
    LFEIAEIER
    LFEIFAIER
    LFEIFEAER
    LFEIFEIAR
    LFEIFEIEA
    

    Write a Perl program that writes out all of the peptide sequences that are constructed in an alanine scan experiment of the original sequence that is in string $s (this could be the sequence "LFEIFEIER" as in the example above, or it could be any other sequence, e.g. "DIPPPRPPKPHP").

  4. Rewrite the dotplot program from Practical 1 in Perl.

What to demonstrate or hand in

Demonstrate your solutions to exercise 3 and 4.

Ensure that your names are included in a comment in your program.


Last Modified: 24 January 2013 by Graham Kemp