Align reads¶
bsbit align maps bisulfite sequencing reads to a reference genome and writes
an input-order BAM. It supports directional and non-directional libraries with
either single-end or paired-end data.
Inputs¶
Alignment requires a reference index and one or two FASTQ files. FASTQ may be plain, gzip-compressed, or BGZF-compressed. For paired-end data, the two files must contain matching read names in the same order and have the same number of records. See Input data for the complete input requirements.
Run alignment¶
For paired-end data, supply both read files:
bsbit align \
-x GRCh38.bsbit \
-1 sample_R1.fastq.gz \
-2 sample_R2.fastq.gz \
-o sample.bam \
-t 8
For single-end data, supply only read 1:
Common options¶
Advanced options¶
Alignment behavior controls
- Sensitivity: The default balances speed and sensitivity. Add
--sensitiveto search more candidate alignments for either layout at the cost of additional runtime. - Edit budget:
--max-edit-distanceis primarily intended for controlled sensitivity/CPU trade-offs and scientific ablations. A lower value excludes alignments outside that whole-read edit radius and can change mapping rate, coordinates, and MAPQ. In paired-end runs the configured bound applies independently to each mate and is preserved by adapter and rescue remapping. - Adapter and soft clipping:
--adapter autoand--adapter illuminaboth select the Illumina universal sequence. A literal A/C/G/T/N sequence selects a custom adapter;nonedisables adapter recognition. With--soft-clip auto, SE and default PE use exact adapter-supported repair, while sensitive PE may also perform candidate-local semi-global endpoint completion.--soft-clip adapterdisables that generic PE completion;--soft-clip nonedisables every soft-clipping path. The overlap and clip bounds are validated before reading input and are recorded in the metrics TSV. - Library direction: Directional alignment is the default. Add
--non-directionalwhen required; bsbit then makes one placement decision across all four supported bisulfite directions. This broader search may take longer. - Paired-end fragment span: For paired-end input,
--min-template-spanand--max-template-spanset the inclusive minimum and maximum outer reference span allowed for a concordant pair—the interval from the pair's leftmost through its rightmost mapped base. The defaults are0and1000bp, respectively.
Choose these parameters to cover the library's expected fragment-size
distribution. The bounds constrain concordant pairing, while
--max-template-span also limits mate rescue. Too narrow a range can
reject valid pairs and alter mapping status or MAPQ; too broad a range
admits implausible pairs and increases search cost.
Performance diagnostics
--metrics replaces the human-readable progress log with structured
performance metrics. It does not affect alignment results. See
Alignment metrics for
output details.
See the CLI reference for option limits, conflicts, and automatic thread allocation.
BAM output¶
bsbit align writes BAM directly to the requested output path. The default
output is compatible with bsbit call.
Optional output controls
--output-contract bismarkproduces Bismark-compatible output without changing alignment decisions.--mapped-onlyomits unmapped reads or read pairs but retains mapped records with MAPQ 0.
Validate the BAM¶
The BAM follows FASTQ input order and is not coordinate-sorted. Validate it before continuing: