Europe PMC
Nothing Special   »   [go: up one dir, main page]

Europe PMC requires Javascript to function effectively.

Either your web browser doesn't support Javascript or it is currently turned off. In the latter case, please turn on Javascript support in your web browser and reload this page.

This website requires cookies, and the limited processing of your personal data in order to function. By using the site you are agreeing to this as outlined in our privacy notice and cookie policy.

Abstract 


Summary

We present a new method to incrementally construct the FM-index for both short and long sequence reads, up to the size of a genome. It is the first algorithm that can build the index while implicitly sorting the sequences in the reverse (complement) lexicographical order without a separate sorting step. The implementation is among the fastest for indexing short reads and the only one that practically works for reads of averaged kilobases in length.

Availability and implementation

https://github.com/lh3/ropebwt2 CONTACT: hengli@broadinstitute.org.

Free full text 


Logo of bioinfoLink to Publisher's site
Bioinformatics. 2014 Nov 15; 30(22): 3274–3275.
PMCID: PMC4221129
PMID: 25107872

Fast construction of FM-index for long sequence reads

Abstract

Summary: We present a new method to incrementally construct the FM-index for both short and long sequence reads, up to the size of a genome. It is the first algorithm that can build the index while implicitly sorting the sequences in the reverse (complement) lexicographical order without a separate sorting step. The implementation is among the fastest for indexing short reads and the only one that practically works for reads of averaged kilobases in length.

Availability and implementation: https://github.com/lh3/ropebwt2

Contact: gro.etutitsnidaorb@ilgneh

1 INTRODUCTION

FM-index plays an important role in DNA sequence alignment, de novo assembly (Simpson and Durbin, 2012) and compression (Cox et al., 2012). Fast and lightweight construction of FM-index for a large dataset is the key to these applications. In this context, a few algorithms (Bauer et al., 2013; Liu et al., 2014) have been developed that substantially outperform earlier algorithms. However, they are only efficient for short reads. A fast and practical algorithm for long sequence reads is still lacking. This work aims to fill this gap.

2 METHODS

Let Σ = {ACGTN} be the alphabet of DNA with a lexicographical order A < C < G < T < N. Each element in Σ is called a symbol and a sequence of symbols called a string over Σ. Given a string P, |P| is its length and P[i] the symbol at position i. A sentinel $ is smaller than all the other symbols. For simplicity, we let P[−1] = P[|P|] = $. We also introduce P as the reverse of P and P¯ as the reverse complement of P.

Given a list of strings over Σ, (Pi)0≤i<m, let T = P0$0Pm − 1$m − 1 with $0 <  ⋯  <  $m−1 < A < C < G < T < N. The suffix array of T is an integer array S such that S(i), 0 ≤ i < |T|, is the starting position of the i-th smallest suffix in the collection T. The Burrows-Wheeler Transform, or BWT, of T can be computed as B[i] = T[S(i)−1]. For the description of the algorithm, we segment B into BB$BABCBGBTBN, where Ba[i] = B[iC(a)] with C(a) = |{j:T[j] < a}| being the array of accumulative counts. By the definition of suffix array and BWT, Ba consists of all the symbols with their next symbol in T being a.

The above defines BWT for an ordered list of strings. We next seek to define BWT for an unordered set of strings 𝒞 by imposing an arbitrary sorting order on 𝒞. We say list (Pi)i is in the reverse lexicographical order or RLO, if PiPj for any i < j; say it is in the reverse-complement lexicographical order or RCLO, if P¯iP¯j for any i < j. The RLO-BWT of 𝒞, denoted by BRLO(𝒞), is constructed by sorting strings in 𝒞 in RLO and then applying the procedure in the previous paragraph on the sorted list. RCLO-BWT BRCLO(𝒞) can be constructed in a similar way. In BRCLO({Pi}i{P¯j}j), the k-th smallest sequence is the reverse complement of the k-th sequence in the FM-index. This property removes the necessity of keeping an extra array to link the rank and the position of a sequence in the FM-index, and thus helps to reduce the memory of some FM-index–based algorithms (Simpson and Durbin, 2012). For short reads, RLO/RCLO-BWT is also more compressible (Cox et al., 2012).

