Docsity

Bioinformatics Homework 1 - Problem Solutions - Prof. Yufeng Wu, Assignments of Biology

Toggle sidebar
bg1
BME/4800, CSE 3800/5800 — Bioinformatics — Yufeng Wu — Fall 2009
Homework 1 ——- Due: 9/17 in class.
Please be concise: each of the problems should not take more than 1 page. I prefer
shorter answers that are right to the point.
Problem 1
Read the posted explanation by Gusfield on the LCP array construction. When it was argued that
LCP (S uffk+1;Suf fP red(k+1) )≥h−1, it says “if the path to leaf Pred(k+1) does not extend below
v, that will be impossible”. Now, give a more expanded argument why this will be impossible.
Problem 2
In class, we briefly introduced a data compression method. We defined Priorias the longest prefix
of S[i..m] that also occurs in S[1..i-1] for a given string S. We define its length of this prefix as liand
its starting position as si. We also mentioned the way of data compression as follows: scan S from
left to right; for each position i, if li>0, then we output [li, si]; Otherwise, we output S[i].
Now, show me a suffix tree-based compression algorithm that runs in O(m) time, where m is the
length of the string.
Problem 3
In class, we described the problem of searching pattern P in a text using a suffix array. That method
needs the LCE value. Longest common extension (LCE) for two positions iand jin a string S
(whose length is n) is the length of the longest common prefix of suffix iand suffix jof S. For
example, for S=abaabac, LCE(1,4)=3, LCE(3,4)=1.
(a) Now, you are given the suffix array POS and its LCP array of S. Prove that LCE(i,j) is equal
to the smallest LCP value between suffix i and suffix j in the LCP array. That is, suppose POS[a] =
i and POS[b]=j (where a <b), then LCE (i, j) = minb
k=a+1 LCP [k].
(b) How many LCE values are needed in the binary search? How long does it take to compute
these values using the lemma in Part (a)? Your method should run in time O(n), where n is the
length of the text.
Problem 4
Recall that MUM (maximal unique match) for two strings S1and S2is a substring that appears in
both S1and S2exactly once, and are longest (i.e. can not be extended in both directions).
Now find a linear time algorithm for finding all the MUMs in two strings T and T’ using a suffix
array POS and LCP array. You can not use suffix tree in this case (that is, do not construct a suffix
tree from suffix array).
1

Partial preview of the text

Download Bioinformatics Homework 1 - Problem Solutions - Prof. Yufeng Wu and more Assignments Biology in PDF only on Docsity!

BME/4800, CSE 3800/5800 — Bioinformatics — Yufeng Wu — Fall 2009

Homework 1 ——- Due: 9/17 in class.

Please be concise: each of the problems should not take more than 1 page. I prefer shorter answers that are right to the point.

Problem 1

Read the posted explanation by Gusfield on the LCP array construction. When it was argued that LCP (Suf fk+1; Suf fP red(k+1)) ≥ h − 1, it says “if the path to leaf Pred(k+1) does not extend below v, that will be impossible”. Now, give a more expanded argument why this will be impossible.

Problem 2

In class, we briefly introduced a data compression method. We defined Priori as the longest prefix of S[i..m] that also occurs in S[1..i-1] for a given string S. We define its length of this prefix as li and its starting position as si. We also mentioned the way of data compression as follows: scan S from left to right; for each position i, if li > 0, then we output [li, si]; Otherwise, we output S[i]. Now, show me a suffix tree-based compression algorithm that runs in O(m) time, where m is the length of the string.

Problem 3

In class, we described the problem of searching pattern P in a text using a suffix array. That method needs the LCE value. Longest common extension (LCE) for two positions i and j in a string S (whose length is n) is the length of the longest common prefix of suffix i and suffix j of S. For example, for S=abaabac, LCE(1,4)=3, LCE(3,4)=1. (a) Now, you are given the suffix array POS and its LCP array of S. Prove that LCE(i,j) is equal to the smallest LCP value between suffix i and suffix j in the LCP array. That is, suppose POS[a] = i and POS[b]=j (where a < b), then LCE(i, j) = minbk=a+1 LCP [k]. (b) How many LCE values are needed in the binary search? How long does it take to compute these values using the lemma in Part (a)? Your method should run in time O(n), where n is the length of the text.

Problem 4

Recall that MUM (maximal unique match) for two strings S 1 and S 2 is a substring that appears in both S 1 and S 2 exactly once, and are longest (i.e. can not be extended in both directions). Now find a linear time algorithm for finding all the MUMs in two strings T and T’ using a suffix array POS and LCP array. You can not use suffix tree in this case (that is, do not construct a suffix tree from suffix array).