<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Convolution and Fast Fourier Transform to Compare Symbol Sequences*</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Electronic Arts</institution>
          ,
          <addr-line>Redwood City, California</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Institute of computational modelling of the Siberian Branch of the Russian Academy of Sciences</institution>
          ,
          <addr-line>50/44 Akademgorodok, Krasnoyarsk, 660036</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Siberian Federal University</institution>
          ,
          <addr-line>79 Svobodny st., Krasnoyarsk, 660041</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>1807</year>
      </pub-date>
      <fpage>0000</fpage>
      <lpage>0003</lpage>
      <abstract>
        <p>We propose a new method to compare and analyze symbol sequences based on the convolution function calculation, where the latter is defined over the binary numeric sequences obtained by a specific transformation of the original symbol sequence. The method allows highly parallel implementation and it is of great value for the insertion/deletion mutations search. To calculate the convolution function, a fast discrete Fourier transform is implemented. Some genomic applications are provided and discussed. The applications are used to illustrate and overcome the problem of signal/noise selection, and alignment localization.</p>
      </abstract>
      <kwd-group>
        <kwd>Pattern Recognition</kwd>
        <kwd>Anomaly Detection</kwd>
        <kwd>Parallel Computation</kwd>
        <kwd>InDel</kwd>
        <kwd>Genome Comparison</kwd>
        <kwd>Knowledge Retrieval</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Here, we present a new method to compare and/or search for common subsequences
in symbol sequences based on convolution. Additionally, fast Fourier transformation
is used to compute the convolution, as well as a special representation of the symbol
sequences under consideration. We illustrate it with a few biologically inspired
examples. Also, the studies reveal some difficulties in the method implementation,
signal/noise extraction and localization of the coinciding subsequences being the most
acute among them.</p>
      <p>Currently, alignment is the most popular method to compare two (or several)
sequences, either exact matching, or with some errors. In spite of tremendous
investigations both in hardware and software for alignment, this method is still very
complicated and has a number of drawbacks which are impossible to eliminate. The
worst of them are divergence, arbitrariness in the fine function determination, and
* Copyright c 2020 for this paper by its authors. Use permitted under Creative Commons</p>
      <p>License Attribution 4.0 International (CC BY 4.0).
very low efficiency for InDel mismatches search (see, e. g. [1, 2, 8, 7] for details).
The proposed method is free from these crucial disadvantages. Moreover, it is highly
potential for coarse grained parallelism in various implementations.</p>
      <p>In brief, the method implies the following steps.</p>
      <p>Preprocessing. Each symbol sequence under consideration must be converted into
 binary ones, where</p>
      <p>= |ℵ| is the capacity of the alphabet. Next, one sequence ( ,
for certainty) must be inverted. Then, expand each binary sequence to the length  =

+</p>
      <p>− 1, adding zeros (upright, for certainty). Finally, expand each binary
sequence of the lenth  to the nearest upper power of 2, to proceed to a fast Fourier
transform (FFT).
sequence.</p>
      <p>Processing. Calculation of Fourier images of those binary sequences.
Postprocessing. Term by term multiplication of the images, thus obtaining a new
Result. Calculation of the inverse Fourier transform to obtain a convolution.</p>
    </sec>
    <sec id="sec-2">
      <title>Method Description</title>
      <p>
        Basic Concepts
2
2.1
 
 
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
=
=
Convolution S = A ∗ B of two number sequences A = { }
and B = { }
is the
sequence S{ }
      </p>
      <p>with
 =
∑
∑
∑
 
 

