210 likes | 364 Views
Suffix Trees. ALGGEN: Algorithmics and genetics group Dep. Llenguatges i Sistemes Informàtics Universitat Politècnica de Catalunya. Dr. Xavier Messeguer. http://www.lsi.upc.es/~alggen. Suffix trees. 7: s. s,7. 6: as. s,6. 5: aas. a. a. as,5. as,3. as,3. ba. ba. baas,1.
E N D
Suffix Trees ALGGEN: Algorithmics and genetics group Dep. Llenguatges i Sistemes Informàtics Universitat Politècnica de Catalunya Dr. Xavier Messeguer http://www.lsi.upc.es/~alggen
Suffix trees 7: s s,7 6: as s,6 5: aas a a as,5 as,3 as,3 ba ba baas,1 baas,1 ba ba as,4 as,4 baas,2 baas,2 s,7 s,6 as,5 Given string ababaas: Suffixes: 3: abaas 1: ababaas 4: baas 2: babaas What kind of queries?
Queries on Suffix trees a ba baas,1 ba as,3 baas,2 as,4 s,7 s,6 as,5 • Does the sequence ababaas contain any ocurrence of patterns abab, aab, and ab? ………………………… • Find repeats within the sequence ababaas. …………………………
Quadratic Insertion algorithm ababaabbs,1 Given the string ababaabbs
Quadratic Insertion algorithm Given the string ababaabbs ababaabbs,1 babaabbs,2
Quadratic Insertion algorithm aba baabbs,1 Given the string ababaabbs ababaabbs,1 babaabbs,2
Quadratic Insertion algorithm abbs,3 aba baabbs,1 Given the string ababaabbs babaabbs,2
Quadratic Insertion algorithm abbs,3 aba baabbs,1 ba baabbs,2 Given the string ababaabbs babaabbs,2
Quadratic Insertion algorithm abbs,3 aba baabbs,1 ba abbs,4 baabbs,2 Given the string ababaabbs
Quadratic Insertion algorithm abbs,3 a aba baabbs,1 abbs,3 ba baabbs,1 abbs,4 abbs,4 Given the string ababaabbs ba baabbs,2
Quadratic Insertion algorithm abbs,5 a abbs,3 ba baabbs,1 abbs,4 abbs,4 Given the string ababaabbs ba baabbs,2
Quadratic Insertion algorithm abbs,5 a abbs,3 ba baabbs,1 abbs,4 abbs,4 Given the string ababaabbs ba baabbs,2
Quadratic Insertion algorithm abbs,5 a abbs,3 b a baabbs,1 abbs,4 abbs,4 Given the string ababaabbs ba ba baabbs,2
Quadratic Insertion algorithm abbs,5 a bs,6 abbs,3 b a baabbs,1 abbs,4 abbs,4 Given the string ababaabbs ba baabbs,2
Quadratic Insertion algorithm abbs,5 a bs,6 abbs,3 b a baabbs,1 abbs,4 abbs,4 Given the string ababaabbs ba baabbs,2
Quadratic Insertion algorithm abbs,5 a bs,6 bs,7 abbs,3 b a baabbs,1 b abbs,4 a baabbs,2 Given the string ababaabbs
Quadratic Insertion algorithm abbs,5 a bs,6 bs,7 abbs,3 b a baabbs,1 b abbs,4 a s,7 baabbs,2 Given the string ababaabbs
Quadratic Insertion algorithm abbs,5 a bs,6 bs,7 abbs,3 b a baabbs,1 b abbs,4 a s,7 s,7 baabbs,2 Given the string ababaabbs
Quadratic Insertion algorithm abbs,5 a bs,6 abbs,3 a b baabbs,1 b abbs,4 abbs,4 abbs,4 a baabbs,2 Given the string ababaabbs ba baabbs,2
Definition of MUM … a a t g….c t g... MUM … c g t g….c c c ... Maximal Unique Matching
Search for MUMs s,5 b s,8 a aat,1 bs,3 t,4 a a a t,5 t,2 ba b baabs,1 s,6 b s,7 bs,4 a a baabs,2 t,3 t,6 Given strings ababaabs and aabaat: 1st: Bottom-up traversal (Through the tree) List of UMaab,abaa,baa. 2nd: Search for maximals (through the list of UM) MUMs: aab,abaa.