Bioinformatics (2014/2015)

Practical 1

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/lecture1/.

  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. Write a Perl program that reads a UniProt file and stores the sequence (which can be found on the lines beginning with a space character) as a string in variable '$sequence', and then writes out the sequence of the protein with one line per residue. Each line of output should contain the residue's one-letter code and the residue's position in the sequence. The name of the UniProt file should be given as an argument on the command line.

    Test your program with UniProt files P00784.uniprot (papaya proteinase I) and P00785.uniprot (kiwi fruit actinidin). These files are in directory /chalmers/users/kemp/MVE360/practical1/.

    unix> ./sp_sequence.pl P00784.uniprot
    M 1
    A 2
    M 3
    ... etc.
    unix>
    

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: 20 January 2015 by Graham Kemp