一键导入
bwa-mem2-alignment
Use BWA-MEM2 — the SIMD-accelerated BWA-MEM replacement — for 2-3x speedup on human genome alignment with identical results to BWA-MEM.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use BWA-MEM2 — the SIMD-accelerated BWA-MEM replacement — for 2-3x speedup on human genome alignment with identical results to BWA-MEM.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Pass work between ORS skills with a Material Passport — a structured JSON envelope that captures inputs, outputs, decisions, and provenance so a downstream skill can resume without re-deriving context. Use when one skill produces output that another skill must consume, especially across category boundaries (e.g. analysis → writing, sequencing → statistics).
Discover and maintain `## Cross-references` between ORS skills. Given a new or edited skill, suggest related skills (same category, shared tags, complementary workflows). Verify all xref slugs resolve to existing SKILL.md files. Use when adding a new skill, when sibling skills move, or when an audit reveals dangling xrefs.
7-mode AI failure-mode checklist applied before publishing any ORS artifact (skill, manuscript section, dataset card, agent output). Catches: fabricated citations, silent failures, scope creep, missing provenance, unsupervised writes, version drift, hallucinated APIs. Use as the final pass before any 'publish', 'release', 'merge', or 'finalize' action.
Version, changelog, and marketplace workflow for ORS skills. Semver discipline, breaking-change protocol, marketplace.json update, README refresh, and the v0.X.Y → v1.0.0 graduation criteria. Use when bumping a skill version, publishing a release, or upgrading the ORS package version.
Author a new ORS skill from scratch using the v0.4.0 schema. Produces a valid SKILL.md (frontmatter + metadata + sections) following spec/skill-format.md, guided by spec/author-guide.md, validated by scripts/validate-skills.py. Use when a user says 'add a new skill', 'create a skill for X', or 'I want to contribute a skill'.
Process many FASTA/FASTQ/GenBank files in batch — merge, split, convert, summarize, organize — using Biopython 1.83+.
| name | bwa-mem2-alignment |
| description | Use BWA-MEM2 — the SIMD-accelerated BWA-MEM replacement — for 2-3x speedup on human genome alignment with identical results to BWA-MEM. |
| license | MIT |
minimap2.bwa-mem2 ≥ 2.2.1 (built with AVX2 / AVX-512)samtools ≥ 1.19bwa-mem2 index reference/genome.fa
# Creates genome.fa.{0123, amb, ann, bwt.2bit.64, pac}
The index format is different from BWA-MEM (bwt.2bit.64 vs bwt), so a BWA-MEM2 index is not compatible with BWA-MEM and vice versa. Pick one and stick with it.
The CLI is intentionally a strict superset of BWA-MEM, so the standard pipeline works:
bwa-mem2 mem -t 16 -M -K 100000000 \
-R '@RG\tID:s1\tSM:s1\tPL:ILLUMINA\tLB:lib1' \
reference/genome.fa \
reads/R1.fq.gz reads/R2.fq.gz |
samtools sort -@ 8 -m 4G -o s1.sorted.bam -
samtools index s1.sorted.bam
bwa-mem2 mem -t 16 -M -R '@RG\tID:s1\tSM:s1' ref.fa reads.fq.gz |
samtools sort -@ 8 -o s1.bam -
samtools index s1.bam
BWA-MEM2 2.2.x has a single index command for the modern mem algorithm (the older bwtgen and bwt2ix are deprecated):
bwa-mem2 index ref.fa
# Time both on the same input
time bwa mem -t 16 -M ref.fa R1.fq.gz R2.fq.gz > /dev/null
time bwa-mem2 mem -t 16 -M ref.fa R1.fq.gz R2.fq.gz > /dev/null
Typical on a 30x human WGS sample: BWA-MEM takes ~6-8 hours with 16 cores; BWA-MEM2 takes ~2.5-3.5 hours on the same hardware.
for r1 in reads/*_R1.trimmed.fq.gz; do
base=$(basename "$r1" _R1.trimmed.fq.gz)
r2="reads/${base}_R2.trimmed.fq.gz"
bwa-mem2 mem -t 16 -M -R "@RG\tID:${base}\tSM:${base}\tPL:ILLUMINA" \
ref.fa "$r1" "$r2" |
samtools sort -@ 8 -o "bam/${base}.bam" -
samtools index "bam/${base}.bam"
done
nf-core/sarek (the standard germline + somatic pipeline) defaults to BWA-MEM2 as of v3.2. No CLI changes needed for users.
| Flag | Behavior |
|---|---|
-t N | Threads (BWA-MEM2 auto-uses multiple threads internally even without this, but -t controls the parallel thread pool) |
-M | Picard-style split/marking |
-K 100M | Disable seed chunking (good for high-quality short reads) |
-Y | Soft-clip supplementary (for variant callers) |
-j | ALT-aware soft clipping (GRCh38) |
-R '@RG...' | Read group |
-k 19 | Min seed length (default 19) |
-a | Output all alignments (chimera detection) |
.bwt.2bit.64 is not BWA-MEM's .bwt. If you bwa-mem2 index then bwa mem, the alignment will fail with a missing file.-t 16 or higher.@RG will break it; use \t.samtools flagstat output is essentially identical to BWA-MEM v0.7.17.diff the FLAG/MAPQ columns — only a tiny fraction of MAPQ=0 reads should differ.| Need | Tool |
|---|---|
| Even faster (GPU) | fast-bwa-mem2 (NVIDIA Parabricks), but closed source |
| Long reads | minimap2 |
| Splice-aware RNA | STAR, HISAT2 |
| Short ChIP-seq reads | bowtie2 |
10.1109/HPEC.2019.8916176ors-bioinformatics-sequence-bwa-alignment, ors-bioinformatics-sequence-samtools-bam-processing.bwa-mem2-dna-aligner skill; brought in line with BWA-MEM2 2.2.1.Other skills in this category: