Hints

Variations around the Needleman and Wunsch Algorithm (Perl)




1 Install and run this Perl implementation of the Needleman and Wunsch algorithm [nw] in order to align these two sequences: A and B. Examine the code to figure out how the sequences should be provided to the program
  1. Save the file in your working directory
  2. Set the file as an executable:
    chmod u+x nw.pl
  3. Save the sequence files
2 What is the cost for a substitution? an Indel?. Modify the scoring scheme so that the program produces this alignment:
          THEBIGCAT
THER---AT
The cost for two indels should be lower than the cost for a mismatch. Adjust the costs accordingly
3 Modify the code so that it prints out the score of the alignment
The total cost of the alignment is the last value in the recursion matrix. Identify this value and print it out with the print function
4 Modify the recursion so that INDELS get different penalties in sequence A and B
Define two different penalties: $gepA, $gepB and apply them at appropriately
5 Modify the recursion so that the alignment becomes local (Smith and Waterman)
  1. Add an extra 0 state
  2. Keep track of the best scoring cell in the matrix (best local alignment)
  3. Start the recursion from that point
  4. stop it when the score is lower than zero