genomics-variant-annotation
Load when summarising functional impact of an annotated variant CSV — per-IMPACT counts (HIGH / MODERATE / LOW / MODIFIER), top consequences, gene-affected count. Skip when input is a raw VCF (convert with `bcftools +split-vep` first); calling raw variants (use genomics-variant-calling); filtering VCFs (use genomics-vcf-operations).
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-08
- Stars
- ★ 161
- Forks
- 27
01 前言 Front Matter
- name
- genomics-variant-annotation
- tags
- [ "genomics", "annotation", "vep", "snpeff", "annovar", "consequence", "impact" ]
- trigger
- variant annotation, VEP, snpEff, ANNOVAR, functional effect
- description
- Load when summarising functional impact of an annotated variant CSV — per-IMPACT counts (HIGH / MODERATE / LOW / MODIFIER), top consequences, gene-affected count. Skip when input is a raw VCF (convert with `bcftools +split-vep` first); calling raw variants (use genomics-variant-calling); filtering VCFs (use genomics-vcf-operations).
02 资源文件 8
- 脚本_api.py2.4 KB
- 资产文件data/example.csv301 B
- 脚本examples/example_step.py723 B
- 参考文档references/methodology.md929 B
- 参考文档references/output_contract.md812 B
- 参考文档references/parameters.md223 B
- 脚本tests/test_api.py675 B
- 脚本variant_annotation.py11.8 KB
03 SKILL.md 正文
genomics-variant-annotation
When to use
Load this skill for the file-based analysis named in the description. The function library and CLI share the same calculations; no external aligner, assembler, caller or annotation service is started.
Use from a step
from skills._sdk.notebook import load_skill, read_input, write_output
library = load_skill("genomics-variant-annotation")
data = read_input("input.csv", reader=library.read_records)
result = library.analyze(data)
write_output(result, "tables/result.csv")
write_output(library.distribution_figure(result), "figures/distribution.png")
Run examples/example_step.py through the step runner for a small,
hand-worked synthetic fixture. It asserts known summary values.
The reader materializes the input in memory; use bounded FASTQ reads or
pre-filter large genomic files before loading them.
API
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
read_records(path: str | Path) -> pd.DataFrame
Read records through read_input(path, reader=library.read_records).
:param path: Existing input file in the format documented under Inputs and outputs. :returns: Parsed records as a DataFrame. :raises ValueError: Input values or file structure cannot be parsed.
analyze(data: pd.DataFrame) -> pd.DataFrame
Compute variant-annotation summaries and return a new table, leaving data unchanged.
:param data: Records containing impact, consequence, gene, cadd_phred.
:returns: Result table with diagnostics and summary in attrs['run_info']. :raises ValueError: Required columns are absent or records are empty or invalid.
run_info(data: pd.DataFrame, *, keep: bool=True) -> dict
Return the analysis diagnostics and summary.
:param data: Result returned by analyze. :param keep: Keep diagnostics by default; the CLI passes False. :returns: Independent diagnostics dictionary. :raises ValueError: analyze has not populated diagnostics.
distribution_figure(data: pd.DataFrame)
Plot cadd_phred values without writing files.
:param data: Result table containing cadd_phred. :returns: Matplotlib Figure. :raises ValueError: The value column is absent or the table is empty.
<!-- api:end -->
Methods and parameters
analyze returns a new DataFrame and leaves the input unchanged.
run_info(result) returns the summary and method diagnostics.
The CLI passes keep=False so diagnostics do not enter output tables.
All calculations are deterministic; synthetic CLI demos retain seed 42.
Gotchas
analyzesummarizes annotations already supplied by the caller; it does not run VEP, SIFT, PolyPhen or CADD.analyzerequires lowercase impact, consequence, gene and cadd_phred columns. Missense rows also require sift_prediction and polyphen_prediction.tables/annotated_variants.csvfrom --demo contains simulated scores, not predictions for real variants.
Inputs and outputs
Input files:
- File types:
.csv - Accepts artifact
genomics.variant_table(csv)
CLI output files:
tables/annotated_variants.csvtables/impact_distribution.csvreport.mdresult.json- Produces artifact
genomics.annotated_variantsastables/annotated_variants.csv(csv)
The library writes no files. Steps use write_output; the CLI owns the
listed artifacts. Public figure functions return matplotlib Figures and
do not add new CLI outputs.
CLI
python skills/genomics/genomics-variant-annotation/variant_annotation.py --input input_file --output results/
python skills/genomics/genomics-variant-annotation/variant_annotation.py --demo --output /tmp/genomics_variant_annotation_demo
See also
references/parameters.mdreferences/methodology.mdreferences/output_contract.md
Dependencies
numpy, pandas, matplotlib
04 同仓库更多 Skills
demo-skill
A fixture skill for the skill environment tests. Use it for nothing else.
fake-domains
Test fixture for the golden deployment in tests/entry. Load never; it has no script.
replace-me-skill
Load when copying this directory to bootstrap a new OmicsClaw skill. Skip when an existing skill already covers the request.
spatial-velocity
Load when estimating RNA velocity on a spatial AnnData with `layers["spliced"]` + `layers["unspliced"]` via scVelo (stochastic / deterministic / dynamical) or veloVI (deep generative). Skip when input lacks the spliced/unspliced layers (must be quantified upstream by velocyto / kb-python / STARsolo); non-spatial scRNA velocity (use sc-velocity).
spatial-trajectory
Load when inferring pseudotime / lineage trajectories on a preprocessed spatial AnnData via DPT (default — diffusion pseudotime), CellRank (terminal-state + fate-probability), or Palantir (waypoint branch probabilities). Skip when the data has spliced/unspliced layers and you want velocity-driven dynamics (use spatial-velocity); non-spatial scRNA pseudotime (use sc-pseudotime).
spatial-statistics
Load when running spatial autocorrelation / hotspot / co-occurrence / neighbourhood-enrichment / Ripley K stats on a clustered spatial AnnData via squidpy. Skip when ranking spatially variable genes (use spatial-genes); tissue domain detection (use spatial-domains).