For problem A.3 or A.4, only one is required (pick one). (Or get a bonus if you do both). If you choose to do A.3 you have to do both A.3a and A.3b.
Your submission of Part A should include:
a. Source code.
b. A text file containing brief instructions on how to compile and execute your programs.
c. A brief report of your results.
Your submission of Part B should be in a separate file different from Part A (use intuitive names such as PartAReport.pdf, PartB.doc).
Part A - Motif finding (implementation)
A1. (15 points) Write a program that takes as input an alignment, and outputs the PWM and the information content of the PWM. Apply your program on the following alignment and report the results. Also use the web tool enoLogos to compute the sequence logo. Make sure you set %GC to "equiprobable". Click on textout to check the probability matrix and information content there. Do they match your results?
A2. (25 points) Write a program that takes as input a set of input sequences and a PWM, and outputs the best matches from each sequence. Report both the locations of the matches and the matched subsequences.
Apply your program to the input sequences in this file and the PWM you computed above.
(You can verify your results using the program you developed in 1: try to get a new PWM using the matched subsequences - does it look similar to your input PWM?)
A3. (40 points) Combinatorial motif finding (optional: pick 3 or 4. If you pick 3 you have to do both 3a and 3b).
(a). Implement the sample-based motif finding algorithm (slide #35). Your program should take as input a set of sequences and a parameter k (motif length), and output the consensus with the smallest total number of mismatches to all sequences. Your program should also report the total number of mismatches, the matched subsequences and locations on each sequence, and the amount of wall-clock time taken by your program to find the consensus.
Apply your program to the input sequences in this file, with k = 7. Also try k = 9. Report both the consensus and the sequence logo.
(b). Repeat problem 3a with the pattern-based motif finding algorithm (slide #34).
A4. (40 points) Probabilistic motif finding (optional: pick 3 or 4).
Utilize the code you wrote for 1 and 2 to implement a Viterbi-like probabilistic motif finding algorithm (i.e., always pick the locations with the best matches to the current PWM as your next set of starting points). Do the same experiment as in 3.
A5. (Bonus, 10 points) download the following program to generate some synthetic data sets and try your programs developed in 3 or 4 and report the results.
Usage: java -cp motifGen.jar model.MotifGen -L SeqLen -n nSeqs -l motifLen -d nMismatches -e | java -cp motifGen.jar util.FastaOneLine > outputFile
You can replace the parameters with, for example: SeqLen = 200, nSeqs = 20, motifLen = 7, nMismatches = 1. These are the parameters I used to generate the test file for 3 and 4. For more challenging test case you can choose seqLen = 600, nSeqs = 20, motifLen = 11, nMismatches = 2.
Part B - Exact string matching (theoretical)
B1. Joint suffix tree (30 points)
(a). Draw a joint suffix tree for three strings ACTAC, ATCAT, TCACT. Label the edges and terminal nodes.
(b). Describe an efficient algorithm to find the minimum l for a set of strings T1, T2, . . . , Tk, such that there exist a unique “signature” substring of length l for each string. For example, if T1 = ACGACGTA, T2 = ACTATGAC, and T3 = GATAGTA, the smallest l = 2, since a signature of length 2 can be found for each string: CG only appears in T1, CT only in T2 and AG only in T3.
B2. Suffix tree, suffix array and BWT (40 points)
(a) Show the suffix tree for string actgctcggct.
(b). Compute the suffix array for the same string.
(c). Compute the BWT transformation for the same string.
(d). Assume that an implementation of suffix tree for DNA sequences uses 20 bytes per base. Estimate the memory requirement for a suffix tree representation of the human genome, which has 3 billion bases.
(e). Estimate the memory requirement for a suffix array representation of the human genome.
(f). Estimate the memory requirement for a BWT representation of the human genome.
(g). Considering that we are indexing a large database of strings with 3 billions “characters”, where each “character” is an integer in the range of 1 to 216. Does this change the memory requirement of suffix array and BWT? What impact it might have on suffix trees?
(h). Discuss the relative advantage and disadvantage of suffix trees, suffix arrays, and BWTs for representing and comparing DNA/protein sequences.