Agent skill

Spatial Cnv

by TianGzlab in TianGzlab/OmicsClaw

Load when inferring copy-number variation per spot on a preprocessed spatial AnnData with chromosome-annotated genes via infercnvpy (default — log-ratio sliding-window) or Numbat (R, allele-aware…

Apache-2.0Auto-check passedData & Analytics

Install Spatial Cnv

skills CLI
$ npx skills add TianGzlab/OmicsClaw --skill spatial-cnv -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TianGzlab/OmicsClaw spatial-cnv --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TianGzlab/OmicsClaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/spatial/spatial-cnv .claude/skills/spatial-cnv && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
spatial-cnv
GitHub stars
161
Token cost
~1.3k tokens
SKILL.md length
506 words
Files
12 (incl. references)
Skills in repo
88
Repo updated
First seen
Licence
Apache-2.0

At a glance

Load when inferring copy-number variation per spot on a preprocessed spatial AnnData with chromosome-annotated genes via infercnvpy (default — log-ratio sliding-window) or Numbat (R, allele-aware…

  • Data & Analytics work in your project
  • SKILL.md covers When to use, Use from a step, API and Methods and parameters, plus 5 more sections
  • Runs Python and R scripts from its folder; calls python

What it does

Spatial Cnv is an agent skill from TianGzlab/OmicsClaw. Load when inferring copy-number variation per spot on a preprocessed spatial AnnData with chromosome-annotated genes via infercnvpy (default — log-ratio sliding-window) or Numbat (R, allele-aware clone deconvolution). Skip when var["chromosome"] / var["start"] / var["end"] gene-coord metadata is missing; no normal-reference subset can be defined.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 16 other files, including reference files (for example `_api.py`, `examples/example_step.py` and `r_visualization/README.md`).

It sits in Data & Analytics. It works with AnnData. The repository describes itself as: Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper. The licence is Apache-2.0.

When your agent uses it

  • Data & Analytics work in your project

Example prompts

  • “chromosome”
  • “] / var[”
  • “/spatial-cnv”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 90a3bec. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python and R), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Spatial Cnv loads about 1.3k tokens when it runs, and up to ~4.6k if it reads all its reference files. Until then it costs about 92 tokens; SKILL.md has 506 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~92
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TianGzlab/OmicsClaw at commit 90a3bec, republished under its Apache-2.0 licence (© TianGzlab). 506 words, ~1,299 tokens.

Download SKILL.mdSave it as .claude/skills/spatial-cnv/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
spatial-cnv
description
Load when inferring copy-number variation per spot on a preprocessed spatial AnnData with chromosome-annotated genes via infercnvpy (default — log-ratio sliding-window) or Numbat (R, allele-aware clone deconvolution). Skip when `var["chromosome"]` / `var["start"]` / `var["end"]` gene-coord metadata is missing; no normal-reference subset can be defined.
trigger
copy number variation, CNV, inferCNV, infercnvpy, Numbat, aneuploidy, chromosomal aberration, tumor clone
tags
spatial, cnv, copy-number, infercnvpy, numbat, tumor

spatial-cnv

When to use

Infer expression-based CNV with infercnvpy, or allele-aware CNV with R Numbat. Gene coordinates and an appropriate diploid reference are needed for interpretation.

Use from a step

python
from skills._sdk.notebook import load_skill
library = load_skill("spatial-cnv")
library.cnv(adata, reference_key='cell_type', reference_cat=['Normal'])

Run examples/example_step.py with the step runner for a synthetic, executable example.

API

<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
cnv(adata, *, method: str='infercnvpy', reference_key: str | None=None, reference_cat: list[str] | str | None=None, window_size: int=100, step: int=10, method_params: dict | None=None, random_state: int=0, allele_counts: pd.DataFrame | None=None)

Infer CNV in place from log-normalized X or Numbat raw counts.

infercnvpy needs var chromosome/start/end. Numbat needs layers['counts'], phased allele_counts and a diploid reference annotation. Counts and metadata are exchanged with R inside a temporary directory.

:param adata: AnnData with expression and method-specific annotations. :param method: infercnvpy (CLI default) or numbat. :param reference_key: Observation column marking reference cells; None uses all cells. :param reference_cat: Reference labels; None uses the backend's global reference. :param window_size: Genomic smoothing window, 100 genes by default. :param step: Sliding-window stride, 10 genes by default. :param method_params: CLI options with underscores, such as infercnv_n_jobs=1; None keeps defaults listed in references/parameters.md. :param random_state: infercnvpy PCA/graph/clustering and Numbat R seed, default 0. :param allele_counts: Numbat long-form DataFrame with cell/snp_id/CHROM/POS/AD/DP/GT/gene; None reads the legacy obsm['allele_counts'] table. Multiple SNPs per cell are allowed. :returns: The same AnnData with CNV matrices, scores and JSON diagnostics. :raises ValueError: Missing genomic annotations, raw counts or invalid parameters. :raises ImportError: Missing infercnvpy or R backend; use install_skill_deps.

run_info(adata, *, keep: bool=True) -> dict

Read the last CNV inference diagnostics.

:param adata: AnnData returned by cnv. :param keep: True retains diagnostics; False removes them before CLI serialization. :returns: Method, score summary, seed and any fallback details, or an empty dict.

scores(adata) -> pd.DataFrame

Return CNV scores and labels in observation order.

:param adata: AnnData after CNV inference. :returns: Barcode-indexed table of available CNV score/label/uncertainty columns.

Show full SKILL.md (216 more words)Show less
cnv_figure(adata, *, basis: str='spatial')

Plot CNV scores over supplied coordinates without saving.

:param adata: AnnData after CNV inference. :param basis: Coordinate key, spatial by default; X_umap is also supported. :returns: A matplotlib Figure owned by the caller. :raises KeyError: Missing coordinates or CNV score.

<!-- api:end -->

Methods and parameters

infercnvpy uses log-normalized X, a 100-gene window and stride 10. Numbat uses integer layers['counts'] and phased allele counts. Pass method-specific CLI option names with underscores in method_params. See parameters and methodology.

Gotchas

  • cnv rejects missing genomic chromosome, start and end columns for infercnvpy.
  • cnv requires real counts and obsm['allele_counts'] for Numbat; the example uses explicitly synthetic coordinates only for infercnvpy.
  • run_info records the clustering fallback if infercnvpy cannot build Leiden groups.
  • cnv(..., allele_counts=table) accepts multiple SNP rows per cell; its R subprocess uses the requested random seed.

Inputs and outputs

cnv returns the same AnnData with method-specific scores. scores returns a DataFrame and cnv_figure a Figure. CLI output includes processed.h5ad, reports and conditional score, bin, clone and uncertainty tables/plots. The full file inventory and conditions are in output contract.

CLI

bash
python skills/spatial/spatial-cnv/spatial_cnv.py --input input.h5ad --output results/

The CLI retains reports and the figure gallery. Function calls do not save files.

See also

  • spatial-preprocess supplies expression preprocessing.
  • Output contract lists method-specific files and AnnData fields.

Dependencies

anndata, infercnvpy, matplotlib, numpy, pandas, scanpy, scipy, seaborn, Matrix, numbat

© TianGzlab, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (references) in skills/spatial/spatial-cnv of TianGzlab/OmicsClaw.

  • SKILL.md
  • _api.py
  • examples/example_step.py
  • r_visualization/README.md
  • r_visualization/cnv_publication_template.R
  • references/methodology.md
  • references/output_contract.md
  • references/parameters.md
  • rscripts/numbat.R
  • spatial_cnv.py
  • tests/test_api.py
  • tests/test_spatial_cnv.py

Open the folder on GitHubat commit 90a3bec

Compare with similar skills

Spatial Cnv next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Spatial Cnv compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spatial Cnv this skillTianGzlab/OmicsClaw161—~1.3kAutomated safety check: PassApache-2.0
Pydeseqaipoch/medical-research-skills2k—~1.8kAutomated safety check: PassMIT
PyDESeq2 Differential Expressiondavila7/claude-code-templates32k12 repos~4kAutomated safety check: PassMIT
Tcga Bulk Data Preprocessing With OmicverseFreedomIntelligence/OpenClaw-Medical-Skills3.1k1 repos~850Automated safety check: PassNone
Scanpy Single-Cell Analysisdavila7/claude-code-templates32k16 repos~2.8kAutomated safety check: PassMIT
Alphagenome Predictionsgenomicsxai/alphagenome-pytorch162—~868Automated safety check: PassApache-2.0

Similar skills

  • Pydeseq

    aipoch/medical-research-skills

    Differential gene expression analysis for bulk RNA-seq count matrices using a DESeq2-like workflow in Python; use when you need Wald tests, FDR correction, and optional LFC shrinkage for…

    2k GitHub stars~1.8k tokensUpdated 21 days ago
    Data & AnalyticsAuto-check passed
  • PyDESeq2 Differential Expression

    davila7/claude-code-templates

    Runs differential gene expression analysis on bulk RNA-seq counts with PyDESeq2: design formulas, Wald tests, FDR correction and volcano or MA plots.

    32k GitHub starsUsed in 12 repos~4k tokens
    Research & ScienceAuto-check passed
  • Tcga Bulk Data Preprocessing With Omicverse

    FreedomIntelligence/OpenClaw-Medical-Skills

    Guide Claude through ingesting TCGA sample sheets, expression archives, and clinical carts into omicverse, initialising survival metadata, and exporting annotated AnnData files.

    3.1k GitHub starsUsed in 1 repo~850 tokens
    Data & AnalyticsAuto-check passed
  • Scanpy Single-Cell Analysis

    davila7/claude-code-templates

    Walks through single-cell RNA-seq analysis with Scanpy: loading .h5ad and 10X data, QC, normalization, PCA and UMAP, Leiden clustering, marker genes and cell type annotation.

    32k GitHub starsUsed in 16 repos~2.8k tokens
    Research & ScienceAuto-check passed
  • Alphagenome Predictions

    genomicsxai/alphagenome-pytorch

    Run AlphaGenome-PyTorch to get genomic track predictions — via the agt predict CLI (single locus, BED regions, whole chromosomes, raw FASTA sequences, or per-gene count tables/AnnData), variant…

    162 GitHub stars~868 tokensUpdated 22 days ago
    AI & LLM EngineeringAuto-check passed
  • Single-Cell Initial Analysis

    LigphiDonk/Oh-my--paper

    Runs a seven-step quality-control and exploration pipeline on scRNA-seq, CyTOF or flow cytometry data and writes a plain-language report of what it found.

    738 GitHub starsUsed in 1 repo~1.4k tokens
    Research & ScienceAuto-check passed

More from TianGzlab/OmicsClaw

All 88 skills in this repo
  • Bulkrna De

    TianGzlab/OmicsClaw

    Load when comparing gene expression between two conditions in bulk RNA-seq count data.

    161 GitHub starsUsed in 1 repo~867 tokens
    Auto-check passed
  • Bulkrna Cosinor Rhythm

    TianGzlab/OmicsClaw

    Load when the user needs Deterministic fixed-period 24-hour single-component cosinor OLS rhythm analysis for a bulk RNA time-course CSV.

    161 GitHub stars~840 tokensUpdated today
    Auto-check passed
  • Bulkrna Qc

    TianGzlab/OmicsClaw

    Load when checking a bulk RNA-seq count matrix for library-size outliers, gene detection rates, and sample-sample correlation before DE.

    161 GitHub starsUsed in 1 repo~789 tokens
    Auto-check passed
  • Sc Fastq Qc

    TianGzlab/OmicsClaw

    Load when checking raw single-cell FASTQ read quality (Phred / GC / adapter / length) before counting.

    161 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Sc Filter

    TianGzlab/OmicsClaw

    Load when removing low-quality cells and lowly-detected genes from a single-cell AnnData using QC-derived thresholds or tissue presets.

    161 GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Sc Markers

    TianGzlab/OmicsClaw

    Load when ranking cluster-level marker genes from a clustered single-cell AnnData via Scanpy Wilcoxon / t-test / logreg or COSG specificity.

    161 GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Works with

Questions about Spatial Cnv

What does Spatial Cnv do?

Load when inferring copy-number variation per spot on a preprocessed spatial AnnData with chromosome-annotated genes via infercnvpy (default — log-ratio sliding-window) or Numbat (R, allele-aware…. Spatial Cnv is an agent skill from TianGzlab/OmicsClaw. Load when inferring copy-number variation per spot on a preprocessed spatial AnnData with chromosome-annotated genes via infercnvpy (default — log-ratio sliding-window) or Numbat (R, allele-aware clone deconvolution).

When should I use Spatial Cnv?

Spatial Cnv fits situations like: data & Analytics work in your project.

How do I install Spatial Cnv in Claude Code?

Run `npx skills add TianGzlab/OmicsClaw --skill spatial-cnv -a claude-code`. Or copy the skill folder (skills/spatial/spatial-cnv in TianGzlab/OmicsClaw) into .claude/skills/spatial-cnv in your project. Claude Code loads it when a task matches its description.

How do I install Spatial Cnv in Codex?

Run `npx skills add TianGzlab/OmicsClaw --skill spatial-cnv -a codex`. Or copy the skill folder (skills/spatial/spatial-cnv in TianGzlab/OmicsClaw) into .agents/skills/spatial-cnv in your project. Codex loads it when a task matches its description.

Can I use Spatial Cnv in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TianGzlab/OmicsClaw --skill spatial-cnv -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spatial-cnv, .gemini/skills/spatial-cnv, .github/skills/spatial-cnv and .opencode/skills/spatial-cnv in your project.

What does Spatial Cnv need to run?

Going by SKILL.md and its folder, Spatial Cnv needs Python and R for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Spatial Cnv access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Spatial Cnv safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Spatial Cnv use?

Spatial Cnv is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spatial Cnv use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.3k tokens, read only when the agent opens those files.

What are the alternatives to Spatial Cnv?

Skills that share tags, products or a category with Spatial Cnv: Pydeseq (aipoch/medical-research-skills, 2k stars), PyDESeq2 Differential Expression (davila7/claude-code-templates, 32k stars), Tcga Bulk Data Preprocessing With Omicverse (FreedomIntelligence/OpenClaw-Medical-Skills, 3.1k stars) and Scanpy Single-Cell Analysis (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spatial Cnv?

TianGzlab (a GitHub organization) maintains it in TianGzlab/OmicsClaw, which has 161 GitHub stars. The repository holds 88 skills in this directory. The repository was last updated on October 7, 2026.

Source: TianGzlab/OmicsClaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.