From: Multiple genome comparison based on overlap regions of pairwise local alignments
Algorithm 3 (TestMOI) |
---|
Input: sorted list of all intervals interval [1 ..n ]; number of collections k |
Variables: largest end point seen so far in each collection endPoint [1 ..k ] |
1: endPoint[1..k] ← 0 |
2: prevEnd ← 0 |
3: min ← 0 |
4: newEndPoint ← false |
5: for ∈ interval[1..n] do |
6: if end >endPoint[j] then |
7: if endPoint[j] = min then |
8: newEndPoint ← true |
9: end if |
10: endPoint[j] ← end |
11: end if |
12: if newEndPoint and all intervals with recent start position processed then |
13: min ← mini = 1..k{endPoint[i]} |
14: newEndPoint ← false |
15: if prevEnd < min and min ≥ start then |
16: output MOI(start, min) |
17: prevEnd = min |
18: end if |
19: end if |
20: end for |