git clone https://github.com/ruanjue/wtdbg2
cd wtdbg2 && make
#quick start with wtdbg2.pl
./wtdbg2.pl -t 16 -x rs -g 4.6m -o dbg reads.fa.gz
# Step by step commandlines
# assemble long reads
./wtdbg2 -x rs -g 4.6m -i reads.fa.gz -t 16 -fo dbg
# derive consensus
./wtpoa-cns -t 16 -i dbg.ctg.lay.gz -fo dbg.raw.fa
# polish consensus, not necessary if you want to polish the assemblies using other tools
minimap2 -t16 -ax map-pb -r2k dbg.raw.fa reads.fa.gz | samtools sort -@4 >dbg.bam
samtools view -F0x900 dbg.bam | ./wtpoa-cns -t 16 -d dbg.raw.fa -i - -fo dbg.cns.fa
# Addtional polishment using short reads
bwa index dbg.cns.fa
bwa mem -t 16 dbg.cns.fa sr.1.fa sr.2.fa | samtools sort -O SAM | ./wtpoa-cns -t 16 -x sam-sr -d dbg.cns.fa -i - -fo dbg.srp.fa
Introduction
Wtdbg2 is a de novo sequence assembler for long noisy reads produced by
PacBio or Oxford Nanopore Technologies (ONT). It assembles raw reads without
error correction and then builds the consensus from intermediate assembly
output. Wtdbg2 is able to assemble the human and even the 32Gb
Axolotl genome at a speed tens of times faster than CANU and
FALCON while producing contigs of comparable base accuracy.
During assembly, wtdbg2 chops reads into 1024bp segments, merges similar
segments into a vertex and connects vertices based on the segment adjacency on
reads. The resulting graph is called fuzzy Bruijn graph (FBG). It is akin to De
Bruijn graph but permits mismatches/gaps and keeps read paths when collapsing
k-mers. The use of FBG distinguishes wtdbg2 from the majority of long-read
assemblers.
Installation
Wtdbg2 only works on 64-bit Linux. To compile, please type make in the source
code directory. You can then copy wtdbg2 and wtpoa-cns to your PATH.
Wtdbg2 also comes with an approxmimate read mapper kbm, a faster but less
accurate consesus tool wtdbg-cns and many auxiliary scripts in the scripts
directory.
Usage
Wtdbg2 has two key components: an assembler wtdbg2 and a consenser
wtpoa-cns. Executable wtdbg2 assembles raw reads and generates the
contig layout and edge sequences in a file “prefix.ctg.lay.gz”. Executable
wtpoa-cns takes this file as input and produces the final consensus in
FASTA. A typical workflow looks like this:
where -g is the estimated genome size and -x specifies the sequencing
technology, which could take value “rs” for PacBio RSII, “sq” for PacBio
Sequel, “ccs” for PacBio CCS reads and “ont” for Oxford Nanopore. This option
sets multiple parameters and should be applied before other parameters.
When you are unable to get a good assembly, you may need to tune other
parameters as follows.
Wtdbg2 combines normal k-mers and homopolymer-compressed (HPC) k-mers to find
read overlaps. Option -k specifies the length of normal k-mers, while -p
specifies the length of HPC k-mers. By default, wtdbg2 samples a fourth of all
k-mers by their hashcodes. For data of relatively low coverage, you may
increase this sampling rate by reducing -S. This will greatly increase the
peak memory as a cost, though. Option -e, which defaults to 3, specifies the
minimum read coverage of an edge in the assembly graph. You may adjust this
option according to the overall sequencing depth, too. Option -A also helps
relatively low coverage data at the cost of performance. For PacBio data,
-L5000 often leads to better assemblies emperically, so is recommended.
Please run wtdbg2 --help for a complete list of available options or consult
README-ori.md for more help.
The following table shows various command lines and their resource usage for
the assembly step:
The timing was obtained on three local servers with different hardware
configurations. There are also run-to-run fluctuations. Exact timing on your
machines may differ. The assembled contigs can be found at the following FTP:
ftp://ftp.dfci.harvard.edu/pub/hli/wtdbg/
Limitations
For Nanopore data, wtdbg2 may produce an assembly smaller than the true
genome.
When inputing multiple files of both fasta and fastq format, please put fastq first, then fasta.
Otherwise, program cannot find ‘>’ in fastq, and append all fastq in one read.
Citing wtdbg2
If you use wtdbg2, please cite:
Ruan, J. and Li, H. (2019) Fast and accurate long-read assembly with wtdbg2. Nat Methods doi:10.1038/s41592-019-0669-3
Ruan, J. and Li, H. (2019) Fast and accurate long-read assembly with wtdbg2. bioRxiv. doi:10.1101/530972
Getting Started
Introduction
Wtdbg2 is a de novo sequence assembler for long noisy reads produced by PacBio or Oxford Nanopore Technologies (ONT). It assembles raw reads without error correction and then builds the consensus from intermediate assembly output. Wtdbg2 is able to assemble the human and even the 32Gb Axolotl genome at a speed tens of times faster than CANU and FALCON while producing contigs of comparable base accuracy.
During assembly, wtdbg2 chops reads into 1024bp segments, merges similar segments into a vertex and connects vertices based on the segment adjacency on reads. The resulting graph is called fuzzy Bruijn graph (FBG). It is akin to De Bruijn graph but permits mismatches/gaps and keeps read paths when collapsing k-mers. The use of FBG distinguishes wtdbg2 from the majority of long-read assemblers.
Installation
Wtdbg2 only works on 64-bit Linux. To compile, please type
makein the source code directory. You can then copywtdbg2andwtpoa-cnsto yourPATH.Wtdbg2 also comes with an approxmimate read mapper
kbm, a faster but less accurate consesus toolwtdbg-cnsand many auxiliary scripts in thescriptsdirectory.Usage
Wtdbg2 has two key components: an assembler wtdbg2 and a consenser wtpoa-cns. Executable wtdbg2 assembles raw reads and generates the contig layout and edge sequences in a file “prefix.ctg.lay.gz”. Executable wtpoa-cns takes this file as input and produces the final consensus in FASTA. A typical workflow looks like this:
where
-gis the estimated genome size and-xspecifies the sequencing technology, which could take value “rs” for PacBio RSII, “sq” for PacBio Sequel, “ccs” for PacBio CCS reads and “ont” for Oxford Nanopore. This option sets multiple parameters and should be applied before other parameters. When you are unable to get a good assembly, you may need to tune other parameters as follows.Wtdbg2 combines normal k-mers and homopolymer-compressed (HPC) k-mers to find read overlaps. Option
-kspecifies the length of normal k-mers, while-pspecifies the length of HPC k-mers. By default, wtdbg2 samples a fourth of all k-mers by their hashcodes. For data of relatively low coverage, you may increase this sampling rate by reducing-S. This will greatly increase the peak memory as a cost, though. Option-e, which defaults to 3, specifies the minimum read coverage of an edge in the assembly graph. You may adjust this option according to the overall sequencing depth, too. Option-Aalso helps relatively low coverage data at the cost of performance. For PacBio data,-L5000often leads to better assemblies emperically, so is recommended. Please runwtdbg2 --helpfor a complete list of available options or consult README-ori.md for more help.The following table shows various command lines and their resource usage for the assembly step:
The timing was obtained on three local servers with different hardware configurations. There are also run-to-run fluctuations. Exact timing on your machines may differ. The assembled contigs can be found at the following FTP:
Limitations
For Nanopore data, wtdbg2 may produce an assembly smaller than the true genome.
When inputing multiple files of both fasta and fastq format, please put fastq first, then fasta. Otherwise, program cannot find ‘>’ in fastq, and append all fastq in one read.
Citing wtdbg2
If you use wtdbg2, please cite:
Getting Help
Please use the GitHub’s Issues page if you have questions. You may also directly contact Jue Ruan at ruanjue@gmail.com.