ift3295 démonstration 28 septembre 2011 shift-and (avec erreurs)

68
IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Upload: guy-lemercier

Post on 04-Apr-2015

107 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

IFT3295Démonstration

28 septembre 2011

Shift-And (avec erreurs)

Page 2: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Plan

• Présentation en détail de l'algorithme Shift-And (avec erreurs)

• Présentation de PROSITE

Page 3: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Wu et Manber (1992)

• Base du logiciel agrep de Unix

• Recherche approximative d'un mot dans un texte

• Permet les insertions, les délétions et les substitutions de caractères

Page 4: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Exemple :– Texte : aabaacaabacab– Mot : aabac (|mot| = m)– Alphabet : {a, b, c}

• Pré-traitement : – Pour chaque caractère x de l'alphabet, on

construit un tableau de bits Sx tel que Sx[pos] = 1 si motpos = x (pour 1 <= pos <= m)

Page 5: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Pré-traitement : – Pour chaque caractère x de l'alphabet, on

construit un tableau de bits Sx tel que Sx[pos] = 1 si motpos = x (pour 1 <= pos <= m)

1

1

0

1

0

0

0

1

0

0

0

0

0

0

1

a

a

b

a

c

Mot : Sa Sb Sc

Page 6: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Soit k, le nombre d'erreurs que l'on veut permettre

• On doit construire (k+1) tableaux de bits R de taille m * (n+1) (où n = |texte|) (quoique la plupart des colonnes pourront être oubliées) :– R0, R1, …, Rk

Page 7: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Les tableaux R doivent être construits dans l'ordre croissant du nombre d'erreurs

• Regardons d'abord la construction de R0, qui est l'équivalent de Shift-Or (recherche exacte)

Page 8: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Au départ :

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0

a 0

b 0

a 0

c 0

R0

Page 9: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Objectif : trouver 1 sur la ligne m match

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0

a 0

b 0

a 0

c 0

R0

Page 10: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

R0j+1[i] =

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0

a 0

b 0

a 0

c 0

R0

1 si R0j[i-1] = 1 et moti = textej+1

0 sinonj+1j

i

i-1

Page 11: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0

a 0

b 0

a 0

c 0

R0

R0j+1[i] =

1 si R0j[i-1] = 1 et moti = textej+1

0 sinonj+1j

i

i-1

Page 12: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1

a 0

b 0

a 0

c 0

R0

R0j+1[i] =

1 si R0j[i-1] = 1 et moti = textej+1

0 sinonj+1j

i

i-1

Page 13: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1

a 0

b 0

a 0

c 0

R0

R0j+1[i] =

1 si R0j[i-1] = 1 et moti = textej+1

0 sinonj+1j

i

i-1

Page 14: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1

a 0

b 0

a 0

c 0

R0

R0j+1[i] =

1 si R0j[i-1] = 1 et moti = textej+1

0 sinonj+1j

i

i-1

Page 15: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1

a 0 0

b 0

a 0

c 0

R0

R0j+1[i] =

1 si R0j[i-1] = 1 et moti = textej+1

0 sinonj+1j

i

i-1

Page 16: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1

a 0 0

b 0 0

a 0 0

c 0 0

R0

R0j+1[i] =

1 si R0j[i-1] = 1 et moti = textej+1

0 sinon

Page 17: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1 1

a 0 0 1

b 0 0 0

a 0 0 0

c 0 0 0

R0

R0j+1[i] =

1 si R0j[i-1] = 1 et moti = textej+1

0 sinon

Page 18: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Qu'est-ce que ça représente?

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1 1

a 0 0 1

b 0 0 0

a 0 0 0

c 0 0 0

R0

j+1j

i

i-1

Page 19: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Qu'est-ce que ça représente?

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1 1

a 0 0 1

b 0 0 0

a 0 0 0

c 0 0 0

R0

j+1j

i

i-1

Page 20: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Qu'est-ce que ça représente?

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1 1

a 0 0 1

b 0 0 0

a 0 0 0

c 0 0 0

R0

j+1j

i

i-1

Page 21: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Qu'est-ce que ça représente?

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1 1 0

a 0 0 1 0

b 0 0 0 1

a 0 0 0 0

c 0 0 0 0

R0

j+1j

i

i-1

Page 22: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Qu'est-ce que ça représente?

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1 1 0

a 0 0 1 0

b 0 0 0 1

a 0 0 0 0

c 0 0 0 0

R0

j+1j

i

i-1

Page 23: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Qu'est-ce que ça représente?

a a b a a c a a b a c a b

1 1 1 1 1 1 1 1 1 1 1 1 1 1

a 0 1 1 0

a 0 0 1 0

b 0 0 0 1

a 0 0 0 0

c 0 0 0 0

R0

j+1j

i

i-1

Page 24: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Cette transition peut être calculée bien plus efficacement

• R0j+1 = Rshift[R0

j] AND Sj+1

où Sj+1 est la table de pré-traitement du caractère qui est à la position j+1 dans le texte

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

Page 25: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Rshift :– On décale les bits à droite d'une

position, on élimine le dernier bit et on insère 1 à gauche

