Volume 15 Supplement 15

Proceedings of the 2013 International Conference on Intelligent Computing (ICIC 2013)

Open Access

Compression of next-generation sequencing quality scores using memetic algorithm

BMC Bioinformatics201415(Suppl 15):S10


Published: 3 December 2014



The exponential growth of next-generation sequencing (NGS) derived DNA data poses great challenges to data storage and transmission. Although many compression algorithms have been proposed for DNA reads in NGS data, few methods are designed specifically to handle the quality scores.


In this paper we present a memetic algorithm (MA) based NGS quality score data compressor, namely MMQSC. The algorithm extracts raw quality score sequences from FASTQ formatted files, and designs compression codebook using MA based multimodal optimization. The input data is then compressed in a substitutional manner. Experimental results on five representative NGS data sets show that MMQSC obtains higher compression ratio than the other state-of-the-art methods. Particularly, MMQSC is a lossless reference-free compression algorithm, yet obtains an average compression ratio of 22.82% on the experimental data sets.


The proposed MMQSC compresses NGS quality score data effectively. It can be utilized to improve the overall compression ratio on FASTQ formatted files.


DNA sequencing provides fundamental data for many research areas e.g. genomics, bioinformatics, and biology [1]. Rapid progress has been made for DNA sequencing technologies, especially the high-throughput next-generation sequencing (NGS), in the last few years. Newly proposed high efficiency methods significantly stimulate the production and usage of NGS data [2]. However the exponential growth of NGS data poses huge challenge to data storage and transmission [3]. Thereby efficient compression algorithms are required.

General-purpose compression algorithms e.g. gzip and bzip2 usually fail to obtain satisfactory results on NGS data, because they are designed for ordinary plain text or binary files. To achieve higher compression ratio, many specialized methods are proposed. For instance, Cox et al. [4] proposed a Burrws-Wheeler transform based compression algorithm for large scale DNA sequence databases. Jones et al. [5] presented Quip, a high efficient reference-based NGS data compression tool relying on external reference genomes or light-weight de novo assembly to generate reference sequences from the target data. Popitsch et al. [6] proposed the NGC tool for SAM format files compression. Hach et al. [7] proposed SCALCE by introducing locally consistent parsing in data encoding. More comprehensive review on NGS data compression can be found in [8, 9].

Typically, raw NGS data includes a series of sequencing records (called reads). Each record consists of three major components: a metadata containing the read name, platform, and other useful information; a DNA sequence read obtained from one fold of the oversampling; and a quality score sequence estimating accuracies of the corresponding DNA bases. Existing algorithms usually focus on the compression of DNA sequence reads, and utilize conventional methods e.g. Huffman coding and run-length encoding (RLE) to compress quality scores [10]. Quality score data is considered more important than the metadata, and usually occupies similar or even more space than the DNA sequences. It may pose bigger challenges for compression than DNA sequence reads, due to the larger alphabet size. By introducing compressor specific for NGS quality scores, the overall compression ratio of NGS data can be further improved.

In this paper, we propose a memetic algorithm (MA) based NGS quality scores compression algorithm, namely MMQSC. The algorithm consists of three major parts: a Huffman coding based preprocessing is conducted in the first place, followed by MA based encoding codebook design. Finally, quality score data is compressed by using the codebook. MA is widely known as a synergy of population-based evolutionary algorithm and local search or individual learning procedures. MAs are capable of solving various complex optimization problems more effectively than their conventional counterparts [11]. In this work, the self-adaptive differential evolution combining with neighborhood search (SaNSDE) [12], and Davies, Swann, and Campey with Gram-Schmidt orthogonalization (DSCG) [13], or SaNSDE-DSCG for short, are introduced to MMQSC, to optimize the NGS quality scores compression codebook, with which most repetitive short score segments are identified and represented with much shorter encoding.