As a preparation, we further define two string operations: rank(ckB) and insert(ckB), where rank(ckB) = |{i < k:B[i] = c}| gives the number of symbols c before the position k in B, and insert(ckB) inserts symbol c after k symbols in B with all the symbols after position k shifted to make room for c. We implemented the two operations by representing each Bc in a B+-tree in memory, where a leaf keeps a run-length encoded string and an internal node keeps the count of each symbol in the leaves descended from the node.

Algorithm 1 appends a string to an existing index by inserting each of its symbol from the end of P. It was first described by Chan et al. (2004). Algorithm 2 constructs RLO/RCLO-BWT in a similar manner to Algorithm 1 except that it inserts P[i] to [lu), the suffix array interval of P’s suffix starting at i + 1, and that BWT symbols in this interval are already sorted. This process implicitly applies a radix sort from the end of P, sorting it into the existing strings in the BWT in RLO/RCLO. Note that if we change line 1 to “l ← u ← |{i:B[i] = $}|”, Algorithm 2 will be turned into Algorithm 1. Recall that the BCR algorithm (Bauer et al., 2013) is, to some extent, the multi-string version of Algorithm 1. Following similar reasoning, we can extend Algorithm 2 so as to insert multiple strings at the same time, which gives Algorithm 3. We use an array A(j) to keep the state of the j-th sequence after inserting its d-long suffix. At line 2, A(j).c is the previously inserted symbol and [A(j).lA(j).u) is the interval to which the new symbol is inserted. In implementation, we may speed up the sorting mode by inserting multiple symbols at line 3.

When B is represented by a balanced tree structure, the time complexity of all three algorithms is O(n log⁡n), where n is the total number of symbols in the input. However, we will see later that for short strings, Algorithm 3 is substantially faster than the first two algorithms, due to the locality of memory accesses, the possibility of cached B+-tree update and the parallelization of the ‘for’ loop at line 1. These techniques are more effective for a larger batch of shorter strings.

Disregarding RLO/RCLO, Algorithm 3 is similar to BCR except that BCR keeps B in monolithic arrays. As a result, the time complexity of BCR is O(nl), where l is the maximum length of reads, not scaling well to l.

An external file that holds a picture, illustration, etc.
Object name is btu541ilf1.jpg

An external file that holds a picture, illustration, etc.
Object name is btu541ilf2.jpg

An external file that holds a picture, illustration, etc.
Object name is btu541ilf3.jpg

3 RESULTS AND DISCUSSION

