genome-alignment-qc
Assess alignment quality with coverage depth, mapping rates, insert size, and on-target metrics using samtools, mosdepth, and picard.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- genome-alignment-qc
- description
- Assess alignment quality with coverage depth, mapping rates, insert size, and on-target metrics using samtools, mosdepth, and picard.
02 资源文件 9
- 参考文档agents/claude.yaml301 B
- 参考文档agents/openai.yaml302 B
- 参考文档agents/README.md322 B
- 资产文件assets/.gitkeep—
- 参考文档config.yaml306 B
- 参考文档references/README.md68 B
- 参考文档references/samtools-mosdepth-picard-qc.md4.7 KB
- 脚本scripts/batch_run.sh4.4 KB
- 脚本scripts/run.sh8.1 KB
03 SKILL.md 正文
Skill: genome-alignment-qc
Use When
- User wants to evaluate BAM quality before variant calling.
- User needs to assess coverage depth and uniformity across the genome or target regions.
- User wants to check mapping rate, duplication rate, and insert size distribution.
- User needs to calculate on-target rate for whole-exome sequencing (WES).
- User wants to compare QC metrics across samples to detect batch effects.
Inputs
- Required:
- BAM file with index (
.bam+.bai).
- BAM file with index (
- Optional:
- Target BED file (for WES on-target metrics).
- Reference FASTA (required for picard metrics).
- Output directory (default: current directory).
- Per-base coverage flag (enables mosdepth per-base output; default: off).
Workflow
- Run
samtools statsandsamtools flagstatfor mapping summary. - Run
samtools idxstatsfor per-chromosome read counts. - Run
mosdepthfor coverage distribution (genome-wide, or restricted to target BED). - If target BED provided: compute on-target rate and per-target coverage statistics.
- Run
picard CollectInsertSizeMetricsfor insert size distribution. - Run
picard CollectAlignmentSummaryMetricsfor detailed alignment statistics. - Compile summary: mapping rate, duplicate rate, mean coverage, coverage uniformity (CV), median insert size, on-target rate (if WES).
- Flag metrics outside recommended thresholds (see
knowledge/sources/genomics/quality-thresholds.md).
Output Contract
samtools statsandsamtools flagstatoutput files.mosdepthcoverage files (.mosdepth.global.dist.txt,.per-base.bed.gzif enabled).- Picard insert size metrics file and histogram.
- Picard alignment summary metrics file.
- Compiled QC summary with key metrics and threshold flags.
Limits
- samtools, mosdepth, and picard must be installed and available on
$PATH. - mosdepth per-base output can be very large for WGS (~10 GB for 30x human).
- Picard requires a Java runtime (Java 8+).
- Reference FASTA is required for picard metrics but not for samtools/mosdepth.
- This skill reports metrics for a single BAM; multi-sample comparison is out of scope.
- Common failure cases:
- BAM index (
.bai) missing or out of date relative to the BAM file. - Target BED file using different chromosome naming convention than the BAM (e.g.,
chr1vs1). - Picard failing due to missing reference FASTA sequence dictionary (
.dict).
- BAM index (
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).