[meta]
name = "wtdbg2"
category = "assembly"
description = "Ultrafast and memory-efficient long-read de novo assembler using fuzzy Bruijn graphs"
tags = ["assembly", "long-read", "nanopore", "pacbio", "de-novo", "fast", "draft-assembly"]
author = "oxo-call built-in"
source_url = "https://github.com/ruanjue/wtdbg2"

[context]
concepts = [
    "WTDBG2 (Redbean) assembles long reads using fuzzy Bruijn graphs; it's very fast but produces draft assemblies.",
    "Two-step process: (1) wtdbg2 for overlapping and assembly; (2) wtpoa-cns for consensus polishing.",
    "Use -x for read type: ont (Oxford Nanopore), rs (PacBio CLR/RSII), sq (PacBio Sequel), ccs (HiFi).",
    "Use -g for estimated genome size; -i for input reads; -fo for output prefix.",
    "WTDBG2 outputs a .ctg.lay.gz file for consensus and produces final .ctg.fa after wtpoa-cns.",
    "For ONT data: wtdbg2 -x ont -g 5m -i reads.fq -fo assembly; then wtpoa-cns for polishing.",
    "Additional polishing with Medaka (ONT) or PBCCS/Arrow (PacBio) is recommended after WTDBG2.",
]

pitfalls = [
    "WTDBG2 skips error correction — raw assembly needs polishing before downstream analysis.",
    "The genome size estimate (-g) is required for assembly parameter tuning.",
    "WTDBG2 -x preset must match the read type — wrong preset degrades assembly quality.",
    "The consensus step (wtpoa-cns) is separate from the overlap step (wtdbg2).",
    "For complex or highly heterozygous genomes, WTDBG2 may produce fragmented assemblies.",
]

[[examples]]
task = "assemble genome from Oxford Nanopore reads"
args = "-x ont -g 5m -i reads.fastq.gz -fo assembly -t 16 && wtpoa-cns -t 16 -i assembly.ctg.lay.gz -fo assembly.ctg.fa"
explanation = "-x ont preset; -g 5m genome size; -fo output prefix; then wtpoa-cns for consensus polishing"

[[examples]]
task = "assemble genome from PacBio HiFi reads"
args = "-x ccs -g 3g -i hifi_reads.fastq.gz -fo hifi_assembly -t 32 && wtpoa-cns -t 32 -i hifi_assembly.ctg.lay.gz -fo hifi_assembly.ctg.fa"
explanation = "-x ccs for CCS/HiFi reads; -g 3g for 3 Gb genome; consensus with wtpoa-cns"

[[examples]]
task = "assemble bacterial genome from PacBio CLR reads"
args = "-x rs -g 4m -i clr_reads.fastq.gz -fo clr_assembly -t 8 && wtpoa-cns -t 8 -i clr_assembly.ctg.lay.gz -fo clr_assembly.ctg.fa"
explanation = "-x rs for PacBio RSII/CLR reads; two-step assembly and consensus"
