Lecture 6.2 FASTA
Lecture 6.2 FASTA
Searching
(FASTA)
Lecture – 6.2
2. Selectivity, Sensitivity
A G
C T
G T
G C
A G
C G
Search Character = C
Expected = CCC
Outcome = ACC
Worked Out Example ▹
(Selectivity)
Dataset
A G
C T
G T
G C
A G
C G
Search Character = C
Expected = CCC
Outcome = ACC
3. Hash Table Used in
FASTA
Hash Table Algorithm
Given Data
Query Sequence:
JUSTICELEAGUE
Target Sequence:
LEAGUEOFASSASINS
Value of K : 1
Step 1 : Build Query Table
1 2 3 4 5 6 7 8 9 10 11 12 13
J U S T I C E L E A G U E
Step 2: Hash Table for Query Sequence
10 6 7 11 5 1 8 3 4 2
9 12
13
Step 3 : Build Target Table
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
L E A G U E O F A S S A S I N S
Step 4 : Import the Hash Table for Query
Sequence
A C E G I J L S T U
10 6 7 11 5 1 8 3 4 2
9 12
13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
L E A G U E O F A S S A S I N S
Step 5 : Build the Extended Target Table
based on Hash Table
A C E G I J L S T U
10 6 7 11 5 1 8 3 4 2
9 12
13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
L E A G U E O F A S S A S I N S
7 5 7 7 -3 1 1 -7 -8 -2 -10 -9 -13
7 7 3
11 7
Entry in Extended Row = Position of the Letter in Hash Table – Position of the
Letter in Extended Target Table
Example:• For L, in Extended Target Table, Entry is 7 (8-
• 1) .
Similarly For E, the entries are 5 (7-2), 7 (9-
Step 5 : Build Offset Table
Draw a table from the minimum to the maximum entry of the extended target
table. Then beneath each entry
number, write down number of times that entry occurred in extended target
table. For example, the entry 7
-13 Occurred
-12 -116 times
-10 and
-9 the
-8 entry
-7 1-6
occurred
-5 -42 times.
-3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11
1 1 1 1 1 1 1 2 1 1 6 1
Step 6: Build Pre-Final Table
L E A G U E O F A S S A S I N S
Step 7 : Build Final Table
• Find out the entry number from the offset table, that occurred maximum number of
times (Here 7, which occurred
6 times).
• After that, add that entry number with the previous starting position of target
sequence to get the new starting
Position of Target Sequence (Previous starting position = 0, Then new starting position of
0 target
1 2 3 seq4 5becomes
6 7 8 09 +10
7 = 11
7). 12 13 14 15 16 17 18 19 20 21 22
J U S T I C E L E A G U E
L E A G U E O F A S S A S I N S