In conventional MAs, each individual represents a candidate solution of the entire problem, i.e., compression codebook. Its optimization is highly complex, because the codebook consists of hundreds of quality score symbols. Multimodal optimization tries to find all or most of the multiple solutions within a population in a single simulation run [14]. Based on multimodal optimization, the MMQSC uses an individual to represent only a single specific code vector, and composes codebook with the entire evolution population. Thereby computational complexity distributed to each individual's fitness evaluation is significantly reduced.

The proposed MMQSC obtains promising performance on NGS quality scores stored in the widely used FASTQ format [15]. Experimental results on five representative NGS data sets show that MMQSC obtains better compression ratio than other state-of-the-art methods. Particularly, MMQSC is a reference-free algorithm for lossless compression, yet obtains an average compression ratio of 22.82%, i.e., 1.81 bits per quality value (BPQ) on the experimental data sets.

The remainder of this paper is organized as follows: Section II describes details of the proposed MMQSC compression algorithm. Section III presents the experimental results of MMQSC on the five real-world NGS data sets. Finally, a conclusion is provided in Section IV.


SaNSDE and DSCG based memetic algorithm for multimodal optimization

MA is introduced whereby the concept of "meme", which was coined by Dawkins [16], is employed within an evolutionary computation framework to improve search efficiency. Typically, MA utilizes a population-based global optimization as fundamental framework, and introduces separate local searches or 'memes' embedded in each generation of the global evolution to refine the population [17]. The procedure of a canonical MA framework is illustrated in Algorithm 1 [18].

In MAs both global search and local search strategies can be selected flexibly according to the target problem. Typically, NGS data consists of thousands or even millions of read entries, wherein each of them contains hundreds of quality score symbols. Finding a codebook for compressing such data is naturally a high-dimensional optimization problem. Differential evolution (DE) [19] is capable of solving large scale problems effectively. In this paper, a high performance DE variant namely the SaNSDE is utilized as the global optimizer. Particularly, SaNSDE uses three self-adaptive mechanisms to select mutation strategies and control parameter values. By introducing neighborhood search in the optimization process, SaNSDE obtains higher performance than conventional algorithms. Moreover, the widely-used local search strategy DSCG is introduced to increase convergence speed. DSCG is a gradient-based optimizer that searches solution space in a greedy manner. Combining the exploration of SaNSDE and exploitation of DSCG, the proposed MA obtains promising performance on quality scores compression codebook design.

As shown in Figure 1, multimodal optimization searches for not only the global best solution gbest (as single-objective optimization), but also all the local optimal pbest i , i = 1, 2, 3... Multimodal optimization has been used in a wide range of applications, because it can locate all or most of the optimal solutions in a single simulation run. Fitness sharing [20] is introduced in the proposed SaNSDE-DSCG to conduct multimodal optimization. Given a raw fitness value f R ( x i ), wherein x i is the candidate solution of individual ps i . Fitness sharing transforms it into shared fitness f S ( x i ) using following equation:
Figure 1

Multimodal optimization.

f S ( x i ) = f R ( x i ) × τ i
in which:
τ i = j p s , j i ( 1 - d i , j ε ) α
where ε is the niching radius, parameter α controls the shape of the sharing function, distance d i,j is defined as:
d i , j = d i s t x i , x j i f d i s t x i , x j ε 0 o t h e r w i s e

where dist( x i , x j ) is the Manhattan distance between x i and x j . If evolution population is gathering in the same optimal region, its shared fitness values will deteriorate significantly to disperse the individuals. By utilizing f S ( x i ) to guide the search process, SaNSDE-DSCG is capable of finding all optimums effectively.

Compression codebook design using SaNSDE-DSCG

As shown in Figure 2, a NGS quality score sequence is compressed by substituting original scores with the index of its most similar code vector in the codebook, and their corresponding symbol differences.
Figure 2

Codebook based NGS quality score sequences compression.

Given a quality score sequence Q= "CCCGFF' and code vector C= "CCGHFFC". Sequence Q is encoded as {i, Q}, where i is in the index of C, and Q records the symbol differences as:
Q = C C C G - F F - C = C C G H F F C Q * = U U I , "C" U D U U D

