genome-read-alignment
Align short reads to a reference genome with BWA-MEM2, sort and index with samtools, and mark duplicates with picard.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- genome-read-alignment
- description
- Align short reads to a reference genome with BWA-MEM2, sort and index with samtools, and mark duplicates with picard.
02 资源文件 9
- 参考文档agents/claude.yaml301 B
- 参考文档agents/openai.yaml302 B
- 参考文档agents/README.md322 B
- 资产文件assets/.gitkeep—
- 参考文档config.yaml294 B
- 参考文档references/bwa-mem2-samtools-picard.md3.9 KB
- 参考文档references/README.md68 B
- 脚本scripts/batch_run.sh4.8 KB
- 脚本scripts/run.sh6.5 KB
03 SKILL.md 正文
Skill: genome-read-alignment
Use When
- User needs to align FASTQ reads to a reference genome.
- User wants to produce a coordinate-sorted, indexed BAM file.
- User needs to mark PCR or optical duplicates in aligned reads.
- User wants to add read group information (@RG) to alignments.
Inputs
- Required:
- Trimmed FASTQ file(s) (single-end or paired-end).
- Reference FASTA, pre-indexed for BWA-MEM2.
- Optional:
- Read group string (
@RG\tID:...\tSM:...\tPL:...\tLB:...\tPU:...). - Number of threads (default: 4).
- Output directory (default: current directory).
- Temporary directory for sorting/dedup intermediates.
- Optical duplicate pixel distance (default: 2500 for patterned flowcells).
- Mark-duplicate tool choice:
picard(default) orsamtools markdup.
- Read group string (
Workflow
- Validate that reference index files exist (
.0123,.amb,.ann,.bwt.2bit.64,.pac,.fai,.dict). - Construct a read group string from sample metadata if one is not provided (fields: ID, SM, PL, LB, PU).
- Run
bwa-mem2 memwith the read group, piping output tosamtools sortto produce a coordinate-sorted BAM. - Index the sorted BAM with
samtools index. - Mark duplicates with
picard MarkDuplicates(orsamtools markdupif selected). - Index the deduplicated BAM.
- Report alignment summary: total reads, mapped reads, properly paired reads, duplicate reads, mapping rate.
Output Contract
- Coordinate-sorted deduplicated BAM file (
.bam). - BAM index file (
.bai). - Duplicate metrics file (picard MarkDuplicates output).
- Alignment summary statistics (total, mapped, properly paired, duplicates, mapping rate).
Limits
- BWA-MEM2, samtools, and picard must be installed and available on
$PATH. - The BWA-MEM2 index must be pre-built (
bwa-mem2 index <ref.fa>). - Memory scales with reference genome size (~8 GB for human GRCh38).
- Picard requires a Java runtime (Java 8+).
- This skill handles single-sample alignment only; multi-sample merging is out of scope.
- Common failure cases:
- Reference index files missing or incomplete (e.g.,
.bwt.2bit.64absent). - Read group string malformed or missing required fields (ID, SM).
- Insufficient memory for BWA-MEM2 index loading (~8 GB for human genome).
- Reference index files missing or incomplete (e.g.,
04 同仓库更多 Skills
structured-intelligence-skill-creator
Create or update repository skills that conform to local templates, provider metadata requirements, registry rules, and validation workflows.
stat-survival-analysis
Estimate and compare survival functions using Kaplan-Meier curves and log-rank test, with optional Cox proportional hazards regression.
stat-pca
Perform PCA on a numeric data matrix to reduce dimensionality, visualize sample structure, and identify top contributing features.
stat-pairwise-correlation
Compute pairwise correlations and significance tests across all numeric variables, and produce a correlation heatmap.
stat-nonlinear-embedding
Embed high-dimensional data into 2D using t-SNE or UMAP for exploratory visualization of sample or cell relationships.
stat-logistic-regression
Fit a logistic regression model for binary outcomes, report odds ratios and model performance (AUC-ROC, confusion matrix).