1 / 37

Sequence Similarity Search: an Overview

Sequence Similarity Search: an Overview. S. Cenk Sahinalp. CWRU. Similarity Search Problems in High Dimensional Spaces. Input : Set of points from a (high) d-dimensional space S={s 1 , s 2 …s n }

bob
Télécharger la présentation

Sequence Similarity Search: an Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sequence Similarity Search: an Overview S. Cenk Sahinalp CWRU

  2. Similarity Search Problems in High Dimensional Spaces • Input: Set of points from a (high) d-dimensional space S={s1, s2…sn} • Output: Data structure D(S) to compute si “similar” or “close to” on-line query point q. • Nearest neighbor query: return an si such that for all sj, e(q,si)  e(q,sj) • Near neighbor query: return all si such that e(q,si)  r • e(q,s): Hamming, Euclidean, etc for vector spaces Distances based on (weighted) count of edit operations for string spaces.

  3. Edit operations in genomic applications • Single character/nucleotide edits • Nucleotide insertion: …AATG… to …AACTG… • Nucleotide deletion: …AATG… to …AAG… • Nucleotide replacement: …AATG…to…AACG… • Block/segmental edits • Segmental duplication …CATG…to…CATGAT… • Segmental relocation …ACATG… to …TGACA… • Segmental deletion …CAATAAT… to …CAAT… • Segmental reversal …ACGT… to …TGCA…

  4. Sequence distance measures • Hamming distance: character replacements only • e(q,r) = Si(qi ¹ ri) • Levenshtein edit distance: character edits only • e(q,r) = minimum number of character edits to transform q into r • Most biomolecular sequence tools use a weighted version of character edit distance [NW70],[SW81]. • Block edit distance: all block edits allowed • e(q,r) = minimum number of character and block edits to transform q into r • Until recently block edit operations were considered only in text editing and data compression [Ti84],[St88]… or in molecular biology in isolation of point mutations and only in macro scale: [SK91],[BP95],[BP96],[HP95]. • Recent studies on segmental duplications and other rearrangements in the human genome [Ji+ Nat.Gen.01],[Ba+ Nat.Gen. 01] prompted new studies on block edit distances [Va+ Bioinformatics99], [CPSV SODA00],[Li+ Bioinformatics01][Be+, Phys.Rev.Let.02],[Ba, Nature02],[Li+. SODA03].

  5. Duplications (and rearrangements) are very common: intrachromosomal

  6. Interchromosomal (90-98%, >5kb) 1 2 3 4 5 6 7 8 200 kb 250 kb 9 10 11 12 13 14 15 16 17 18 19 20 21 22 X Y 50 kb 150 kb 100 kb Total: 3.43% (97.5 Mb) Inter: 1.77% (47.7 Mb) Intra: 2.29% (61.6 Mb)

  7. Interchromosomal (98-100%, >5kb) 1 2 3 4 5 6 7 8 200 kb 250 kb 9 10 11 12 13 Total: 10.63% (286 Mb) Inter: 3.9% (1.3 Mb) Intra: 6.4% (2.19 Mb) 14 15 16 17 18 19 20 21 22 X Y 50 kb 150 kb 100 kb

  8. Biomolecular sequence similarity search • Sequence similarity (i.e. small distance) usually implies functional homology. Evolution duplicates, reorganizes and modifies successful structures. Duplications + point mutations provide the main mechanism for genome evolution. • Biomolecular sequence databases (GenBank, Swissprot…) perform (semi)exhaustive search (compare each query sequence against every sequence in the database): see BLAST/FASTA. Too slow for exponential data growth? No tool for efficient sequence indexing even when distance is based on character edits only. Don’t mention block edits.

  9. Exact Similarity Search Goal: Construction time: O(poly(Si |si|)) Space: O(poly(Si |si|)) Query time: O(poly(|q|).polylog(Si |si|)) Curse of dimensionality [BOR99]: For high dimensional (d=(nc)) vector spaces known approaches require either (|q|+poly(Si |si|)) time for querying or (Si |si|)(d) time/space for preprocessing

  10. Block Edit Distance Computation • It is NP-hard to compute any distance measure involving nontrivial block operations [LT96]. • It is not possible to embed any distance measure involving character/block insertions and deletions into L1 or L2 [In+03][S02]. • This talk: O(log2d)-apprx [CPSV00],[MS00]: metric/indexible O(1)-apprx [ES02]: almost-metric/non-indexible

  11. Approximate SNN [MS00] Preprocessing time:O(poly (S|sj|) ) Space: O(poly (S|sj|)) Query time: O(poly (|q|).polylog(S|sj|)) If D returns si for q, we guarantee (whp) that sj: e(si,q) f(d).e(sj,q) d = maxk(|sk|) f(d) = O(log d .(log*d)2) e(s,q): block edit distance

  12. Roadmap • Embedding strings under block edit distance (BED) to binary vectors under Hamming distance • Approximate indexing of binary vectors under Hamming distance • O(1)-approximation algorithm to BED

  13. “Transforming” Block Edit Distance to Hamming Distance • Strategy: Given q, r, create bit-strings t(q) and t(r) so that the Hamming Distance h(t(q),t(r)) approximates the BED btwn q, r, i.e., e(Q,R). • Each bit in t(q) corresponds to whether a particular core block (or core) exists in q or not: • If the bit is 1, its corresponding core is present in q • If the bit is 0, its corresponding core is not present in q • The cores arise from LCP-Locally Consistent Parsing [SV96] based on deterministic coin tossing [CV86].

  14. Restricted Transformation Let Q be a binary a sequence of length 2k. Construct t’(Q): Location based cores: all 2i bit blocks B that occur at m.2i for m= 0..2k/i .Set the Bth entry of t’(Q) to 1; otherwise set it to 0 Example: Q = 1 0 1 1 1 1 1 0 blocks 0 1 00 01 10 11 t’(Q) 1 1 0 0 1 1 … t’(Q) is exponentially large but only O(|Q|) entries are set to 1; Only these entries are explicitly listed in lexicographic order. e.g. t’(Q) = 0, 1, 10, 11, 1011, 1110, 10111110

  15. Location Based Cores and Restricted Block Edit Distance Location based cores restrict edit operations to aligned blocks: • e’(Q,R): transform Q into R via the following operations only: • swap “aligned” blocks of Q, • copy a block over an “aligned” block (replaced one must have another aligned copy) • replace any single character of Q • reverse any block of Q, Two blocks W and Z are aligned if their length is identical, and their relative location to longer core blocks is identical. W Z

  16. Transforming e’(.,.) into h(.,.) Claim: For any Q and R How does a restricted edit operation manifest itself on t’(): • Swapping same size blocks do not affect non-intersecting cores. • Aligned blocks are partitioned to small cores identically. Swapping aligned blocks do not change the internal cores. • The only cores that change as a result of a swap are those which intersect but are not completely covered by swapped blocks • Because cores of length 2i do not overlap, there are at most 4 blocks of size 2i that can change as a result of a swap or any other restricted edit operation • Thus we can estimate e’(.,.) within a factor of O(log|Q|) via h(.,.)

  17. Extension to general block edit distance • Challenges/ideas: • e(Q,R) allows non-aligned block edit operations – rather than aligned block operations. • t(Q) is composed of position independent core blocks - obtained by Locally Consistent Parsing Claim: h(t(Q),t(R)) = O(log |Q| .log*|Q|.e(Q,R)) = W(e(Q,R)/ log*|Q|)

  18. Locally Consistent Parsing - LCP For the moment assume no pair of adjacent characters are identical. Write each character as a bit string ie A = 00000, C = 00001 • Generate a ‘tag’ for each character as: • Smallest bit location where it differs from its left neighbor • + Bit value there e.g. Char CGA Binary 01 11 00 Location - 0100 Tag - 011 000

  19. Locally Consistent Parsing II • If the starting alphabet is S, the tags can take 2 log |S| values • - the alphabet will change- • Repeat the procedure on the tags iteratively until tags are 3 bits long. • Properties of the final tags: • Final alphabet is {0,1,2,3,4,5} • No adjacent pair is identical • Takes log* |S| iterations • Each final tag depends on the log* |S| characters to its left

  20. Marking characters • Consider the final tags, and mark the following characters: • Mark any tags that are local maxima (greater than left & right) • Also mark any local minima if not adjacent to a marked char. • Clearly, no two adjacent characters are marked. • Also, successive marked tags are separated by at most five tags Q C A G A T C T A G C Tags - 10 01 00 11 10 01 00 11 10

  21. Obtaining Core Blocks Obtain a core block by concatenating each marked character and the five characters to its left and one character to its right. Each character is included in at least one core. There are at most |Q|/2 cores. Q C A G A T C T A G C … Tags - 10 01 00 11 10 01 00 11 10 Now relpace each core with a unique label to shrink the size of the input. Iterate on the shrunk input.

  22. LCP Fat Tree Stylised view: log|Q| … … … Q: C A G C … The cores are consistently generated and labeled: if a block is a core block somewhere it is always a core elsewhere.. Claim: h(t(Q),t(R)) is an O(log|Q| log*|Q|) approximation to e(Q,R)

  23. Proof 1: Upper bound • Cores are consistently generated independent of location; no need to stick to same size blocks: arbitrary swapping do not affect cores which do not intersect. • Because cores are consistently generated, if a block moves around, the cores within that block do not change: no need for aligned cores for swapping etc. • Any edit operation can change at most log*|Q| of cores of any level (they all intersect at the edited block); total cores affected are O(log|Q| (log*|Q|)) • Thus an edit operation can only change O(log|Q| (log*|Q|)) entries of t(Q)

  24. Proof 2: Lower bound Prove that e(Q,R) = O(h(t(Q),t(R))) • Procedure: start from Q, build QR, then remove Q leaving R. Total number of edits : O(h(t(Q,),t(R))). • Build R left-to-right by forming its fat-tree top down: • If a core is not present in Q or in the partially built R, give a credit to each descendant and recurse on each descendant. • If a core is present in Q or in the partially built R, copy it at unit cost. • The only charges correspond to blocks that are present in t(R) but not in t(Q), and each is charged to at most once.

  25. Finishing off Once QR is built, remove Q - remember, all operations are reversible. Total cost: number of cores that are present in one sequence but are not in the other; i.e., h(t(Q), t(R)). Verdict: we can transform Block Edit Distance into Hamming Distance, with approximation factor O(log|Q| (log*|Q|)2)

  26. Transforming Hamming Similarity to LCP [CPSV00] • Consider the binary representation of sequence R. • Randomly sample b of R’s bits and calculate their parity [AMRT96]; the parity gives the first bit of R’s fingerprint • Iteratively calculate the parities of geometrically increasing samples, obtaining 2nd,3rd… bits of R’s fingerprint. • Details: probability of under-estimation is e. Fix b to be proportional to -1/log e. • For i = 1…logb n, sample bi locations ri(1..bi) from R; • Build fingerprint f(R) as fi(R) = XORj=1…bi(R[ri(j)])

  27. Estimating Hamming Distance • Compute f(R) and f(Q) using same r • Compute p(f(Q),f(R)). • Hamming distance estimate: h’(Q,R) = 3|Q|(b - 1) / 2p(f(Q),f(R)) • Summary: • Size of fingerprint: O(log|Q|), • h’(Q,R) estimates h(Q,R) within O(1) factor with fixed prob. • The fingerprints can be put in a binary trie for fast prefix search.

  28. Converting Constant Probability to High Probability: • Recent work on data structures for Hamming NNs. Input: n bit sequences with d bits each. • Preprocessing time: (d.n)O(1) • Space: n.dO(1) • Query time: O(d polylog n) • Probability of failure in preprocessing: g • Once correctly constructed, returns (1+e) approx-NN with probability (1-m) • Vector nearest neighbors -VNN: L0, L1, L2, Hausdorff…[MIM98, KOR98, I99…]

  29. A greedy O(1)-approx to BED Compression distance [Li+03] [ES02] based on Ziv-Lempel methods: p(Q,S) = min number of phrases in S existing in Q Q = A C A T G C T S = A C C T T G C c(Q,S) = [p(Q,S) + p(S,Q)]/2 O(d) time computable [RPE81]

  30. Properties of compression distance • Approximates block edit distance well: c(S,Q) l.e(S,Q) • Symmetric, reflexive but satisfies the triangular inequality approximately: c(S,Q)  3.[c(S,R)+c(R,Q)] • Indexing tools for metric spaces may be exploited for suitable pairwise distance distributions.

  31. Past/Present/Future Work • Is it easier to index permutations under edit distances? [CMS01] • Is there a practical scheme assuring O(1)-approx? [STMO03] • Is a factor of (log d) inherent in indexing with edit distances? • How can we give non-uniform weights to edit operations? Can we efficiently index sequences under character edit distance? • Is there an approximation scheme for BED?

More Related