- Open Access
Clover: a clustering-oriented de novo assembler for Illumina sequences
BMC Bioinformatics volume 21, Article number: 528 (2020)
Next-generation sequencing technologies revolutionized genomics by producing high-throughput reads at low cost, and this progress has prompted the recent development of de novo assemblers. Multiple assembly methods based on de Bruijn graph have been shown to be efficient for Illumina reads. However, the sequencing errors generated by the sequencer complicate analysis of de novo assembly and influence the quality of downstream genomic researches.
In this paper, we develop a de Bruijn assembler, called Clover (clustering-oriented de novo assembler), that utilizes a novel k-mer clustering approach from the overlap-layout-consensus concept to deal with the sequencing errors generated by the Illumina platform. We further evaluate Clover’s performance against several de Bruijn graph assemblers (ABySS, SOAPdenovo, SPAdes and Velvet), overlap-layout-consensus assemblers (Bambus2, CABOG and MSR-CA) and string graph assembler (SGA) on three datasets (Staphylococcus aureus, Rhodobacter sphaeroides and human chromosome 14). The results show that Clover achieves a superior assembly quality in terms of corrected N50 and E-size while remaining a significantly competitive in run time except SOAPdenovo. In addition, Clover was involved in the sequencing projects of bacterial genomes Acinetobacter baumannii TYTH-1 and Morganella morganii KT.
The marvel clustering-based approach of Clover that integrates the flexibility of the overlap-layout-consensus approach and the efficiency of the de Bruijn graph method has high potential on de novo assembly. Now, Clover is freely available as open source software from https://oz.nthu.edu.tw/~d9562563/src.html.
Massively parallel DNA sequencing has become a prominent tool in biological research [1, 2]. The high-throughput and low cost of next-generation sequencing technologies produce high coverage of reads. The Illumina platform is one of the most commonly used sequencers, producing reads with lengths ranging from 35 to 300 bp. The de Bruijn graph approach is prevalent in the de novo assembly using Illumina reads, and it constitutes all possible substrings of length k (termed k-mers) from the reads to efficiently process the huge sequencing data. Choosing the length of k is an important issue in the de Bruijn graph approach. Theoretically, for reads without sequence errors, smaller k-mers increase the connectivity of the graph and larger k-mers decrease the number of ambiguous repeats in the graph. There is therefore a balance between sensitivity and specificity determined by k . However, for reads with errors, larger k-mers decrease the sensitivity and specificity further due to sequencing errors generated by the Illumina platform, in which the primary errors are substitution errors, at rates of 0.5–2.5% .
In this study, we are trying to answer what happens if we design an approach to allow such errors on k-mers, and could the error allowance on k-mers improve the quality of de novo assembly. Therefore we developed a clustering-oriented approach, called Clover, to deal with those substitution errors, and use a new parameter p which describes the level of error allowance on k-mers. For example, setting k to 40 and p to 1 means that our algorithm uses each 40-mers in the input reads while allowing each of them to have the flexibility of 1 substitution error.
With the flexibility of error allowance on k-mers, Clover tries to cluster these k-mers together when their Hamming distance less than or equal to p, and merges each cluster of k-mers to a node by finding its consensus sequence. To avoid over-merging of clusters, which may occur on the boundary of repeat sequence, Clover will split each node into multiple nodes when the merged node has multiple major consensus sequences (see Implementation section for detail).
After the steps mentioned above, the number of nodes in the graph will dramatically reduce, which therefore simplifies analysis of assembly. For example, Table 1 compares three results of a Leptospira shermani assembly when using different level of error allowance (p = 0, 1 and 2). Setting p to 0 is equal to run our assembler with traditional de Bruijn-based approach, which does not have the flexibility of error allowance on k-mers. The assembly result shows that only setting p to 1 could dramatically increase the N50 both in contig and scaffold because it reduces the number of nodes to build the de Bruijn graph that increases the specificity. The result also shows that setting p to 2 only increases the N50 on contig whereas decreases on scaffold. In this case, reducing too many nodes could increase the specificity, but it seems losing some meaningful information, which decreases the sensitivity at the same time.
The memory requirements, as shown in Table 1, are in clear proportion to the number of nodes to build the de Bruijn graph, but are not in obvious proportion to parameter p (Additional file 4: Table S1, compares the memory requirements when using different k and p). The time cost is dropped when setting p to 1 due to the benefit of simplifying analysis, but setting p to 2 could not get the benefit more. Together with the phenomena described above, we should choose a suitable p, not as large as possible. In the case of L. shermani assembly, the suitable p is 1 and p/k is 2.5%, which is nearly the error rate of Illumina platform.
Clover proceeds through the following phases whose flowchart is shown in Fig. 1.
Construction and clustering of k-mers
For given k (k-mer) and p (error allowance), Clover constructs a Hamming graph by extracting all the input k-mers as nodes. The graph’s edges are created by the pairs of k-mers if the Hamming distance of the k-mers (or their reverse complements) is ≤ p. Figure 2 illustrates an example of 5-mers clustering while allowing 1 error. Basically, the components of the Hamming graph are the clusters of k-mers (Fig. 2b). Clover then merges all the nodes within each component of the Hamming graph into a single node and computes its consensus sequence. In practice, just setting p to (k × error rate of sequencer) can dramatically reduce the number of k-mers for constructing the de Bruijn graph later and accelerates the subsequent graph processing. In the implementation, Clover uses two steps to cluster the k-mers: Step 1 extracts all k-mers from the input reads. Step 2 constructs a Hamming graph of the k-mers and then performs a breadth-first search to find each component in the Hamming graph. If there is no error allowance needed (p = 0), Clover will omit the process of step 2.
Consensus computing and splitting of nodes
Clover computes the consensus sequence for each merged node by selecting the nucleotide with the most occurrence on each base pair. For example, the fourth component of Fig. 2b has 4 k-mers (GGTCT, GGTAT, GCTCT and TGTCT) whose consensus sequence therefore is GGTCT as shown in Fig. 2c. To avoid over-merging, if the k-mers of the merged node, called v, have a nucleotide on a base pair, called x, whose occurrence is closed to that of the corresponding nucleotide, called y, in the consensus sequence, Clover splits the merged node into multiple nodes. More realistically, given a fractional threshold sp, if the occurrence of x is greater than or equal to sp times the occurrence of y, Clover collects all the k-mers with x into a new node, called v1, leaves the others into a new node, called v2, and recursively retries this splitting process on v1 and v2. Let q be the number of k-mers in the merged node. Then the consensus computing requires O(q × k) time, the condition checking requires O(k) time and collecting the k-mers into the new nodes requires O(q) time. Therefore, similar to the analysis of quick sort, the worst case of the time complexity on the whole process is O(q2 × k). Figure 2c shows the resulting consensus sequences of Fig. 2b by setting sp to 0.6. Finally, Clover collects all the resulting consensus sequences as the k-mer set for constructing de Bruijn graph in the next phase.
De Bruijn graph construction
For the k-mer set obtained in the previous phase, Clover constructs the de Bruijn graph by directly using the k-mer set as its node set. For any two nodes, it creates an edge between them if their corresponding k-mers have an overlapping of length k − 1. Figure 2c provides an example for de Bruijn graph construction.
Graph cleaning and extension with shorter k-mers
Clover provides multiple operations based on spectrum, structure and their combination for removing spurious edges from the de Bruijn graph. The spectral error removal operation is the trimming of low-frequency edges. The structural error removal operations are the pruning of tips, bubbles, and erroneous connections. If there are multiple options during pruning of tips and bubbles, Clover prunes the low-frequency edges first. All these operations were also used in SOAPdenovo  and Velvet . Clover then iteratively extends the graph by connecting two paths if the sequences of the paths have an overlapping length shorter than k until the given minimum overlapping length m is achieved. Clover defaultly sets the parameter m to (k/2) + 1. For example, we compare the different settings of m on the Rhodobacter sphaeroides assemblies (see Additional file 4: Table S2), where k is set to 46 in this case, and find that the default value 24 of m has the best scaffold result.
Clover utilizes read-pair information by aligning both ends of the pairs to the paths in the graph to find pairs of anchors. Given a scaffold support ss, which defaultly is set to 5, Clover links each pair of paths with the consistent bound if its support from the pairs of anchors is greater than or equal to ss. Clover calculates the medium length of insert sizes inferred from the pairs of anchors to be the consistent bound of the linked pair of paths. Finally, Clover predicts contigs by searching Eulerian super-paths on the graph.
Results and discussion
To evaluate the assembly correctness of Clover, we have tested three typical datasets in the GAGE study: Staphylococcus aureus (2.9 Mb), Rhodobacter sphaeroides (4.6 Mb) and human chromosome 14 (88.3 Mb) . Each dataset has original reads, Quake corrected reads and Allpaths-LG corrected reads. The result with the best scaffold N50 on these three datasets is selected for assembly comparison we will discuss later.
Running Clover assembler
Installation of Clover is provided at Additional file 2.
For testing Clover, test data is available at ‘Test Case’ of our website.
In Table 2, the results of our Clover were obtained from Allpaths-LG corrected reads. The assembly instructions used by our Clover are:
S. aureus: clover -k 32 -p 0 -i1 frag_1.fastq,shortjump_1.fastq -i2 frag_2.fastq,shortjump_2.fastq -cs 5 -ss 3 -is 180,3500 -hp 0.6 -pm -ml 700.
R. sphaeroides: clover -k 46 -p 0 -i1 frag_1.fastq,shortjump_1.fastq -i2 frag_2.fastq,shortjump_2.fastq -cs 7 -ss 3 -is 180,3500 -hp 0.6 -pm -ml 200.
Human chromosome 14: clover -k 80 -p 3 -i1 frag_1.fastq,shortjump_1.fastq,longjump_1.fastq -i2 frag_2.fastq,shortjump_2.fastq,longjump_2.fastq -cs 9 -ss 5 -is 155,2543,35306 -hp 0.8 -ml 900.
The assembly results display all statistics data in the screen (see Additional file 3: Section S2) and create two assembly output files named out_contig.fasta and out_scaffold.fasta.
Running Leptospira shermani assembly
We provide Leptospira shermani dataset tar file at our website https://oz.nthu.edu.tw/~d9562563/src.html.
Download and unpack it: tar -zxvf leptospirashermanidata.tar.gz.
The assembly instructions are: clover -k 40 -p ? -is 485 -i1 Lepto_500_1.fq -i2 Lepto_500_2.fq -hp 0.6, where ? runs with 0, 1 and 2, respectively.
The assembly results display all statistics data in the screen (see Additional file 3: Section S1) and create two assembly output files named out_contig.fasta and out_scaffold.fasta.
Table 2 shows the comparison of Clover’s performance against several modern assemblers, which include ABySS , Bambus2 , CABOG , MSR-CA , SGA , SOAPdenovo , SPAdes  and Velvet . All assembly statistics were generated by the GAGE validation scripts. Bambus2, CABOG and MSR-CA are well known overlap-layout-consensus assemblers, while ABySS, SOAPdenovo, SPAdes and Velvet are famous de Bruijn graph assemblers and SGA is typical string graph assembler.
For the S. aureus dataset, SOAPdenovo and ABySS have produced the longest two contigs. SGA, SPAdes, Clover and ABySS have been detected the fewest four errors in contigs, but SOAPdenovo contains many errors. Therefore ABySS achieves the longest corrected contigs. MSR-CA has produced the longest scaffolds, but its longest scaffold has been broken by an error. Instead, Clover and Bambus2 achieve the longest corrected scaffolds in terms of N50 and E-size respectively.
For the R. sphaeroides dataset, SOAPdenovo and Bambus2 have produced the longest two contigs. However, considering the assembly correctness, Clover achieves the longest corrected contigs. SGA and SPAdes contain fewest two errors in contigs, but their N50 lengths are relatively shorter. Excluding SGA and SPAdes, Clover’s contigs contain fewest errors. On the other hand, MSR-CA and Clover have the best two scaffold results both in uncorrected and corrected N50.
For the human chromosome 14 dataset, Clover produces the relatively conservative contigs, but its contigs contain fewest errors except SGA. CABOG has the best contig results both in uncorrected and corrected N50. Velvet produces the longest scaffolds. However, when focusing on the assembly correctness, Clover achieves the longest corrected scaffolds.
Note that the N50 statistics is defined as the minimum contig length (in descending order) needed to cover 50% of the genome. The N50 statistics generated by Clover is the minimum contig length needed to cover 50% of all the sequence produced. However, the N50 statistics generated by the GAGE validation scripts is the minimum contig length needed to cover 50% of the reference genomic sequence provided in GAGE study. Therefore the N50 statistics of Clover in Additional file 3 and the N50 statistics of Clover in Table 2 have a little difference.
The result of L. shermani seems to be poorer than S. aureus and R. sphaeroides. However, these two datasets in GAGE study have two libraries and the fragment size is up to 3500 bp , whereas the L. shermani dataset only has single library with fragment size 485 bp. The better assembly quality is caused by using more libraries. Practically, researchers usually use optical mapping to arrange scaffolds and then obtain the draft sequence .
In addition, our clustering approach can apply on ever error-corrected reads. For example, the assembly of human chromosome 14 is generated by clustering 80-mers while allowing 3 errors on Allpaths-LG corrected reads. Therefore Clover would not conflict with current error correction tools. In practice, we will apply smaller k-mer on single library or lower coverage dataset such as the L. shermani assembly, and larger k-mer on more complex genomes such as human chromosome 14. When using large k-mer, increasing the level of error allowance is especially needed even on ever error-corrected reads.
Run times and memory requirements
To assess Clover’s run times and memory requirements, we have rerun above assemblers that follow the same processes and parameters of GAGE with their newest version on a 16-core AMD Opteron 6128 2 GHz server with 256 GB of RAM. The parameters of optimal result seem varying with the different version of assemblers and hence we only take their run times and memory requirements into comparisons. Because we don’t have large-scale parallel environment, we only run ABySS on single-process version.
Table 3 shows the comparison of these assemblers on run times and memory requirements. The result shows that the run time of Clover is significantly competitive to those efficient de Bruijn graph assemblers except SOAPdenovo. SOAPdenovo is the fastest assembler due to the multi-process parallelization.
The major cost of Clover is the k-mers clustering. In the k-mers clustering, Clover constructs a Hamming graph in which it links each pair of k-mers as an edge if the Hamming distance of the pair of k-mers is ≤ p. To accelerate the process, Clover utilizes the indexing technique that partitions a k-mer into (p + 1) substrings. If the Hamming distance of a pair of k-mers is ≤ p, there must exist a pair of substrings that are exactly the same. Therefore Clover uses (p + 1) hash tables which index each substring of all k-mers to find the candidate pairs of k-mers, and performs comparisons to check their real Hamming distances. Let n be the number of the reads. l be the length of the reads, k be the length of k-mers and p be the level of error allowance on the k-mers. Note that p can be 0 in this study. Then n × (l − k + 1) is the number of k-mers within the reads, (p + 1) is the number of hash tables needed to find the candidate pairs of k-mers and each comparison for them requires O(k) time. Therefore, the worst case of the time complexity on k-mers clustering is O(n × (l − k + 1) × k × (p + 1)) ≅ O(n × (l − k) × k × (p + 1)). Similarly, the memory needed to store all the sequences of the k-mers is O(n × (l − k) × k), and the memory needed for all the k-mers on the hash tables is O(n × (l − k) × (p + 1)). Since k is much larger than p, the worst case of the space complexity on k-mers clustering is O(n × (l − k) × k).
It is worth mentioning that Clover was involved in two sequencing projects to respectively sequence bacterial genomes Acinetobacter baumannii TYTH-1 (4.0 Mb and 165 contigs)  and Morganella morganii KT (3.8 Mb and 58 contigs) . The contigs generated by Clover were then used to build the draft sequences, which were confirmed by optical mapping and PCR. From the draft sequences of A. baumannii TYTH-1 and M. morganii KT, 3682 and 3565 protein-coding sequences, 75 and 72 tRNA genes, and 6 and 10 rRNA genes were further predicted, respectively. Table 4 shows the summary of these two sequencing results.
The limit of our current Clover is that it cannot apply on genomes with large size up to 250 Mb. This is caused by 256 GB of RAM in our server (see Run times and memory requirements section for detail). However, if the server has more RAM, the limitation could be eliminated. The memory requirement issue exists in many assemblers with which we compared in this study. As shown in Table 3, if a genome can not be assembled by Clover, the genome has the high probability that it can not be assembled by other assemblers we used in this study.
We leave the parallelization of program as a future work that will further improve the performance of Clover. Besides, we leave the exploration of other possible clustering algorithms to further improve Clover as another future work.
In this study, we developed a new clustering-oriented de novo assembler, called Clover, that integrates the flexibility of the overlap-layout-consensus approach on clustering k-mers and the efficiency of the de Bruijn graph method, with which we improve the robustness with respect to sequencing error especially using large k-mers. We discovered the effect of our clustering approach that not only improves the assembly result but also accelerates the assembly process by simplifying analysis on the Leptospira shermani assembly. The evaluation of Clover on GAGE datasets finally shows that it achieves a superior assembly quality in terms of corrected N50 and E-size while remaining a significantly competitive in run time.
Availability and requirements
Project name Clover.
Project home page https://oz.nthu.edu.tw/~d9562563/
Operating system(s) Linux.
Programming language C, Python and Cython.
Other requirements Python-devel to develop Python extensions.
License GNU GPL2.
Any restrictions to use by non-academics None.
Assembly by short sequences
Celera assembler with the best overlap graph
Clustering-oriented de novo assembler
Genome assembly gold-standard evaluation
Kilo base pairs
Mega base pairs
Maryland super-read celera assembler
Polymerase chain reaction
Ribosomal ribonucleic acid
String graphs assembler
Short oligonucleotide analysis package de novo
St. Petersburg genome assembler
Transfer ribonucleic acid
Shendure J, Ji H. Next-generation DNA sequencing. Nat Biotechnol. 2008;26:1135–45.
Hawkins RD, Hon GC, Ren B. Next-generation genomics: an integrative approach. Nat Rev Genet. 2010;11:476–86.
Zerbino DR, Birney E. Velvet: algorithms for de novo short read assembly using de Bruijn graphs. Genome Res. 2008;18:821–9.
Kelley DR, Schatz MC, Salzberg SL. Quake: quality-aware detection and correction of sequencing errors. Genome Biol. 2010;11:R116.
Li R, Zhu H, Ruan J, Qian W, Fang X, Shi Z, et al. De novo assembly of human genomes with massively parallel short read sequencing. Genome Res. 2010;20:265–72.
Salzberg SL, Phillippy AM, Zimin A, Puiu D, Magoc T, Koren S, et al. GAGE: a critical evaluation of genome assemblies and assembly algorithms. Genome Res. 2012;22:557–67.
Simpson JT, Wong K, Jackman SD, Schein JE, Jones SJ, Birol I. ABySS: a parallel assembler for short read sequence data. Genome Res. 2009;19:1117–23.
Koren S, Treangen TJ, Pop M. Bambus 2: scaffolding metagenomes. Bioinformatics. 2011;27(21):2964–71.
Miller JR, Delcher AL, Koren S, Venter E, Walenz BP, Brownley A, et al. Aggressive assembly of pyrosequencing reads with mates. Bioinformatics. 2008;24(24):2818–24.
Zimin AV, Marçais G, Puiu D, Roberts M, Salzberg SL, Yorke JA. The MaSuRCA genome assembler. Bioinformatics. 2013;29(21):2669–77.
Simpson JT, Durbin R. Efficient de novo assembly of large genomes using compressed data structures. Genome Res. 2012;22:549–56.
Bankevich A, Nurk S, Antipov D, Gurevich AA, Dvorkin M, Kulikov AS, et al. SPAdes: a new genome assembly algorithm and its applications to single-cell sequencing. J Comput Biol. 2012;19(5):455–77.
Shukla SK, Kislow J, Briska A, Henkhaus J, Dykes C. Optical mapping reveals a large genetic inversion between two methicillin-resistant Staphylococcus aureus strains. J Bacteriol. 2009;191(18):5717–23.
Liou ML, Liu CC, Lu CW, Hsieh MF, Chang KC, Kuo HY, et al. Genome sequence of Acinetobacter baumannii TYTH-1. J Bacteriol. 2012;194(24):6974.
Chen YT, Peng HL, Shia WC, Hsu FR, Ken CF, Tsao YM, et al. Whole-genome sequencing and identification of Morganella morganii KT pathogenicity-related genes. BMC Genomics. 2012;13(Suppl 7):S4.
The authors appreciate the Ministry of Science and Technology of Taiwan for funding this study and three anonymous reviewers for their constructive comments.
The publication costs of this paper were funded by Ministry of Science and Technology of Taiwan under grant MOST 106-2221-E-126-008.
Ethics approval and consent to participate
Consent for publication
The authors declare that they have no competing interests.
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Clover source code for Linux. Please refer to ‘Installation of Clover’.
Datasets and Installation of Clover. GAGE dataset list and locations, and build Clover’s executing and programming environments.
Section S1—Leptospira shermani assembly statistics results. Section S2—Clover assembly statistics results. Clover output screen text.
Table S1—Memory requirements (GB) of k versus p correlation on Leptospira shermani assembly. Table S2—Sensitivity comparison of different minimum overlapping lengths on Rhodobacter sphaeroides assembly. Supplemental analysis of Clover.
About this article
Cite this article
Hsieh, MF., Lu, C.L. & Tang, C.Y. Clover: a clustering-oriented de novo assembler for Illumina sequences. BMC Bioinformatics 21, 528 (2020). https://doi.org/10.1186/s12859-020-03788-9
- De novo genome assembly
- DNA sequencing
- De bruijn graph