Project 5: Global Sequence Alignment

Start: Thursday 10/30; Due: Monday 11/17, by the beginning of class


Overview

This assignment is also taken from the projects on the book's web site. In this case, the assignment is the Global Sequence Alignment. Be sure to read comments below for some clarifications and suggestions.

In order to make sense of the questions in the readme.txt file, you will need to read Section 4.1 of the textbook.

You should work on this project individually.


Getting Started

You should get started by reading through Global Sequence Alignment and work through one or two examples by hand. In other words, come up with some short DNA sequences and compute their edit distance using the table method illustrated in the write-up for the sequences AACAGTTACC and TAAGGTCA. You do not have to hand this in, and you may work with a partner on this part. Note that one of the formulas includes 0/1; this does not mean the division of 0 by 1, but rather means either 0 or 1 depending on a condition listed earlier.


Required Structure

Instead of giving you a template Java file to work from, we are going to have you create the code more or less from scratch. However, in order to enforce some uniformity (which will make the grading easier), we request that you do certain things:


Required Methods

The class EditDistance should correctly implement the following methods:


/**

 * @param x a non-null String

 * @param y a non-null String

 * @return the the edit distance between x and y

 * 

 * This procedure should use a recursive, not dynamic programming, approach

 * to compute the edit distance

 */

private static int recursiveEditDistance(String x, String y)



/**

 * @param x a non-null String

 * @param y a non-null String

 * @return the the edit distance between x and y

 * 

 * This procedure should dynamic programming to compute the edit distance

 */

private static int editDistance(String x, String y)



/**

 * @param x a non-null String

 * @param y a non-null String

 * 

 * This procedure should use dynamic programming to compute the edit distance

 * and print it and an optimal alignment in the vertical format shown in the

 * project assignment.

 * NOTE: There may be multiple optimal alignments.

 *       This procedure needs to print one optimal alignment.

 */

private static void printEditDistance(String x, String y)

  

/**

 * @param x a non-null String

 * @param y a non-null String

 * 

 * Prints out the edit distance between x and y and the time taken to compute it

 * using the recursive version recursiveEditDistance

 */

public static void timeRecursiveEditDistance(String x, String y)

  

		  

/**

 * @param x a non-null String

 * @param y a non-null String

 * 

 * Prints out the edit distance between x and y and the time taken to compute it

 * using the dynamic programming version editDistance

 */

public static void timeEditDistance(String x, String y)

  

		  

/**

 * @param dnaLength a non-negative int

 * @return a random String of length dnaLength comprised of the four chars A, T, G, and C

 */

public static String randomDNAString(int dnaLength)


Gradesheet

Code (50 pts)

Comments and Style (20 pts)

Questions in readme.txt (30 pts)

Total: 100 pts


Submission

You should submit via Moodle. You must submit the whole project with the EditDistance class (as a zip file). Again, here is our step by step instruction. You must also answer the questions in the attached readme.txt file.