Skip to main content
. 2022 Sep 4;10(9):1785. doi: 10.3390/microorganisms10091785
Algorithm 1 Two-level resolution template matching algorithm
  •   Require: 

    The compressed query sequence Ql and Qh. Two groups of templates {Tl} and {Th} with length Nl and Nh. The number of templates for each group is denoted as Nt.

  •   1:

    Initial matching scores: Slmax0,Shmax0.

  •   2:

    Step 1: Exact matching between Ql and {Tl}:

  •   3:

    fori=1 to Nt do

  •   4:

         Sli=1dH(Ql,Tli)Nl.

  •   5:

         if Sli>Slmax then

  •   6:

             SlmaxSli,ClmaxCi, where Ci is the ith clade.

  •   7:

         end if

  •   8:

    end for

  •   9:

    Sort {Sli} in descending order: {Sli}. The superscripts 1 and 2 are the clade index numbers corresponding to the highest and next highest scores, respectively.

  • 10:

    ifSl1>Sl2then

  • 11:

         Cl*Clmax.

  • 12:

         return Cl*.

  • 13:

    else

  • 14:

         The clade index numbers with the same and the highest score form the set Ih, and the size of Ih is Nth, where Nth2.

  • 15:

         Continue with Step 2.

  • 16:

    end if

  • 17:

    Step 2: Exact matching between Qh and {Th}:

  • 18:

    fori in Ih do

  • 19:

         Shi=1dH(Qh,Thi)Nh.

  • 20:

         if Shi>Shmax then

  • 21:

             ShmaxShi,ChmaxCi, where Ci is the ith clade.

  • 22:

         end if

  • 23:

    end for

  • 24:

    Ch*Chmax.

  • 25:

    returnCh*.