Clover: a clustering-oriented de novo assembler for Illumina sequences

Background 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. Results 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. Conclusions 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.

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 [3]. 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% [4].
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.

Implementation
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. Table 1 The clustering effect of Clover on Leptospira shermani assemblies p the level of error allowance on the k-mers, Nodes the number of nodes to build de Bruijn graph, Num the number of sequences produced, Total the total length of sequences produced, Max the maximum length of sequences produced, N50 the N50 statistic calculated with respect to the total length of sequences produced, Time the run time to assemble the genome, Memory the memory requirement to assemble the genome  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 v 1 , leaves the others into a new node, called v 2 , and recursively retries this splitting process on v 1 and v 2 . 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(q 2 × 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.

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 [5] and Velvet [3]. 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.

Scaffolding
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) [6]. 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
We provide Clover source code with this submission (see Additional file 1) and at our website https ://oz.nthu.edu.tw/~d9562 563/src.html. Installation of Clover is provided at Additional file 2.
Each dataset in the GAGE study (see Additional file 2) is available at https ://gage.cbcb. umd.edu/data/.
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.
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.

Comparison
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 [6], 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 [12].
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 errorcorrected 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 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).

Sequencing projects
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) [14] and Morganella morganii KT (3.8 Mb and 58 contigs) [15]. 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.

Limitations
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.

Future works
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.

Conclusions
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