We implemented the algorithm in ropeBWT2 and evaluated its performance together with BEETL (http://bit.ly/beetlGH), the original on-disk implementation of BCR and BCRext, ropeBWT-BCR (https://github.com/lh3/ropebwt), an in-memory reimplementation of BCR by us, and NVBio (http://bit.ly/nvbioio), a GPU-based algorithm inspired by CX1 (Liu et al., 2014). Table 1 shows that for ~100 bp reads, ropeBWT2 has comparable performance to others. For the ~875 bp Venter dataset, NVBio aborted due to insufficient memory under various settings. We did not apply BCR because it is not designed for long reads of unequal lengths. Only ropeBWT2 works with this data set and the even longer moleculo reads.

Table 1.

Performance of BWT construction

DataaAlgorithmRCLORealCPU%RAMb (GB)Comments
wormnvbio316 s13812.9See notec
wormropebwt-bcr480 s2232.2-btORf
wormAlgorithm 3Yes506 s25010.5-brRm10g
wormAlgorithm 3No647 s24911.8-bRm10g
wormbeetl-bcr965 s2591.8RAM diskd
wormbeetl-bcr2092 s1221.8Networke
wormAlgorithm 15125 s1002.5-bRm0
wormbeetl-bcrext5900 s480.1Networke
12 878ropebwt-bcr3.3 h21039.3-btORf
12 878nvbio4.1 h47163.8See notef
12 878Algorithm 3Yes5.0 h26134.0-brRm10g
12 878Algorithm 3No5.1 h24860.9-bRm10g
12 878beetl-bcr11.2 h13131.6Networke
VenterAlgorithm 3Yes1.4 h27422.2-brRm10g
VenterAlgorithm 3No1.5 h27422.8-bRm10g
molAlgorithm 3No6.8 h28520.0-bRm10g

aDatasets—worm: 66M × 100 bp Caenorhabditis elegans reads from SRR065390; 12878: 1206M × 101 bp human reads for sample NA12878 (Depristo et al., 2011). Venter: 32M × 875 bp (in average) human reads by Sanger sequencing (Levy et al. 2007; http://bit.ly/levy2007); mol: 23M × 4026 bp (in average) human reads by Illumina’s Moleculo sequencing (http://bit.ly/mol12878).

bHardware—CPU: 48 cores of Xeon E5-2697v2 at 2.70 GHz; GPU: one Nvidia Tesla K40; RAM: 128 GB; Storage: Isilon IQ 72000x and X400 over network. CPU time, wall-clock time and peak memory are measured by GNU time.

cRun with option ‘-R -cpu-mem 4096 -gpu-mem 4096’. NVBio uses more CPU and GPU RAM than the specified.

dResults and temporary files created on in-RAM virtual disk ‘/dev/shm’.

eResults and temporary files created on Isilon’s network file system.

fRun with option ‘-R -cpu-mem 48000 -gpu-mem 4096’.

Funding: NHGRI U54HG003037; NIH GM100233.

Conflict of Interest: none declared.

REFERENCES

  • Bauer MJ, et al. Lightweight algorithms for constructing and inverting the BWT of string collections. Theor. Comput. Sci. 2013;483:134–148. [Google Scholar]
  • Chan H-L, et al. Compressed index for a dynamic collection of texts. In: Sahinalp SC, Muthukrishnan S, Dogrusöz U, editors. CPM, Volume 3109 of Lecture Notes in Computer Science. Berlin Heidelberg: Springer; 2004. pp. 445–456. [Google Scholar]
  • Cox AJ, et al. Large-scale compression of genomic sequence databases with the burrows-wheeler transform. Bioinformatics. 2012;28:1415–1419. [Abstract] [Google Scholar]
  • Depristo MA, et al. A framework for variation discovery and genotyping using next-generation DNA sequencing data. Nat. Genet. 2011;43:491–498. [Europe PMC free article] [Abstract] [Google Scholar]
  • Levy S, et al. The diploid genome sequence of an individual human. PLoS Biol. 2007;5:e254. [Abstract] [Google Scholar]
  • Liu C-M, et al. 2014. GPU-accelerated BWT construction for large collection of short reads. arXiv:1401.7457. [Google Scholar]
  • Simpson JT, Durbin R. Efficient de novo assembly of large genomes using compressed data structures. Genome Res. 2012;22:549–556. [Europe PMC free article] [Abstract] [Google Scholar]

Articles from Bioinformatics are provided here courtesy of Oxford University Press

Citations & impact 


Impact metrics

Jump to Citations

Citations of article over time

Alternative metrics

Altmetric item for https://www.altmetric.com/details/2583322
Altmetric
Discover the attention surrounding your research
https://www.altmetric.com/details/2583322

Smart citations by scite.ai
Smart citations by scite.ai include citation statements extracted from the full text of the citing article. The number of the statements may be higher than the number of citations provided by EuropePMC if one paper cites another multiple times or lower if scite has not yet processed some of the citing articles.
Explore citation contexts and check if this article has been supported or disputed.
https://scite.ai/reports/10.1093/bioinformatics/btu541

Supporting
Mentioning
Contrasting
0
50
0

Article citations


Go to all (26) article citations

Similar Articles 


To arrive at the top five similar articles we use a word-weighted algorithm to compare words from the Title and Abstract of each citation.

Funding 


Funders who supported this work.

NHGRI NIH HHS (1)

NIGMS NIH HHS (1)