Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exact string matching Rhys Price Jones Anne Haake Week 2: Bioinformatics Computing I continued.

Similar presentations


Presentation on theme: "Exact string matching Rhys Price Jones Anne Haake Week 2: Bioinformatics Computing I continued."— Presentation transcript:

1 1rpjavp@rit.edu Exact string matching Rhys Price Jones Anne Haake Week 2: Bioinformatics Computing I continued

2 2rpjavp@rit.edu Wild Cards How do you adapt the algorithm to accommodate ? wild cards in the pattern P? (? matches any SINGLE character). Biological relevance How do you adapt the algorithm to accommodate Σ * wild cards in the pattern P? (Σ * matches zero or more characters) Biological relevance

3 3rpjavp@rit.edu Rabin-Karp algorithm Illustrate with nucleotide sequences For long sequences, need to do modular arithmetic. Worst case analysis is still O(nm) since all the potential hits may need to be checked out. When does worst case occur? Expected case is O(n+m)

4 4rpjavp@rit.edu Rabin-Karp and Wild Cards What happens if you have a ? wildcard in the search pattern? What about a Σ * wildcard?

5 5rpjavp@rit.edu Regular Expressions Example –AC(T+A)*CA Recursive definition –terminal, or –r 1 +r 2 or r 1 r 2 or r* –where r, r 1, r 2 are reg.exps. Regular expressions and Perl

6 6rpjavp@rit.edu Finite State Automata Definition Q, , , q 0, F Examples Example of string-matching automaton Give algorithm finite-automaton-matcher Discuss correctness

7 7rpjavp@rit.edu Finite State Automata and Regular Expressions It can be shown that for any regular expression, you can build a finite state automaton that recognizes exactly those strings containing a substring matching the regular expression. It can be shown that for any finite state automaton M, you can write a regular expression for the set of strings recognized by M.

8 8rpjavp@rit.edu String matching with finite automata. Blackboard illustration


Download ppt "Exact string matching Rhys Price Jones Anne Haake Week 2: Bioinformatics Computing I continued."

Similar presentations


Ads by Google