Rshift[00000] = 10000

Rshift[10001] = 11000

Page 26: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• R0j+1 = Rshift[R0

j] AND Sj+1

a a b a a c a a b a c a b

a 0

a 0

b 0

a 0

c 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

Page 27: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0

a 0

b 0

a 0

c 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 28: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1

a 0 0

b 0 0

a 0 0

c 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

0

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 29: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1

a 0 0

b 0 0

a 0 0

c 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 30: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1

a 0 0

b 0 0

a 0 0

c 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 31: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1

a 0 0

b 0 0

a 0 0

c 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 32: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1

a 0 0 1

b 0 0 0

a 0 0 0

c 0 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

0

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 33: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1

a 0 0 1

b 0 0 0

a 0 0 0

c 0 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 34: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1

a 0 0 1

b 0 0 0

a 0 0 0

c 0 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 35: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1

a 0 0 1

b 0 0 0

a 0 0 0

c 0 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 36: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1 1

a 0 0 1 1

b 0 0 0 1

a 0 0 0 0

c 0 0 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

0

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 37: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1 1

a 0 0 1 1

b 0 0 0 1

a 0 0 0 0

c 0 0 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 38: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1 0

a 0 0 1 0

b 0 0 0 1

a 0 0 0 0

c 0 0 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

j+1j

• R0j+1 = Rshift[R0

j] AND Sj+1

Page 39: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1 0 1 1 0 1 1 0 1 0 1 0

a 0 0 1 0 0 1 0 0 1 0 0 0 0 0

b 0 0 0 1 0 0 0 0 0 1 0 0 0 0

a 0 0 0 0 1 0 0 0 0 0 1 0 0 0

c 0 0 0 0 0 0 0 0 0 0 0 1 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc• R0j+1 = Rshift[R0

j] AND Sj+1

Page 40: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Nous venons de voir la construction de R0, qui est l'équivalent de Shift-Or (recherche exacte)

• Que fait-on pour R1, R2, …, Rk?

• Trois types d'erreurs sont permises : insertions, délétions et substitutions

Page 41: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Insertion (1er cas) :

a a b a a c a a b a c a b

a a

j+1

i = 2

R0j+1[2] = 0

Page 42: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Insertion (1er cas) :

a a b a a c a a b a c a b

a a b

j+1

i = 2 R1j+1[2] = 1

R0j+1[2] = 0

Page 43: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Insertion (2e cas) :

a a b a a c a a b a c a b

a a

j+1

i = 2

R0j+1[2] = 0

Page 44: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Insertion (2e cas) :

a a b a a c a a b a c a b

a b a

j+1

i = 2

R0j+1[2] = 0

R1j+1[2] = 1

Page 45: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Délétion (1er cas) :

a a b a a c a a b a c a b

a b a a b

j+1

i = 5

R0j+1[5] = 0

Page 46: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Délétion (1er cas) :

a a b a a c a a b a c a b

a b a a b

j+1

i = 5

R0j+1[5] = 0

R1j+1[5] = 1

Page 47: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Délétion (2e cas) :

a a b a a c a a b a c a b

a b a a b c

j+1

i = 6

R0j+1[6] = 0

R1j+1[6] = 1

Page 48: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Substitution (1er cas) :

a a b a a c a a b a c a b

a a b a c

j+1

i = 5

R0j+1[5] = 0

Page 49: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Substitution (1er cas) :

a a b a a c a a b a c a b

a a b a c

j+1

i = 5

R0j+1[5] = 0

R1j+1[5] = 1

Page 50: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Substitution (2e cas) :

a a b a a c a a b a c a b

a a b c a

j+1

i = 5

R0j+1[5] = 0

R1j+1[5] = 1

Page 51: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• On peut résumer tous ces cas dans la formule de transition suivante :

Rdj+1 = Rshift[Rd

j] AND Sj+1 OR

Rshift[Rd-1j] OR

Rshift[Rd-1j+1] OR

Rd-1j

Page 52: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• On peut résumer tous ces cas dans la formule de transition suivante :

Rdj+1 = Rshift[Rd

j] AND Sj+1 OR

Rshift[Rd-1j OR Rd-1

j+1] OR

Rd-1j

Page 53: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)Rd

j+1 = Rshift[Rdj] AND Sj+1 OR Rshift[Rd-1

j OR Rd-1j+1] OR Rd-1

j

a a b a a c a a b a c a b

a 0

a 0

b 0

a 0

c 0

R1

Page 54: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)Rd

j+1 = Rshift[Rdj] AND Sj+1 OR Rshift[Rd-1

j OR Rd-1j+1] OR Rd-1

j

a a b a a c a a b a c a b

a 0

a 0

b 0

a 0

c 0

R1

Page 55: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)Rd

j+1 = Rshift[Rdj] AND Sj+1 OR Rshift[Rd-1

j OR Rd-1j+1] OR Rd-1

j

R1j+1 = Rshift[00000] AND 11010 OR Rshift[00000 OR 10000] OR 00000

= 10000 AND 11010 OR Rshift[10000] = 10000 OR 11000 = 11000

