index
Build a deamination-aware reference index for a FASTA file. Run this once per reference before deamtools align.
index produces two things next to the FASTA:
the standard FASTA index (
<fasta>.fai, viasamtools faidx), used bybam2bw,bam2fragment, andqc; anda doubly-converted BWA index used by
alignto map heavily deaminated reads.
Synopsis
deamtools index --fasta FILE [--out_dir DIR] [--out_name NAME] [--force]
Arguments
Argument |
Default |
Description |
|---|---|---|
|
(required) |
Reference FASTA to index. |
|
(the FASTA’s directory) |
Directory for the converted reference and BWA index. |
|
(the FASTA file name) |
Base name for the converted reference and BWA index. |
|
(off) |
Rebuild every output even if it already exists. By default, steps whose output is already present are skipped. |
|
|
Global flag (before the subcommand): |
Note
--out_dir/--out_name control only the deamtools-specific converted reference and its BWA index. The standard <fasta>.fai is always written next to the FASTA, because the pysam-based subcommands (bam2bw, bam2fragment, qc) require it there. By default the converted index is also written next to the FASTA — which is where deamtools align looks for it.
Requirements
bwa and samtools must be on your PATH.
How it works
Deaminated reads carry many C→T (top strand) or G→A (bottom strand) conversions, so they align poorly against an unmodified reference. Following the bwa-meth strategy, index reduces the alphabet by writing a doubly-converted copy of the reference in which every chromosome appears twice:
f<chrom>— the forward sequence with all C converted to T;r<chrom>— the forward sequence with all G converted to A.
bwa index is then built on this converted reference. During align, read 1 is C→T-converted and read 2 is G→A-converted, so each read pair maps to a single converted contig (f… for top-strand-derived fragments, r… for bottom-strand-derived), which preserves proper pairing. The f/r prefix is stripped from the chromosome name when the final BAM is written.
Outputs
File |
Location |
Description |
|---|---|---|
|
next to the FASTA |
Standard FASTA index ( |
|
|
The doubly-converted reference. |
|
|
BWA-MEM index files. |
With the defaults, <out_dir>/<out_name> resolves to the FASTA’s own path, so the converted index is written as <fasta>.deamtools.c2t* next to the FASTA.
Examples
# Build the index next to the FASTA (skips outputs that already exist)
deamtools index --fasta hg38.fa
# Write the converted index to a separate directory
deamtools index --fasta hg38.fa --out_dir indexes --out_name hg38
# Force a full rebuild
deamtools index --fasta hg38.fa --force
After this completes, align reads with deamtools align.
Notes
The build is idempotent: re-running without
--forceskips thefaidx, conversion, andbwa indexsteps whose outputs already exist. Use--forceafter changing the FASTA.The converted reference doubles the genome size on disk, and
bwa indexcan take a while and use substantial memory for large genomes — this is a one-time cost per reference.