面向 DNA 短读长的经典参考基因组比对工具,WGS/WES 流程中常用 BWA-MEM。Classic DNA read aligner; BWA-MEM is widely used in WGS/WES pipelines.
mamba install -c bioconda bwa
构建参考索引:
bwa index reference.fa
双端 BWA-MEM 比对:
bwa mem -t 16 reference.fa sample_R1.fq.gz sample_R2.fq.gz > sample.sam
带 read group 并直接排序:
bwa mem -t 16 -R '@RG\tID:sample\tSM:sample\tPL:ILLUMINA' reference.fa R1.fq.gz R2.fq.gz \
| samtools sort -@ 8 -o sample.sorted.bam
建立 BAM 索引:
samtools index sample.sorted.bam
mem:最常用子命令,适合 70bp 到较长 reads。-t:线程数。-R:read group,GATK 等下游流程通常需要。-M:把 shorter split hits 标记为 secondary,某些旧版 Picard 流程需要。SM read group 字段必须准确。