in which U denotes symbol matching (unchanged), I stands for insertion (marked with ""), D for deletion (marked with "−"), and S for substitution. For insertions and substitutions, the original symbol should also be recorded (for instance "C" on the third quality score). This matching process is conducted by using dynamic programming (DP).

Data size of the original P-dimensional sequence is L O = 8 × P, because raw quality scores are stored in 8 bits ASCII format. On the other hand, each difference type in {U, I, D, S} takes 2 bits to represent. Thereby the encoded data size is:
L C = l o g 2 ( M ) + 2 × P * + 8 × R

where M is the number of code vectors in a codebook, P denotes length of the symbol differences sequence (i.e. Q), and R is the number of all original symbols recorded for insertions and substitutions. Given the example above, original quality score sequence takes L O = 48 bits of storage, while the encoded data uses only about 24 bits. Usually the encoding process makes L C smaller than L O , i.e., conducts compression. The more the code vector is similar to the original quality score sequence, the higher compression ratio is achieved. That is, quality of the codebook decides the overall compression performance.

In this paper, we utilize the proposed SaNSDE-DSCG to optimize compression codebook design. During the initialization, code vectors in the codebook are generated randomly, and encoded as individuals to form an evolution population. In each fitness evaluation, input candidate solution x i = [x i,1 , x i,2 ,..., x i,N ] is mapped into code vector C i = "s1 s2 ... s N " using the following equation:
s n = S [ x n , n = 1 , 2 , , N
where characters set S includes all unique symbols in the original quality score sequences, variable N is the predefined code vector length. This mapping is conducted because candidate solutions consist of continuous values, while code vectors are discrete symbol strings. The C i is then matched to all quality score sequences, and calculates the corresponding encoded data size. Raw fitness value of x i is defined as:
f R ( x i ) = k K L C ( C i , Q k )

in which K is the total number of quality score sequences, L C ( C i , Q k ) denotes encoded data size on the k th sequence Q k using code vector C i . Small f R ( x i ) indicates that C i is more similar to the original score data, i.e., obtains higher compression ratio. Shared fitness f S ( x i ) is then calculated accordingly.

It is noted that accurate symbol differences information, e.g. mismatched symbol positions, is not necessary for fitness values calculation. In most cases the approximate Levenshtein distance [21] is good enough to guild the codebook optimization process. Moreover, calculation of Levenshtein distance requires much less computational resources than the DP based matching algorithm. By utilizing Levenshtein distance in fitness evaluation, we can achieve similar optimization performance in a relatively high speed. Approximate size of encoded data can be calculated as:
L C = l o g 2 ( M ) + 2 × P k + 4 × l e v ( C i , Q k )

in which P k is the length of Q k , and lev(·) denotes Levenshtein distance between the two input sequences. It's value is multiplied by 4, because there is a half chance (I and S) in {U, I, D, S} needs to record the original quality score. Accurate matching information is obtained only after the codebook design process for actual sequences compression.

Procedure of the SaNSDE-DSCG based compression codebook design algorithm is illustrated in Figure 3. In conventional single-objective optimization based design algorithms, the entire compression codebook is encoded in each individual in the evolution population. Typically, an individual in such methods is constructed by connecting all code vectors in the codebook from end to end, i.e. x i ' = {C1, C2,..., C M } [22]. Optimal codebook is obtained by searching the global best solution. Dimensionality of solution space is M × N, and the algorithm calculates encoded data size (Equ. (8)) for M × N × |ps| time in each generation of the evolution optimization. Its computational complexity is too high to be applied on large NGS data. In contrary, MMQSC searches the solution space by using multimodal optimization, wherein each individual is utilized to represent one specific code vector, and the entire evolution population is utilized to compose the optimal compression codebook. MMQSC evolves each individual to make the code vector more representative to original quality score sequences, and accordingly the optimal codebook as a whole can compress input data more effectively. Moreover, dimensionality of solution space in MMQSC is reduced to N, because individual x i and corresponding code vector C i have the same length. In each generation of the evolution optimization, the encoded data size is calculated for only M × N times.
Figure 3

Compression codebook design using SaNSDE-DSCG based multimodal optimization.

The MMQSC algorithm

The proposed MMQSC algorithm consists of three major parts: Huffman coding based preprocessing, SaNSDE-DSCG based codebook design, and quality score data compression. Details of SaNSDE-DSCG optimization algorithm and its application on compression codebook design have been discussed in the previous sections.

During the preprocessing, raw quality score sequences are extracted from target FASTQ file, and undergo a Huffman coding. Each sequence is then converted into a symbol string by mapping every 6 bits of the encoded binary data to readable ASCII character:
h t = c h r ( 33 + i n t ( h u f f ( Q k ) [ t × 6 ~ ( t + 1 ) × 6 ] ) )

in which h t is the t th symbol in converted string H k = "h1 h2 ... h T ", function huff(·) denotes Huffman coding, int(·) converts binary data to corresponding integer value, and chr(·) maps integer number into ASCII character. Offset value 33 is added to the input number in chr(·) to ensure exported character is readable. In the majority of cases H k consists of fewer symbols than original sequence Q k . Thereby dimensionality of code vectors is reduced, and the codebook design problem is simplified.

The SaNSDE-DSCG is conducted afterward on the encoded sequences. After optimization, MMQSC maps individuals in the evolution population into code vectors using Equ. (6) to construct a compression codebook. This codebook is then utilized to compress the input data, wherein accurate symbol differences information is obtained by using DP based matching algorithm.

Procedure of the MMQSC algorithm is demonstrated in Algorithm 2. It is worth noting that the codebook design process can also be conducted in an offline manner. That is, a universal compression codebook obtained from representative NGS quality score data sets is utilized to encode all input sequences. The time-consuming optimization process is performed for only one time. Successive compressions, which are usually conducted repeatedly, require much less computational time.

Results and discussion

Five representative NGS data obtained from various species, and also of different read numbers and file sizes, are selected to evaluate the overall performance of MMQSC. Details of the data sets are summarized in Table 1. All data are downloaded in FASTQ format from the National Center for Biotechnology Information - Sequence Read Archive (NCBI-SRA) database [23].
Table 1

NGS data sets for MMQSC performance evaluation.



Number of Reads

Number of Bases

File Size (MB)


Marine metagenome





Homo sapiens





Caenorhabditis elegans





Caenorhabditis elegans





Clostridium symbiosum




In SaNSDE-DSCG optimization, the compression codebook size M is used as the number of individuals, i.e., |ps|. The value is decided as:
M = ( l o g 2 ( K 10 ) ) 2
The length of code vectors, i.e. dimensionality of solution space, is calculated using the following equation:
N = 1 2 × ( min k K P k + max k K P k )
Parameters setting for SaNSDE-DSCG based multimodal optimization is listed in Table 2 in which |S| is the number of unique symbols in the original quality scores, and FEs denotes the maximum fitness evaluation calls of the optimization.
Table 2

Parameters setting for SaNSDE-DSCG optimization.


Population Size









(0, |S|)

0.1 × N



Five widely used compression algorithms including the RLE, Huffman coding, gzip, bzip2, and Lempel-Ziv-Markov chain algorithm (LZMA) are utilized for comparison with the proposed algorithm. All algorithms are compared in terms of compression ratios (CR) and bits per quality value (BPQ). The BPQ is defined as follows:
B P Q = k K min i M L C ( C i , Q k ) k K P k
Compression results of all algorithms on the NGS data sets are summarized in Table 3.
Table 3

Compression performance on experimental NGS data sets.








CR (%)














CR (%)














CR (%)














CR (%)














CR (%)














CR (%)













Results in Table 3 show that, the proposed MMQSC obtains better performance than the counterpart representative algorithms. Particularly, MMQSC obtains average compression ratio of 22.82%, resulting in an over 77.18% size reduction in the quality score data. The average 1.81 BPQ result is much smaller than the original 8 BPQ in ASCII format. Moreover, performance of MMQSC remains stable in the experimental data sets, indicating that the algorithm has good robustness on different types of NGS data.

Convergence trace of codebook optimization processes on experimental data sets is illustrated in Figure 4, in which y-axis, labeled as function value, is the optimal shared fitness value in SaNSDE-DSCG optimization. The figure shows that by combining SaNSDE and DSCG in an MA framework to conduct multimodal search, compression codebook is optimized effectively. Particularly, DSCG increases convergence speed in the early stage of optimization. Premature convergence is successfully prevented by using the high performance SaNSDE algorithm.
Figure 4

Convergence trace of compression codebook optimization on experimental data sets.


This paper presents MMQSC, a MA based NGS quality scores compression algorithm. The MMQSC utilizes Huffman coding to preprocess raw quality score sequences stored in FASTQ format. To obtain higher performance, a SaNSDE and DSCG based MA is proposed to optimize the compression codebook design. The Levenshtein distance is used in fitness evaluations to estimate encoded data size, and improves computation speed. After the codebook optimization, a DP based matching algorithm is conducted to obtain accurate symbol differences information. This information, as well as the optimized codebook, is utilized to compress input quality score data. Experimental results on five NGS data show that the proposed MMQSC obtains higher compression ratio than counterpart state-of-the-art algorithms. Particularly, MMQSC reduces about 77% of the storage space on the experimental data sets.



This work was supported in part by the National Natural Science Foundation of China Joint Fund with Guangdong, under Key Project U1201256, the National Natural Science Foundation of China, under grant 61171125, in part by the NSFC-RS joint project under Grants IE111069 and 61211130120, in part by the Guangdong Foundation of Outstanding Young Teachers in Higher Education Institutions under grant Yq2013141, in part by the Guangdong Natural Science Foundation, under grants S2012010009545, in part by Science Foundation of Shenzhen City, under Grants JCYJ20130329115450637, ZYC201105170243A and KQC201108300045A, and in part by Program for New Century Excellent Talents in University, under grant 004549.


Publication charges for this article have been funded by the National Natural Science Foundation of China (61171125).

This article has been published as part of BMC Bioinformatics Volume 15 Supplement 15, 2014: Proceedings of the 2013 International Conference on Intelligent Computing (ICIC 2013). The full contents of the supplement are available online at http://www.biomedcentral.com/bmcbioinformatics/supplements/15/S15.

Authors’ Affiliations

College of Biomedical Engineering and Instrument Science, Zhejiang University
Shenzhen City Key Laboratory of Embedded System Design, College of Computer Science and Software Engineering, Shenzhen University
School of Computer Science, University of Birmingham


  1. You ZH, Yin Z, Han K, Huang DS, Zhou XB: A semi-supervised learning approach to predict synthetic genetic interactions by combining functional and topological properties of functional gene network. BMC Bioinformatics. 2010, 11: 343-10.1186/1471-2105-11-343.PubMed CentralView ArticlePubMedGoogle Scholar
  2. Bonfield JK, Mahoney MV: Compression of FASTQ and SAM format sequencing data. PloS One. 2013, 8: 59190-10.1371/journal.pone.0059190.View ArticleGoogle Scholar
  3. Li H, Homer N: A survey of sequence alignment algorithms for next-generation sequencing. Briefings in Bioinformatics. 2010, 11: 473-483. 10.1093/bib/bbq015.PubMed CentralView ArticlePubMedGoogle Scholar
  4. Cox AJ, Bauer MJ, Jakobi T, Rosone G: Large-scale compression of genomic sequence databases with the Burrows-Wheeler transform. Bioinformatics. 2012, 28: 1415-1419. 10.1093/bioinformatics/bts173.View ArticlePubMedGoogle Scholar
  5. Jones DC, Ruzzo WL, Peng X, Katze MG: Compression of next-generation sequencing reads aided by highly efficient de novo assembly. Nucleic Acids Research. 2012, 40: 171-10.1093/nar/gks754.View ArticleGoogle Scholar
  6. Popitsch N, von Haeseler A: NGC: lossless and lossy compression of aligned high-throughput sequencing data. Nucleic Acids Research. 2013, 41: 27-10.1093/nar/gks939.View ArticleGoogle Scholar
  7. Hach F, Numanagic I, Alkan C, Sahinalp SC: SCALCE: boosting sequence compression algorithms using locally consistent encoding. Bioinformatics. 2012, 28: 3051-3057. 10.1093/bioinformatics/bts593.PubMed CentralView ArticlePubMedGoogle Scholar
  8. Zhu Z, Zhang Y, Ji Z, He S, Yang X: High-throughput DNA sequence data compression. Briefings in Bioinformatics. 2013, bbt087-Google Scholar
  9. Giancarlo R, Rombo SE, Utro F: Compressive biological sequence analysis and archival in the era of high-throughput sequencing technologies. Briefings in Bioinformatics. 2013, bbt088-Google Scholar
  10. Janin L, Rosone G, Cox AJ: Adaptive reference-free compression of sequence quality scores. arXiv Preprint. 2013, arXiv:1305.0159Google Scholar
  11. Moscato P, Cotta C, Mendes A: Memetic algorithms. New Optimization Techniques in Engineering. 2004, New York: Springer, 53-85.View ArticleGoogle Scholar
  12. Yang Z, Tang K, Yao X: Self-adaptive differential evolution with neighborhood search. Proceedings of IEEE Congress on Evolutionary Computation: 1-6 June 2008. 2008, Hong Kong, 1110-1116.View ArticleGoogle Scholar
  13. Nguyen QH, Ong YS, Lim MH: A probabilistic memetic framework. IEEE Transactions on Evolutionary Computation. 2009, 13: 604-623.View ArticleGoogle Scholar
  14. Singh G, Deb K: Comparison of multi-modal optimization algorithms based on evolutionary algorithms. Proceedings of Genetic and Evolutionary Computation Conference: 8-12 July 2006. 2006, Seattle, 1305-1312.Google Scholar
  15. Cock PJ, Fields CJ, Goto N, Heuer ML, Rice PM: The Sanger FASTQ file format for sequences with quality scores, and the Solexa/Illumina FASTQ variants. Nucleic Acids Research. 2010, 38: 1767-1771. 10.1093/nar/gkp1137.PubMed CentralView ArticlePubMedGoogle Scholar
  16. Dawkins R: The Selfish Gene. 2006, UK: Oxford University PressGoogle Scholar
  17. Huang DS, Du JX: A constructive hybrid structure optimization methodology for radial basis probabilistic neural networks. IEEE Transactions on Neural Networks. 2008, 19: 2099-2115.View ArticlePubMedGoogle Scholar
  18. Chen X, Ong YS, Lim MH, Tan KC: A multi-facet survey on memetic computation. IEEE Transactions on Evolutionary Computation. 2011, 15: 591-607.View ArticleGoogle Scholar
  19. Storn R, Price K: Differential evolution-a simple and efficient heuristic for global optimization over continuous spaces. Journal of Global Optimization. 1997, 11: 341-359. 10.1023/A:1008202821328.View ArticleGoogle Scholar
  20. Sareni B, Krahenbuhl L: Fitness sharing and niching methods revisited. IEEE Transactions on Evolutionary Computation. 1998, 2: 97-106. 10.1109/4235.735432.View ArticleGoogle Scholar
  21. Gooskens C, Heeringa W: Perceptive evaluation of Levenshtein dialect distance measurements using Norwegian dialect data. Language Variation and Change. 2004, 16: 189-207.View ArticleGoogle Scholar
  22. Huang DS: Radial basis probabilistic neural networks: model and application. International Journal of Pattern Recognition and Artificial Intelligence. 1999, 13: 1083-1101. 10.1142/S0218001499000604.View ArticleGoogle Scholar
  23. Leinonen R, Sugawara H, Shumway M: The sequence read archive. Nucleic Acids Research. 2011, 39 (suppl 1): 19-21.View ArticleGoogle Scholar


© Zhou et al.; licensee BioMed Central Ltd. 2014

This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. The Creative Commons Public Domain Dedication waiver (http://creativecommons.org/publicdomain/zero/1.0/) applies to the data made available in this article, unless otherwise stated.