,  &lt;  ,
,  ≤  &lt;  ,</p>
      <p>
        ,  ≤  .
}
}
, 
, 
, 
, 
The convolution is a key tool to compare two sequences, to seek for a specific
subsequence within the latter. To do the search, we must introduce the convolution
S = A ∗ B of the inversed sequence B = {
. Following (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ), one obtains 
=  
+  
=  
+  
+  
, and so on.
      </p>
      <p>
        The convolution is a key tool to compare two sequences, to seek for a specific
subsequence within the latter. To do the search, we must introduce the convolution
S = A ∗ B of the inversed sequence B = {
. Following (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ), one obtains 
=  
+  
=  
+  
+  
, and so on.
      </p>
      <p>A brute force way to calculate the convolution of two sequences is rather hard. To
overcome this problem, we consider the convolution as a product of two polynomials
(of the power  − 1 and</p>
      <p>− 1, respectively). In other words, we consider two
number sequences A and B as sets of coefficients of the corresponding polynomials.
Thus, the convolution is converted to a product of two polynomials.</p>
      <p>The next step comes from the well-known theorem stating that Fourier transform
of a convolution is a product of Fourier transforms of the convolution of functions
(sequences, in our case) under consideration. Hence, an idea is to apply (fast) Fourier
transform to both sequences, multiply the Fourier images, and then to apply the
inverse Fourier transform to obtain the convolution of the original sequences. Fourier
transform is, in turn, the convolution. Meanwhile, there is a specific algorithm of a
very fast calculation of Fourier image of any number sequence called fast Fourier
transform (FFT).</p>
      <p>
        Let  denote FFT; it transforms a number sequence A into a sequence A′ =  (A)
of the same length  − 1. Let  (A′) = A denote the inverse FFT. Let now
introduce the operation X • Y for two number sequences X = { } and Y = { }
of the same length:
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
from the
      </p>
      <p>X • Y = {  }
2.2</p>
      <p>
        Algorithm Description
Consider two finite symbol sequences P = { } and Q = { }
alphabet ℵ = {A, C, G, T}. The algorithm comprises the following steps.
1. Inverse the sequence Q, yielding Q = { } .
2. Change P and Q into |ℵ| (that is 4, in our case) binary sequences, provided by the
following:
─ (
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ) sequence P is obtained by the substitution of all the symbols A in P with 1,
while all the others are changed for 0;
─ (
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ) sequence P is obtained by the substitution of all the symbols C in P with 1,
while all the others are changed for 0;
─ (
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ) sequence P is obtained by the substitution of all the symbols G in P with 1,
while all the others are changed for 0; finally
─ (
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ) sequence P is obtained by the substitution of all the symbols T in P with 1,
while all the others are changed for 0.
      </p>
      <p>Similarly, Q = { } must be changed for Q , Q , Q and Q . It should be kept in
mind that here Q sequence must be used.
3. Expand the sequences with zeros for further application of FFT to obtain a
sequence of the length  +  − 1. To do this, all 2 × |ℵ| binary sequences must be
accomplished with zeros (upright, for certainty) to that length. Additionally, an
effective implementation of FFT requires the sequence to be as long as the power
of 2, so we must add zeros to obtain the length  = 2⌈ ( )⌉.
4. Apply FFT to each of the binary sequences:</p>
      <p>P ′ =  (P ) , P ′ =  (P ) , P ′ =  (P ) , P ′ =  (P ) ,</p>
      <p>
        Q ′ =  (Q ) , Q ′ =  (Q ) , Q ′ =  (Q ) , Q ′ =  (Q ) .
5. Following (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ), multiply the relevant Q ′ (here  runs A, C, G and T) and sum them
up:
      </p>
      <p>S′ = P ′ • Q ′ + P ′ • Q ′ + P ′ • Q ′ + P ′ • Q ′ .
6. Apply the inverse FFT to S′ to obtaining the convolution S = 
(S′).</p>
    </sec>
    <sec id="sec-3">
      <title>Results</title>
      <p>We illustrate the method efficiency by applicaton to the search of transposons in plant
mitochondrial genomes. We use the well-established results of the search provided by the
Censor software which was carried out at the Siberian Federal University as a diploma project
[3]. Transposon is defined as a chromosomal segment which can undergo transposition,
especially in a bacterial DNA that can be translocated as a whole between the chromosomal,
phage, and plasmid DNA in the absence of a complementary sequence in the host DNA. The
typical length of the transposon ranges from 30 to 500 nucleotides. Meanwhile, the typical
length of a mitochondrial DNA of a plant is about ∼ 10 nucleotides. Fig. 1(a) shows the total
pattern, for the entire chromosome, and Fig. 1(b) shows the detailed site of the exact matching
transposon. InDel detection with the convolution comparison technique is shown in Fig. 1(e)
(the total pattern, for the entire chromosome), and in Fig. 1(f) (the detailed site of the InDel
mismatch). Figs 1(c) and 1(d) show the total (left) and the detailed (right) patterns for the case
of 18 point mismatches.
Since the convolution yields the sequence  +  − 1 symbols long, then two
essential problems arise: the former is localization, and the latter is signal/noise
distinction [6]. Let us explain the first problem in few detail. Suppose, there is a
common subsequence of the length  ≈ √ , where  = min{ ,  }. Then, the peak
indicating the exact (or highly likely) coincidence of two copies of the subsequence
appears somewhere at the convolution. The point is that the exact location of this
highly scored coincidence could be located within the resulting convolution with
accuracy of ± , depending on the location of a copy of the subsequence in each
sequence under comparison. To avoid this discrepancy, we illustrate the efficiency of
the method with the search of very small (in terms of the localization problem)
template subsequences that are the transposons.</p>
      <p>Similarly, the noise-to-signal problem is also closely related to the length of the
sequences under comparison. The worst case from the point of view of the signal
deterioration occurs if two sequences of close lengths are compared; again, the
genetic entities we use to illustrate the method allow one to bypass this problem at the
moment.</p>
      <p>Thus, below we provide three typical situations of a search for homology in two
genetic sequences: these are exact matching, subsec. 3.1; point mutations (point
mismatches), subsec. 3.2 and insertion/deletion mismatch, subsec. 3.3. Yet, a
combination of these three situations might bring some problems; thus, some further
studies should address them. To show that all these three types of mismatches can be
detected by the convolution technique, we use Aegilops speltoides mitochondrial
genome (AC NC_022666.1 in GenBank).</p>
      <p>Three different transposons have been tested against the mitochondrial genome
mentioned above. Fig. 1 illustrates the feasibility of the convolution based homology
search for these transposons over the mitochondrial genome. In this figure, the left
subfigures show the entire convolution trend; the right subfigures show the detailed
pattern of the convolution variation at the site of homology.
3.1</p>
      <p>Exact Matching Search
Exact matching search is the classical problem of pure and applied mathematics. A lot
has been done in this area. Figs. 1(a) and 1(b) show the case of exact matching search.
Due to the low resolution of the picture (the convolution total length is about 455 000)
a point diagram is used in the left part (i. e., for the total convolution trend); the red
dot shows the location of the site exactly matching the transposon. Fig. 1(b) shows an
inset with the convolution, so that only 200 values are shown which are presented in
bars. Obviously, the jump in the convolution is evident, which proves the feasibility
of the method.
3.2</p>
      <p>Point Mutations
Point mutation search has made great progress in the editing distance methodology [4,
5]. Probably, this type of mutations is the most suitable for alignment and relevant
approaches. Figs. 1(c) and 1(d) show the result of the convolution based search of a
template with 18 point mismatches. Again, Fig. 1(c) shows the entire genome, and the
red dot indicates the location of the highest homology to the transposon. Fig. 1(d)
shows the detailed pattern of the convolution behavior; here the red bar represents the
coincidence of the template and the site in the genome.
3.3</p>
      <p>Insertion/Deletion
This is the hardest mismatch type from the point of view of detection with regular
alignment tools. Figs. 1(e) and 1(f) show the result of the convolution calculation to
detect the transposon. Note that the location of the site corresponding to the
transposon is absolutely the same, as in the case of the exact search (see Figs. 1(a) and
1(b)). It should be said that here we tested another transposon differing in two
insertions.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Discussion and Conclusion</title>
      <p>Here, we present a new method of the homology search in symbol sequences for
genetic applications. The method is based on the convolution calculation for digital
sequences obtained from the symbol ones through special transformation. The method
enables an innovative application of the well-known Fourier transform to dramatically
speed up computations for important class of bioinformatics problems.</p>
      <p>The results shown above demostrates the feasibility and efficiency of the new
method to search for homologies in extended genetic sequences. Certainly, the
method could be applied for the analysis of sequences of any nature ranging from
linguistics to financial time series. Meanwhile, some further improvements are
expected: signal/noise discrimination and localization of the site with the homology
are the most challenging ones among them.</p>
      <p>Also, it should be stressed that the method allows coarse grained parallelism:
1. the sequences P and Q where ν runs A, C, G and T could be treated
simultaneously, and in parallel;
2. similarly, the greater is the number of the sequences to be compared pairwise, the
faster could be the software implementation of the method;
3. parallelism grows up, as the capacity of an alphabet increases. Indeed, for amino
acid sequences (that is very important in a number of applications), parallelism
may accelerate the methods ten times and faster;
4. finally, very long biological sequences (up to 10 symbols) could be treated by
parts, with the subsequent concatenation of the convolutions.</p>
      <p>The detailed discussion of these issues falls beyond the scope of this paper.</p>
      <p>Acknowledgments. This work is supported by the Krasnoyarsk Mathematical
Center and financed by the Ministry of Science and Higher Education of the Russian
Federation in the framework of the establishment and development of regional
Centers for Mathematics Research and Education (Agreement No.
075-02-20201631).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Kawam</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Khatri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Datta</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>A survey of software and hardware approaches to performing read alignment in next generatiob sequencing</article-title>
          .
          <source>IEEE/ACM transactions on computational biology and bioinfirmatics 14(6)</source>
          ,
          <fpage>1202</fpage>
          -
          <lpage>1213</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Kaur</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sohi</surname>
          </string-name>
          , N.:
          <article-title>Comparison of different sequence alignment methods - A survey</article-title>
          .
          <source>International Journal of Advanced Research in Computer Science</source>
          <volume>8</volume>
          (
          <issue>5</issue>
          ) (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Kulishina</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Mobile elements in mitochondrion genomes of Poacea. Bachelor diploma</article-title>
          . Siberian Federal University (
          <year>June 2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Levenshtein</surname>
            ,
            <given-names>V.I.</given-names>
          </string-name>
          :
          <article-title>On perfect codes in deletion and insertion metric</article-title>
          .
          <source>Discrete Mathematics and Applications</source>
          <volume>2</volume>
          (
          <issue>3</issue>
          ),
          <fpage>241</fpage>
          -
          <lpage>258</lpage>
          (
          <year>1992</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Miller</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vandome</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McBrewster</surname>
            ,
            <given-names>J.: Levenshtein</given-names>
          </string-name>
          <string-name>
            <surname>Distance. VDM Publishing</surname>
          </string-name>
          (
          <year>2009</year>
          ), https://books.google.ru/books?id=TTzhQgAACAAJ
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Molyavko</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shaidurov</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Karepova</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sadovsky</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Highly parallel convolution mathod to compare DNA sequences with enforced in/del and mutation tolerance</article-title>
          .
          <source>In: International Work-Conference on Bioinfirmatics and Biomedical Engineering</source>
          . pp.
          <fpage>472</fpage>
          -
          <lpage>481</lpage>
          . Springer (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Ng</surname>
            ,
            <given-names>H.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Luk</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Reconfigurable acceleration of genetic sequence aignment: A survey of two decades of efforts</article-title>
          .
          <source>In: 2017 27th International Conference on Field Programmable Logic and Applications (FPL)</source>
          . pp.
          <fpage>1</fpage>
          -
          <lpage>8</lpage>
          . IEEE (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>X.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>J.X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Xu</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhang</surname>
          </string-name>
          , J.:
          <article-title>A survey of multiple sequence alignment techniques</article-title>
          .
          <source>In: International Conference on Intelligent Computing</source>
          . pp.
          <fpage>529</fpage>
          -
          <lpage>538</lpage>
          . Springer (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>