a a b a a c a a b a c a b

a 0

a 0

b 0

a 0

c 0

R1

j+1j

Page 56: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1 0 1 1 0 1 1 0 1 0 1 0

a 0 0 1 0 0 1 0 0 1 0 0 0 0 0

b 0 0 0 1 0 0 0 0 0 1 0 0 0 0

a 0 0 0 0 1 0 0 0 0 0 1 0 0 0

c 0 0 0 0 0 0 0 0 0 0 0 1 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

Page 57: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)Rd

j+1 = Rshift[Rdj] AND Sj+1 OR Rshift[Rd-1

j OR Rd-1j+1] OR Rd-1

j

R1j+1 = Rshift[00000] AND 11010 OR Rshift[00000 OR 10000] OR 00000

= 10000 AND 11010 OR Rshift[10000] = 10000 OR 11000 = 11000

a a b a a c a a b a c a b

a 0 1

a 0 1

b 0 0

a 0 0

c 0 0

R1

j+1j

Page 58: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)Rd

j+1 = Rshift[Rdj] AND Sj+1 OR Rshift[Rd-1

j OR Rd-1j+1] OR Rd-1

j

a a b a a c a a b a c a b

a 0 1

a 0 1

b 0 0

a 0 0

c 0 0

R1

j+1j

Page 59: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)Rd

j+1 = Rshift[Rdj] AND Sj+1 OR Rshift[Rd-1

j OR Rd-1j+1] OR Rd-1

j

R1j+1 = Rshift[11000] AND 11010 OR Rshift[10000 OR 11000] OR 10000

= 11100 AND 11010 OR Rshift[11000] OR 10000

= 11000 OR 11100 OR 10000 = 11100

a a b a a c a a b a c a b

a 0 1

a 0 1

b 0 0

a 0 0

c 0 0

R1

j+1j

Page 60: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

a a b a a c a a b a c a b

a 0 1 1 0 1 1 0 1 1 0 1 0 1 0

a 0 0 1 0 0 1 0 0 1 0 0 0 0 0

b 0 0 0 1 0 0 0 0 0 1 0 0 0 0

a 0 0 0 0 1 0 0 0 0 0 1 0 0 0

c 0 0 0 0 0 0 0 0 0 0 0 1 0 0

R0

1

1

0

1

0

Sa

0

0

1

0

0

Sb

0

0

0

0

1

Sc

Page 61: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)Rd

j+1 = Rshift[Rdj] AND Sj+1 OR Rshift[Rd-1

j OR Rd-1j+1] OR Rd-1

j

R1j+1 = Rshift[11000] AND 11010 OR Rshift[10000 OR 11000] OR 10000

= 11100 AND 11010 OR Rshift[11000] OR 10000

= 11000 OR 11100 OR 10000 = 11100

a a b a a c a a b a c a b

a 0 1 1

a 0 1 1

b 0 0 1

a 0 0 0

c 0 0 0

R1

j+1j

Page 62: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Il est inutile de garder toutes les colonnes des (k+1) tableaux en mémoire

• L'idée est de calculer la colonne (j+1) pour R0, ensuite pour R1, … et enfin pour Rk

• Ensuite, on pourra oublier la colonne j de tous les tableaux lorsqu'on calculera la colonne (j+2)

Page 63: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

Shift-And (avec erreurs)

• Complexité :

– O(kn) lorsque le mot n'est pas trop grand

avec

k = nombre d'erreurs permises

n = longueur du texte

- O(kn * nbMotsMachine) sinon

Page 64: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

PROSITE

• Base de données dédiée à l'identification de familles de protéines et de domaines

• Collection de motifs décrits en tant que patterns ou profils, reliés à la documentation décrivant les familles de protéines ou les domaines en question

Page 65: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

PROSITE

• Pattern = expression régulière

• Les patterns sont identifiés à partir des alignements multiples des protéines d'une même famille

Page 66: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

PROSITE

• Les patterns choisis représentent des motifs importants dans la séquence (10 à 20 acides aminés)– régions conservées qui ont une signification

biologique importante (site catalytique, site de liaison, etc.)

• On peut identifier la fonction d'une protéine dont la séquence diffère beaucoup avec celles de la base de données si on y retrouve un certain pattern

Page 67: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

PROSITE

• Syntaxe des patterns :– Chaque élément est séparé par -– x : n'importe quel– x(2) : x-x– x(2,4) : x-x, x-x-x ou x-x-x-x – [ALT] : Ala, Leu ou Thr– {AM} : n'importe quel sauf Ala, Met– < (au début) : doit être dans la partie N-terminale– > (à la fin) : doit être dans la partie C-terminale

Page 68: IFT3295 Démonstration 28 septembre 2011 Shift-And (avec erreurs)

PROSITE

• Exemples :– [AC]-x-V-x(4)-{ED} =

[Ala or Cys]-any-Val-any-any-any-any-{any but Glu or Asp}

– < A-x-[ST](2)-x(0,1)-V =

Ala-any-[Ser or Thr]-[Ser or Thr]-(any or none)-Val

qui doit être dans la partie N-terminale de la séquence