bwa
Quick Start
- Command:
bwa - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/bwa - Version: 0.7.19-r1273
- Reference: See references/help.md for detailed usage
When To Use This Tool
- Align low-divergence DNA sequencing reads to a reference genome.
- Use
bwa indexto build the reference index andbwa memfor modern short-read alignment. - Good default for WGS, targeted DNA-seq, and many standard Illumina DNA workflows.
- If unsure which BWA algorithm to use,
bwa memis the normal starting point.
Common Patterns
# 1) Build the BWA index
bwa index reference.fa
# 2) Paired-end alignment with read group
bwa mem \
-t 16 \
-R '@RG\tID:sample1\tSM:sample1\tPL:ILLUMINA' \
reference.fa \
sample_R1.fastq.gz sample_R2.fastq.gz \
> sample.sam
# 3) Single-end alignment
bwa mem \
-t 8 \
reference.fa \
sample.fastq.gz \
> sample.sam
Recommended Workflow
- Build the BWA index from the exact reference FASTA used for the project.
- Align with
bwa mem, usually with explicit-tand a correct read-group line. - Convert, sort, and index the SAM/BAM output with
samtools. - Check mapping rate and duplicate behavior before variant calling or coverage analysis.
Guardrails
bwais a dispatcher;bwa --helpis not the interface you want, whilebwa,bwa mem, andbwa indexare.bwa memexpects an indexed reference; forgettingbwa indexis a common failure mode.- Add an
@RGline for any workflow that will later merge BAMs or call variants. - The usual output is SAM to stdout; redirect it explicitly or pipe it into downstream tools.