=Paper=
{{Paper
|id=Vol-3284/1532
|storemode=property
|title=On Compressing Collections of Substring Samples
|pdfUrl=https://ceur-ws.org/Vol-3284/1532.pdf
|volume=Vol-3284
|authors=Golnaz Badkobeh,Sara Giuliani,Zsuzsanna LiptΓ k,Simon Puglisi
|dblpUrl=https://dblp.org/rec/conf/ictcs/BadkobehGLP22
}}
==On Compressing Collections of Substring Samples==
On Compressing Collections of Substring Samples
Golnaz Badkobeh1 , Sara Giuliani2,* , Zsuzsanna LiptΓ‘k2 and Simon J. Puglisi3
1
Goldsmiths, University of London, UK
2
University of Verona, Italy
4
University of Helsinki, Finland
Abstract
Given a string π = π[1..π] of length π, and integers π and π, such that π > π β₯ 2π > 0, we consider
the problem of compressing the string π formed by concatenating the substrings of π of length π starting
at positions π β‘ 1 (mod π). In particular, we provide an upper bound of (2π β π)/π + 2π§ + (π β π) on
the size of the Lempel-Ziv (LZ77) parsing of π, where π§ is the size of the parsing of π. We also show that
a related bound holds regardless of the order in which the substrings are concatenated in the formation
of π. If π is viewed as a genome sequence, the above substring sampling process corresponds to an
idealized model of short read DNA sequencing.
Keywords
Lempel-Ziv, LZ77, data compression, strings, repetitiveness, combinatorics on words, parsing, short
reads
1. Introduction
We consider the problem of compressing a set of substrings sampled from a string. In particular,
given a string π of length π and two integer parameters π and π, π β₯ 2π, we call a sample of
π a substring of π of length π starting at any position 1 + π Β· π in π, where π β₯ 0. We refer
to the samples as ππ = π[(π β 1) Β· π + 1..(π β 1) Β· π + π], for π β₯ 1, and to the concatenation
as π = π1 π2 Β· Β· Β· ππ , where π = β(π β π)/πβ + 1. Note that if πβππ is not an integer, then the
final few characters of π will not be part of any sample.
If π is viewed as a genome sequence, the above substring sampling process corresponds to
an idealized model of short read DNA sequencing. In the language of genome sequencing, π is
the read length and π/π is the so-called coverage (the number of samples that cover a given
position in π, on average). Our assumption that π β₯ 2π corresponds to a coverage of at least
2, which is the relevant case for DNA sequencing. π represents a file of short read sequences
β the typical output of a sequencing experiment. Our sampling process idealizes short read
sequencing in at least two ways. Firstly, short read sequencing may produce strings of slightly
different length and may introduce errors β insertions, deletions, and substitutions of letters β
to the sampled strings, albeit with fairly low probability for present-day short read technology
Proceedings of the 23rd Italian Conference on Theoretical Computer Science, Rome, Italy, September 7-9, 2022
*
Corresponding author.
" g.badkobeh@gold.ac.uk (G. Badkobeh); sara.giuliani_01@univr.it (S. Giuliani); zsuzsanna.liptak@univr.it
(Zs. LiptΓ‘k); simon.puglisi@helsinki.fi (Simon J. Puglisi)
Β© 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
(π < 0.01 for Illumina short reads, for example). Secondly, in short read sequencing, coverage
is not completely uniform, fluctuating across the genome for a variety of reasons (see, e.g. [1]).
The extraordinarily wide adoption of high-throughput sequencing in medical and evolution-
ary biology over the last decade has made short read data sets abundant. These data sets are also
very large. For example, a typical human sequencing experiment might run at 20x coverage on
a underlying genome of size π = 3 Β· 109 nucleotides. The resulting read set in FASTQ format (a
standard file format, which stores one ASCII-encoded short read sequence per lineβakin to our
π string) is then 60 gigabytes in size. The de facto standard in most labs (and large institutions
such as, e.g., the NCBI) is to compress such files with the gzip all-purpose file compressor, which
usually leads to a factor four reduction in size1 , or 15GB in our human sequencing example. A
gzipβd large read set is thus, alas, still relatively large.
With the rapid growth in, and the need to store, short read data sets, specialized compressors
that exploit properties inherent to such data sets will become paramount. Several read set
specific compressors have now been developed (see, e.g., [2, 3, 4, 5]). None are yet in wide
use. However, to our knowledge, no careful analysis of the compressibility of short read data
setsβeven in an idealized setting such as that described aboveβhas been undertaken. This
article addresses that need. In particular, we derive a non-trivial upper bound on the size of the
LZ parsing [6, 7] of π, the concatenation of sampled substrings, in terms of π, π, π and the size
of the LZ parsing of π. We also show a different upper bound that holds regardless of the order
in which the samples are concatenated to form π.
In the next section we set notation and basic concepts and results used throughout. In
Sections 3 and 4 we establish the above mentioned bounds, and in Section 5 we gauge the
tightness of these bounds experimentally. We then sketch several directions for future work.
2. Preliminaries
Throughout we consider a string π = π[1..π] = π[1]π[2] . . . π[π] of |π| = π symbols
drawn from an ordered alphabet Ξ£ of size |Ξ£| = π. For π = 1, . . . , π, we write π[π..π] to denote
the suffix of π of length π β π + 1, that is, π[π..π] = π[π]π[π + 1] . . . π[π]. We will often
refer to suffix π[π..π] simply as βsuffix πβ or the βπth suffixβ. We write π[1..π] = π[1] . . . π[π]
to denote the prefix of π of length π. We write π[π..π] to represent the substring (or factor)
π[π]π[π + 1] . . . π[π] of π that starts at position π and ends at position π. If π > π, then
π[π..π] = π, where π is the empty string. Let lcp(π, π) denote the length of the longest common
prefix of suffix π and suffix π.
For example, in the string π = zzzzzipzip, lcp(2, 5) = 1 = |z|, and lcp(5, 8) = 3 = |zip|. For
technical reasons we define lcp(π, 0) = lcp(0, π) = 0 for all π.
Definition 1 (LZ Factorization). The LZ factorization of π is a factorization π = π1 π2 . . . ππ§π
of π into π§π phrases such that each phrase ππ (a substring of π) is either
1. a letter that does not occur in π1 Β· Β· Β· ππβ1 , or
1
This can be loosely interpreted as gzip, a sliding-window dictionary compressor with window size too small to
capture any large dispersed repeated substrings present in the file, essentially reducing the space used by each
DNA letter from the 8 bits used in the plain ASCII encoding to the 2 bits that a flat minimal binary code for four
letters would use.
2. the longest substring that occurs at least twice in π1 Β· Β· Β· ππ .
Thus, the LZ factorization of our example string π = zzzzzipzip produces the following
π§π = 5 factors, π1 = z, π2 = zzzz, π3 = i, π4 = p, π5 = zip.
We denote with βπ = βοΈ|ππ | the length of phrase ππ , and with π π the starting position of phrase
ππ in π, i.e., π π = 1 + π<π βπ . Finally, we denote with ππ the position of the first occurrence of
substring ππ in π and we call substring π[ππ ..ππ + βπ β 1] the source of ππ . Note that phrases
and sources are allowed to overlap, as is the case with π2 in our example.
The following is a known upper bound on the number of phrases in the parsing.
Theorem 1 ([8], Theorem 5.20). Let π be a string of length π over Ξ£, with |Ξ£| = π. Then
π§π β€ π, where
π β (π/(π β 1))
π= .
logπ π β logπ logπ π β (1/(π β 1))
We will return to the above bound later in the paper, but for now we note that it is asymp-
totically tight. In particular, an appropriate prefix of the de Bruijn sequence contains at least
π/βlogπ πβ LZ phrases [8].
We close this section with another well-known property of the LZ parsing we make use of in
the proof of our main theorem.
Fact 1. Let π be a string, and 1 < π β€ π β€ |π |. If π‘ = π [π..π] has an occurrence before π, i.e., if
there exists an πβ² < π s.t. π [πβ² ..πβ² + |π‘| β 1] = π‘, then the interval [π, π] can contain at most one
starting position of a phrase.
3. Upper Bound on the Number of LZ Phrases of the
Concatenation of Samples
In this section, we show an upper bound on the number of LZ phrases of string π formed by
concatenating samples from string π.
Formally, given a string π of length π and two integer parameters π, π, such that π β₯ 2π,
let π = π1 π2 Β· Β· Β· ππ , where π = β(π β π)/πβ + 1, and, for π β [1..π], ππ = π[(π β 1) Β· π +
1..(π β 1) Β· π + π].
Let us write, for π β₯ 1, ππ = π£π π₯π , where |π£π | = π β π and |π₯π | = π. Then π and π can be
written as follows, where |π’| < π:
π = π£1 π₯1 π₯2 Β· Β· Β· π₯π π’, (1)
π = π£1 π₯1 π£2 π₯2 π£3 π₯3 Β· Β· Β· π£π π₯π . (2)
We will now count the number of phrases π§π of the LZ parsing of string π. Note that this is
equivalent to counting the number of starting positions of phrases.
Lemma 1. Let ππ and ππ denote the beginning resp. ending position of the π£π βs in the factorization
of π given in (2). Then, for π > 1, the interval [ππ , ππ ] can contain at most one starting position of a
phrase.
Proof. Since two consecutive samples ππ and ππ+1 overlap by π β π characters, it follows that,
for all π > 1, ππ = π¦π π£π+1 , where π¦π is the π-length prefix of ππ . Therefore, π contains the square
π£π π£π for every π > 1, and ππ is the start of the second occurrence of π£π in this square. By Fact 1,
therefore, [ππ , ππ ] can contain at most one starting position.
Next we will count the number of starting positions in the π₯π βs. For this, we consider phrases
π of the LZ parsing of π, and count how many starting positions these induce in π in the worst
case. We first need the definition of the projection of a substring of π on π (see also Figure 1).
Definition 2. Let 1 β€ π β€ π β€ π. We define the projection of substring π[π, π] on π as a
collection of substrings in π as follows: For π₯π , let ππ and ππ denote the starting resp. ending positions
of π₯π in π w.r.t. the factorization given in (1). Then
β§ βοΈ
βͺ
βͺ
βͺ ( ππ=π [ππ β π, ππ]) βͺ [(π β 2) Β· (π β π) + π, (π β 1)π]βͺ
βͺ
β¨[ππ + π β π + 1, π(π β π) + π] if π β π < π
π ππππ ([π, π]) =
βͺ[π, π]
βͺ
βͺ if π, π β€ π β π
βͺ
β©[π, π β π] βͺ π πππ [π β π + 1, π] if π β€ π β π < π.
π
Informally, a projection in π of a substring π of π is the collections of substrings of π
coinciding with regions of π , namely substrings of π which π consists of, w.r.t. the factorization
given in (1). The first case (see Fig. 1) gives the general situation, when π starts after the prefix
π£1 of π, which is covered only by the first sample π1 . The second case is when π lies fully
within π£1 , while the third case is when π starts within π£1 and ends after it.
π[π, π] =
π = π£1 π₯1 ... π₯πβ1 π₯π ... π₯π ... π₯π π₯π+1 ... π₯π
π ππππ ([π, π]) =
π = ... π£πβ1 π₯πβ1 π£π π₯π . . . π£π π₯π . . . π£π π₯π π£π+1 π₯π+1 . . .
Figure 1: The projection of the substring π[π, π] on the string π is shown. The number of substrings of
π contained in the collection of substrings produced by the projection is the number of π₯π βs intersected
by π[π, π] in π, and they are all contained in the corresponding π₯π βs in π.
Definition 3. Let π be a phrase of the LZ parsing of π, with starting position π and length β.
Define π(π ) as the number of starting positions in π ππππ ([π , π + β β 1]).
Lemma 2. Let π β₯ 2π. Let π be a phrase of the LZ factorization of π, with starting position
π > π β π. Then π(π ) β€ |ππ| + 2.
Proof. Let β = |π |, π = β πβ β and π = π[π ..π + β β 1] = π₯β² π₯π π₯π+1 Β· Β· Β· π₯π π₯β²β² , where π₯β² and π₯β²β² are
a proper suffix of π₯πβ1 respectively a proper prefix of π₯π+1 , both possibly empty. We will show
that each of these substrings is charged with at most one phrase starting position. From Fact 1,
the claim follows.
By construction of π, each of the substrings π₯β² , π₯π , π₯π+1 , . . . , π₯π , π₯β²β² will appear contiguously
in π. The number of these substrings is either π or π + 1. Additionally, a π£ substring separates
the projections in π of each pair of contiguous aforementioned substrings of π.
Consider now the source π β² of π occurring in π in some position π β² < π . Then π[π ..π +ββ1] =
π[π β² ..π β² + β β 1] = π’β² π₯πβ² π₯πβ² +1 Β· Β· Β· π₯π β² π’β²β² , where π’β² and π’β²β² are a proper suffix of π₯πβ² β1 respectively
a proper prefix of π₯π β² +1 , both possibly empty. As for π , the projection of π β² is also split in π in
such a way that the projection of each pair of mentioned substrings of π β² is separated by a π£
substring in π.
Notice that, since π β₯ 2π, each π₯π in π has an occurrence in π also as suffix of π£πβ² +1 ,
occurring immediately after π₯π+1 in π. This means that, even if the projections of π and π β² in π
will be split asynchronously, each of the substrings π₯β² , π₯π , π₯π+1 , Β· Β· Β· , π₯π , π₯β²β² in the projection of
π has already occurred as the concatenation of a suffix of some π£πβ² intersecting the projection
of π β² and the contiguous π₯πβ² +1 .
There are at most π + 1 factors π₯β² , π₯π , π₯π+1 , . . . , π₯π , π₯β²β² , and each of them has a previous
occurrence in π. Therefore, by Fact 1, there will be at most π + 1 phrase starting positions for
π . See Fig. 2 for an illustration.
π β² = π[π, π] π
π= π£1 π₯1 . . . π₯πβ1 π₯π π₯π+1 π₯π+2 . . . π₯πβ1 π₯π π₯π+1 π₯π+2 ... π₯π π’
π ππππ ([π, π])
π₯πβ1
π= π£1 π₯1 ... π₯πβ1 π£π π₯π π£π+1 π₯π+1 π£π+2 π₯π+2 . . .
|ππ | β₯ 2|π₯π |
Figure 2: The original string π on top, and the concatenation π of the π samples of π below are shown.
In particular, a phrase π and its corresponding source π β² in π are represented with distinct colors for
each of the π₯π segments of π intersected by the phrase. Finally, the projection π ππππ (π β² ) of the source
is shown. It is clear from the figure that, in π β² , the samples intersecting some string in the projection of
π β² fully contain at least one substring of the projection of π .
Lemma 3. With respect to the factorization of π given in (2), the number of phrase starting
positions in π₯π βs is at most ππ + 2π§π .
Proof. The sum of the lengths of all phrases π1 , . . . , ππ§π in the LZ factorization of π is the
length π of the string π. Therefore, we can bound the total contribution to π§π of π as follows:
π§π π§π
βοΈ βοΈ |ππ | π
π(ππ ) β€ ( + 2) = + 2π§π .
π π
π=1 π=1
Theorem 2. Let π§π be the number of phrases of the LZ parsing of π, and π§π the number of
phrases of the LZ parsing of π. Then π§π β€ 2πβπ
π + 2π§π + π β π.
Proof. We show the maximum number of phrase starting positions in π summing up the
contribution of the (π β π)-length prefix of π, and of the remaining π₯π βs (Lemma 3) and π£π βs
(Lemma 1) substrings.
π§π = number of starting positions in π£1 + number of starting positions in π₯π βs
+ number of starting positions in π£π βs, for π β₯ 2
π πβπ 2π β π
β€ (π β π) + + 2π§π + = + 2π§π + π β π.
π π π
Theorem 2 essentially says that the number of LZ phrases of π is at most twice the number
of samples plus twice the number of LZ phrases of π. Note that the important parameter which
determines the number of samples is π, while π influences only the number of samples in
which a given position occurs (i.e. π/π is the so-called coverage).
4. Upper Bound for Arbitrary Concatenation Order
This section examines the effect that the ordering of the samples in the concatenation has on
the number of phrases.
As before, we are given a string π of length π and two integer parameters π and π, such that
π β₯ 2π. Let π = β(π β π)/πβ + 1, and, for π β [1..π], ππ = π[(π β 1) Β· π + 1..(π β 1) Β· π + π].
We will show that, regardless of the order in which the samples ππ of π are concatenated,
the number of phrases in the LZ factorization of that concatenation is at most π + 2(πβπ)
π . We
make this argument precise below.
Theorem 3. Let π β² be the concatenation of the samples of π in any order, then the number of
phrases is π§π β² β€ π + 2(πβπ)
π .
Proof. Fix π. We will show that the number of phrase starting positions in sample ππ where it
appears in π β² is at most 2 + |π’π |, where π’π is a specific substring of ππ . Let π = max{πβ² < π |
ππβ² appears before ππ in π β² }, and let π€π be the longest suffix of ππ which is also a prefix of ππ
(i.e., π€π is the maximum overlap). Note that π€π may be empty. Similarly, let π β² = min{πβ² > π |
ππβ² appears before ππ in π β² }, and let π€πβ² be the longest prefix of ππβ² which is also a suffix of ππ ,
again possibly empty. If |π€π | + |π€πβ² | β₯ π = |ππ |, then set π’π = π. Otherwise, ππ can be written
as ππ = π€π π’π π€πβ² , for some π’π .
This π’π is a substring of π that has not so far been covered by any sample in π β² , and this is
because of the definition of π and π β² . We call π’π the new part of ππ ; in particular, if π’π = π, then
the new part of ππ is empty.
By Fact 1, if π€π is non-empty, then at most one phrase starting position is contained within
π€π . Similarly, if π€πβ² is non-empty, at most one starting position is contained within π€πβ² . The
number of starting positions within the new part π’π can be trivially upper bounded by |π’π |.
π = π₯πβπ‘ π₯π π₯π π₯π β² π₯π+π‘ ...
ππβπ‘ = ...
ππ =
...
ππ =
...
ππβ² =
...
ππ+π‘ =
ππ β² ππ ππ
β² ... ... ... π’π ...
π =
Figure 3: The contribution of the samples of π to π§π β² , where π β² is the concatenation of the samples in
an arbitrary order. The colored substrings are the prefixes and suffixes with multiple occurrences in π β²
of some sample. Each sample consists of a prefix and a suffix (possibly empty) that has already occurred
in π β² , and a substring in between them (i.e., labelled π’π , in white) that is not assumed to necessarily
occur previously in π β² .
Summing over all samples ππ , we thus get
π
βοΈ π
βοΈ
π§ πβ² β€ (2 + |π’π |) = 2π + |π’π | = 2π + π,
π=1 π=1
with the last equality using the fact that every position of π occurs exactly once in some π’π .
Theorem 3 essentially says that the number of LZ phrases of π β² , i.e. of the concatenation of
the samples in an arbitrary order, is at most the length of π plus twice the number of samples.
5. Experimental Results
In order to gauge the tightness of our bounds, we computed the number of phrases in the
conventional LZ factorization (defined in Section 2) of the concatenation of the samples taken
from each of the texts in Table 1. We did this for a range of π and π parameters, and concatenated
the samples both in string order and after a random shuffling.
5.1. Data
Our test data, which contains files of varying repetitiveness is shown in Table 1.
By nature, viruses contain very little recurrent genetic heritage, and so a viral genome
represents a real-world non-repetitive string. We used a genome of SARS-CoV2 taken from
the COVID-19 Data Portal [9] of length 29 836, that is factorized in 4 373 LZ phrases. We also
performed experiments on extreme cases between which real-life genomes lie: Fibonacci words
and random words.
Data Description π π§ π/π§
SARS-CoV2 Taken from the COVID-19 Data Portal [9] 29 835 4373 6.8
Concatenation of 50 virus genomes
50 SARS-CoV2 [9] 1 490 134 5421 275
taken from the COVID-19 Data Portal
Fibonacci word Fibonacci word of order 22 28 657 22 1302.6
Word over an alphabet of size 4 built with
Random 29 835 4575 6.5
python function random.choices()
Table 1
Data used in the experiments. The table shows the length (π) and the number of phrases (π§) of each
text used for the experiments.
Let π 0 = b, π 1 = a, the Fibonacci word of order π + 1 is the binary word π π+1 = π π π πβ1 . In
other words, the Fibonacci word of order π + 1 is the concatenation of the Fibonacci words of
the two previous orders.
By construction, Fibonacci words have a very high degree of repetition, resulting in very few
phrases with respect to their length. Random words, on the other hand, could be considered,
instead, not repetitive at all. To perform a comparison with the virus genome, we chose a
random word of the same length of the genome, and the Fibonacci word of length 28 657, the
closest to the length of the genome. The strings are factorized in 4 575 respectively 22 phrases.
We also performed experiments with larger data. In particular, we counted the number of
phrases of the concatenation of 50 SARS-CoV2 genomes, which, due to the high similarity of
the individual genomes, constitutes a highly repetitive dataset.
5.2. Experiments
We are interested in simulating the coverage provided by the most used technologies in genome
sequencing. The coverage is given by the number of samples that cover a given position in the
text. In the context of genome sequencing, a reasonable coverage is given by large π and small
π, in order to have the coverage as large as possible with reasonable sample lengths.
We perform the experiments on each of the aforementioned texts with π =
1, 2, 4, 8, 16, 32, 64, and π from 50 to 1 000, in increments of 10. We counted the number
of phrases for π > π.
Figure 4, on top, displays the number of phrases for concatenations of samples in string
order of a Fibonacci word (top-left corner), and of a random string of a similar length (top-right
corner). Below, we show the counts for an arbitrary ordered concatenation of the samples
of the same data. In all figures, the number of phrases for some selected πβs are shown in
distinct colours, in gray for all other πβs. The corresponding coloured line shows our bounds
for each π and π pair. Finally, the colored rounded points show the existing bound given by
KΓ€rkkΓ€inen [8], see Theorem 1.
The analogous comparison is shown in Figure 5 between a single SARS-CoV2 genome and
the concatenation of 50 genomes.
The overlapping of the bound lines in all plots reflects the small impact of the sampling length
π in the bound for fixed π.
When the samples are concatenated in string order (on the top of both Figure 4 and 5), the
number of phrases in the original string has a big influence on the bound. We can see that the
bound lines in the Fibonacci wordβs plot are closer to the actual counts than in the other plots,
where the number of phrases of the original strings is higher. On the other hand, because of the
different nature of the bound for the samples in string order versus random order, we can see
that the latter bound has a similar trend for the three strings of similar length. In this case, the
length and the number of samples of the original string determine the bound rather than its
number of phrases.
Comparing the bound given in this paper (lines) to the one reported in Theorem [8] by
KΓ€rkkΓ€inen (rounded points), when repetitive strings are considered, our bound is not worse
than the existing one for the string order concatenation, while it gets more loose with the
concatenation in arbitrary order. See the plots for Fibonacci words and the concatenation of 50
genomes of SARS-CoV-2. On the other hand, for non repetitive strings, namely random strings
and the single viral genome in the plots, the existing bound is often better than ours.
Data π=1 π=2 π=4 π=8 π = 16 π = 32 π = 64
Fibonacci
max π 1000 980 990 970 960 960 940
phrases 1336 1321 1308 1021 1007 910 603
bound 57 357 29 189 15 111 8049 4510.1 2733.1 1800.8
Fibonacci
shuffled
max π 1000 990 990 990 630 970 980
phrases 25 164 13 179 6802 3505 1802 942 521
bound 83 971 56 324 42 490.5 35 573.75 32 160.4 30 387.4 29 521.906 25
SARS-CoV2
max π 80 150 50 70 50 90 210
phrases 44 438 27 823 14 880 8945 6759 5575 4973
bound 68 417 38 655 23 697.5 16 258.25 12 506.38 10 665.93 9821.09
SARS-CoV2
shuffled
max π 200 260 350 540 780 680 760
phrases 45 725 27 898 17 538 11 620 7969 6142 5238
bound 89 108 59 412 44 574 37 185 33 468 31 658.25 30 744.63
Table 2
A summary of relevant results for the Fibonacci word and the single SARS-CoV2 genome. For each
sampling frequency π, we report the value of π for which the maximum number of phrases in the
concatenation of the samples is produced in both string order and after the random shuffling. We
further show the counts and the value of our bound for the mentioned π.
In Table 2 we show, for fixed π, the maximum number of phrases in π, varying π. For
strings π that are already very repetitive (Fibonacci word), the longer the string, the higher the
number of phrases. On the other hand, for strings that are not that repetitive (single SARS-CoV2
genome), introducing long repetitions may decrease the number of phrase starting positions
in contrast to having a shorter string with very short repetitions. The concatenation of 50
SARS-CoV2 genomes lies in the middle.
(a) Fibonacci word of length 28 657 (b) Random word of length 29 835
Figure 4: The number of phrases in log scale for concatenation of samples of a Fibonacci word (left
column) and a random word (right column), both in string order (on top) and in an arbitrary chosen
order (on bottom). The counts are shown for each concatenation of π-length samples at every π
position. Colored markers indicate the number of phrases for π = 50, 100, 200, 400, 1000, while we
use grey points to mark all others πβs. The bounds shown in Theorem 2 and 3 for the concatenation
in string order respectively random order are shown with colored and shaped lines accordingly to the
corresponding π, π pair, while the coloured rounded points indicate the bound given by KΓ€rkkΓ€inen [8],
see Theorem 1.
6. Concluding Remarks
This paper has explored the compressibility of collections of substrings sampled from a string.
In particular, given a string π = π[1..π] of length π with an LZ parsing size of π§π , and integers
π and π, such that π > π β₯ 2π > 0, we have shown that the size of the LZ parsing of the string
(a) SARS-CoV2 genome of (b) Concatenation of 50 SARS-CoV2 genome, of total
length 29 835 length 1 490 134
Figure 5: The number of phrases in log scale for concatenation of samples of a single SARS-CoV2 genome
(left column) and of a concatenation of 50 SARS-CoV2 genomes (right column), both in string order
(on top) and in any arbitrary chosen order (on bottom). The counts are shown for each concatenation
of π-length samples at every π position. Colored markers indicate the number of phrases for π =
50, 100, 200, 400, 1000, while we use grey points to mark all others πβs. The bounds shown in Theorem 2
and 3 for the concatenation in string order respectively random order are shown with colored and
shaped lines accordingly to the corresponding π, π pair, while the coloured rounded points indicate the
bound given by KΓ€rkkΓ€inen [8], see Theorem 1.
π formed by concatenating the substrings of π of length π starting at positions π β‘ 1 (mod π),
is bounded by (2π β π)/π + 2π§ + (π β π). We also proved a bound for the case of any arbitrary
chosen order of the samples in the concatenation.
There are several avenues future work could take. The most immediate perhaps is the question
of whether the bounds given in Theorem 2 and Theorem 3 can be improved. Another direction
is to derive bounds for other compression measures, such as the size of the smallest context-free
grammar for π [10], the number of runs in its Burrows-Wheeler transform [11], the size of
its smallest string attractor [12], or other measures of compressibility discussed in Navarroβs
recent survey [13].
Along the lines of our original motivation from DNA sequencing, how are the bounds affected
by the introduction of some probability of error to the sample substrings, such as those errors
introduced in collections of strings produced by short-read sequencing technologies?
Finally, note that we have assumed π β€ π/2, which corresponds to the interesting case in
practice. However, it may be interesting from a theoretical perspective to also examine the case
where π > π/2.
References
[1] R. Ekblom, L. Smeds, H. Ellegren, Patterns of sequencing coverage bias revealed by
ultra-deep sequencing of vertebrate mitochondria, BMC Genomics 15 (2014) 467.
[2] S. Al Yami, C.-H. Huang, LFastqC: A lossless non-reference-based FASTQ compressor,
PLoS One 14 (2019) e0224806.
[3] S. Chandak, K. Tatwawadi, I. Ochoa, M. Hernaez, T. Weissman, SPRING: a next-generation
compressor for FASTQ data, Bioinformatics 35 (2019) 2674β2676.
[4] S. Deorowicz, FQSqueezer: k-mer-based compression of sequencing data, Scientific
Reports 10 (2020) 1β9.
[5] C. Hoobin, T. Kind, C. Boucher, S. J. Puglisi, Fast and efficient compression of high-
throughput sequencing reads, in: Proceedings of the 6th ACM Conference on Bioinfor-
matics, Computational Biology and Health Informatics, 2015, pp. 325β334.
[6] A. Lempel, J. Ziv, On the complexity of finite sequences, IEEE Trans. Inf. Theory 22 (1976)
75β81.
[7] J. Ziv, A. Lempel, A universal algorithm for sequential data compression, IEEE Trans. Inf.
Theory 23 (1977) 337β343.
[8] J. KΓ€rkkΓ€inen, Repetition-Based Text Indexes, Ph.D. thesis, University of Helsinki, Faculty
of Science, Department of Computer Science, 1999.
[9] P. W. Harrison, R. Lopez, N. Rahman, S. G. Allen, R. Aslam, N. Buso, C. Cummins, Y. Fathy,
E. Felix, et al., The COVID-19 Data Portal: accelerating SARS-CoV-2 and COVID-19
research through rapid open access data sharing, Nucleic Acids Research 49 (2021) W619β
W623.
[10] M. Charikar, E. Lehman, D. Liu, R. Panigrahy, M. Prabhakaran, A. Sahai, A. Shelat, The
smallest grammar problem, IEEE Trans. Inf. Theory 51 (2005) 2554β2576.
[11] G. Manzini, An analysis of the Burrows-Wheeler transform, J. ACM 48 (2001) 407β430.
[12] D. Kempa, N. Prezza, At the roots of dictionary compression: string attractors, in: Proc.
50th Annual ACM SIGACT Symposium on Theory of Computing (STOC), ACM, 2018, pp.
827β840.
[13] G. Navarro, Indexing highly repetitive string collections, part I: repetitiveness measures,
ACM Comput. Surv. 54 (2021) 29:1β29:31.