|
Algorithm 1 Two-level resolution template matching algorithm |
-
Require:
The compressed query sequence and . Two groups of templates and with length and . The number of templates for each group is denoted as .
-
1:
Initial matching scores: .
-
2:
Step 1: Exact matching between and :
-
3:
for to do
-
4:
.
-
5:
if then
-
6:
, where is the ith clade.
-
7:
end if
-
8:
end for
-
9:
Sort in descending order: . The superscripts and are the clade index numbers corresponding to the highest and next highest scores, respectively.
-
10:
ifthen
-
11:
.
-
12:
return .
-
13:
else
-
14:
The clade index numbers with the same and the highest score form the set , and the size of is , where .
-
15:
Continue with Step 2.
-
16:
end if
-
17:
Step 2: Exact matching between and :
-
18:
fori in do
-
19:
.
-
20:
if then
-
21:
, where is the ith clade.
-
22:
end if
-
23:
end for
-
24:
.
-
25:
return.
|