Agent skill

Sc Gene Programs

by TianGzlab in TianGzlab/OmicsClaw

Load when extracting gene programs (NMF / cNMF factorisation) and per-cell program usage scores from a non-negative scRNA AnnData.

Apache-2.0Auto-check passedResearch & Science

Install Sc Gene Programs

skills CLI
$ npx skills add TianGzlab/OmicsClaw --skill sc-gene-programs -a claude-code

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

GitHub CLI
$ gh skill install TianGzlab/OmicsClaw sc-gene-programs --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/singlecell/scrna/sc-gene-programs .claude/skills/sc-gene-programs && 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
sc-gene-programs
GitHub stars
161
Token cost
~1.8k tokens
SKILL.md length
621 words
Files
10 (incl. references)
Skills in repo
88
Repo updated
First seen
Licence
Apache-2.0

At a glance

Load when extracting gene programs (NMF / cNMF factorisation) and per-cell program usage scores from a non-negative scRNA AnnData.

  • Works in 7 steps: Auto-fallback check: try import cnmf; if… → Load AnnData (--input) or build a demo. → Preflight: pick source matrix per… → …
  • Tasks that involve Bioinformatics
  • SKILL.md covers When to use, Use in an analysis step, Inputs & Outputs and Flow, plus 5 more sections
  • Runs Python scripts from its folder; calls python

What it does

Sc Gene Programs is an agent skill from TianGzlab/OmicsClaw. Load when extracting gene programs (NMF / cNMF factorisation) and per-cell program usage scores from a non-negative scRNA AnnData. Skip when ranking marker genes per cluster (use sc-markers); inferring TF → target regulons (use sc-grn).

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

It sits in Research & Science, covering Bioinformatics. 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

  • Tasks that involve Bioinformatics

Example prompts

  • “/sc-gene-programs”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Auto-fallback check: try import cnmf; if it fails, switch to nmf and record the fallback.
  2. Load AnnData (--input) or build a demo.
  3. Preflight: pick source matrix per --layer (auto-prefer layers["counts"] for cnmf when --layer is unset); reject negative values; warn if…
  4. Run cNMF (consensus NMF with --n-iter iterations per factorization) or sklearn NMF (single run, --seed).
  5. Build top-genes-per-program table; compute per-program correlation matrix.
  6. Detect degenerate output → record diagnostics; do NOT raise.
  7. Save tables, figures, processed.h5ad, report.md, result.json.

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), 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

Sc Gene Programs loads about 1.8k tokens when it runs, and up to ~3.1k if it reads all its reference files. Until then it costs about 63 tokens; SKILL.md has 621 words of instructions outside code blocks.

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

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). 621 words, ~1,770 tokens.

Download SKILL.mdSave it as .claude/skills/sc-gene-programs/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
sc-gene-programs
description
Load when extracting gene programs (NMF / cNMF factorisation) and per-cell program usage scores from a non-negative scRNA AnnData. Skip when ranking marker genes per cluster (use sc-markers); inferring TF → target regulons (use sc-grn).
tags
singlecell, scrna, gene-programs, nmf, cnmf, factorisation

sc-gene-programs

When to use

The user has a non-negative scRNA AnnData (raw counts or log-normalised expression) and wants to decompose it into K gene programs (latent factors) plus a per-cell usage matrix. Two methods:

  • cnmf (default) — consensus NMF (multiple runs + clustering of factors) for stable programs. Auto-falls back to nmf if the cnmf package isn't installed.
  • nmf — sklearn NMF, single run.

Output: tables/program_usage.csv (cells × K), tables/program_weights.csv (programs × genes), tables/top_program_genes.csv (top-N genes per program).

For per-cluster marker discovery use sc-markers; for TF → target regulons use sc-grn; for per-cell pathway scores against curated gene sets use sc-pathway-scoring.

Use in an analysis step

Use load_skill from the notebook SDK; write returned objects with write_output. This runnable example is also in examples/example_step.py. The CLI remains available for standalone reports and galleries.

python
# Extract six NMF programs from the log-normalized PBMC68k snapshot.
# Reads pbmc68k_reduced.
# Calls sc-gene-programs: find_programs, top_program_genes, usage_figure.

from skills._sdk.notebook import load_demo, load_skill, write_output

programs = load_skill('sc-gene-programs')
adata = load_demo('pbmc68k_reduced').raw.to_adata()

result = programs.find_programs(adata, method='nmf')
top = programs.top_program_genes(result, n=10)
write_output(result, 'intermediate/programs.h5ad')
write_output(top, 'tables/top_program_genes.csv')
write_output(programs.usage_figure(result), 'figures/program_usage.png')

assert result.obsm['X_gene_programs'].shape == (adata.n_obs, 6)
assert (result.obsm['X_gene_programs'] >= 0).all()
assert top['program'].nunique() == 6
assert set(top.gene).issubset(adata.var_names)

Inputs & Outputs

Input is a non-negative AnnData expression matrix; layer selects another matrix. PCA and neighbors are not required. find_programs returns a copy with obsm["X_gene_programs"] and tables exposed by the API helpers.

The CLI writes processed.h5ad, report.md, result.json, tables/program_usage.csv (cells × programs), tables/program_weights.csv (programs × genes), and tables/top_program_genes.csv. cNMF additionally writes tables/program_tpm.csv. Gallery figures are mean_program_usage.png and, for multiple programs, program_correlation.png. Figure source tables, including program correlations, live under figure_data/.

Flow

  1. Auto-fallback check: try import cnmf; if it fails, switch to nmf and record the fallback.
  2. Load AnnData (--input) or build a demo.
  3. Preflight: pick source matrix per --layer (auto-prefer layers["counts"] for cnmf when --layer is unset); reject negative values; warn if n_genes < 50 or running NMF on raw counts without --layer counts.
  4. Run cNMF (consensus NMF with --n-iter iterations per factorization) or sklearn NMF (single run, --seed).
  5. Build top-genes-per-program table; compute per-program correlation matrix.
  6. Detect degenerate output → record diagnostics; do NOT raise.
  7. Save tables, figures, processed.h5ad, report.md, result.json.

Gotchas

  • run_info(result) records requested and executed methods and the reason when missing cNMF falls back to sklearn NMF. CLI result.json["summary"]["backend"] reports the executed backend.
  • CLI preflight rejects negative input. The API retains the existing solver's negative-to-zero clipping; use a non-negative matrix for interpretable program_weights.
  • cNMF prefers layers["counts"] when layer is unset; NMF uses X. A missing cNMF backend falls back to NMF's matrix selection.
  • n_iter / --n-iter is the maximum number of iterations per factorization, not the number of consensus replicates. run_info includes the cNMF replicate count when used.
  • CLI result.json["summary"]["degenerate_output"] reports collapsed programs without making the run fail. Inspect the flag and degenerate_issues before using the tables.
Show full SKILL.md (235 more words)Show less

Key CLI

bash
# Demo (cNMF on synthetic data, falls back to NMF if cnmf missing)
python skills/singlecell/scrna/sc-gene-programs/sc_gene_programs.py --demo --output /tmp/sc_gp_demo

# cNMF with 8 programs on raw counts
python skills/singlecell/scrna/sc-gene-programs/sc_gene_programs.py \
  --input clustered.h5ad --output results/ \
  --method cnmf --n-programs 8 --n-iter 200 --layer counts

# NMF on log-normalised .X (faster, less stable)
python skills/singlecell/scrna/sc-gene-programs/sc_gene_programs.py \
  --input normalized.h5ad --output results/ \
  --method nmf --n-programs 10 --top-genes 50

See also

  • references/parameters.md — every CLI flag, NMF / cNMF tunables
  • references/methodology.md — when consensus NMF wins; layer-selection guide
  • references/output_contract.md — obsm["X_gene_programs"] / tables/program_*.csv schemas
  • Adjacent skills: sc-preprocessing (upstream — produces a non-negative .X or layers["counts"]), sc-markers (parallel — cluster markers, NOT latent factors), sc-pathway-scoring (parallel — supervised program scoring against curated gene sets), sc-grn (parallel — TF → target regulons; complementary to gene programs)

Dependencies

Python packages this skill's script needs. They are not installed for you — check before a long run.

anndata, cnmf, matplotlib, numpy, pandas, scanpy, scikit-learn, scipy

API

<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
find_programs(adata, *, method: str='cnmf', n_programs: int=6, n_iter: int=400, layer: str | None=None, top_genes: int=30, random_state: int=0)

Return a copy with per-cell usage in obsm['X_gene_programs'].

cNMF uses counts when available; missing cNMF falls back to sklearn NMF, recorded by run_info. NMF uses X unless layer is set. Negative values are clipped to zero by the existing solver. n_iter limits each factorization's iterations, not the number of cNMF replicates. Both methods use random_state. Program weights and ranked genes are available through the table helpers.

program_weights(adata) -> pd.DataFrame

Return program-by-gene weights from find_programs.

top_program_genes(adata, *, n: int | None=None) -> pd.DataFrame

Return ranked genes and weights; n optionally limits genes per program.

program_correlation(adata) -> pd.DataFrame

Return Pearson correlations between per-cell program usages.

usage_figure(adata)

Return a heatmap figure of cells by program usage, without writing files.

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

Return methods and solver diagnostics; keep=False removes the run record.

<!-- api:end -->

© 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 9 other files (references) in skills/singlecell/scrna/sc-gene-programs of TianGzlab/OmicsClaw.

  • SKILL.md
  • _api.py
  • examples/example_step.py
  • references/methodology.md
  • references/output_contract.md
  • references/parameters.md
  • references/r_visualization.md
  • sc_gene_programs.py
  • tests/test_programs_api.py
  • tests/test_sc_gene_programs_methods.py

Open the folder on GitHubat commit 90a3bec

Compare with similar skills

Sc Gene Programs 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.

Sc Gene Programs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sc Gene Programs this skillTianGzlab/OmicsClaw161—~1.8kAutomated safety check: PassApache-2.0
Scanpy Single-Cell Analysisdavila7/claude-code-templates32k16 repos~2.8kAutomated safety check: PassMIT
PyDESeq2 Differential Expressiondavila7/claude-code-templates32k12 repos~4kAutomated safety check: PassMIT
Single-Cell Initial AnalysisLigphiDonk/Oh-my--paper7381 repos~1.4kAutomated safety check: PassMIT
Anndataaipoch/medical-research-skills2k—~1.7kAutomated safety check: PassMIT
Multiomics StatisticsVectorSpaceLab/AREX-Skill328—~1kAutomated safety check: PassGPL-3.0

Similar skills

  • 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
  • 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
  • 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
  • Anndata

    aipoch/medical-research-skills

    Data structure for annotated matrices in single-cell analysis; use when reading/writing .h5ad (or zarr) and exchanging data with the scverse ecosystem.

    2k GitHub stars~1.7k tokensUpdated 21 days ago
    Research & ScienceAuto-check passed
  • Multiomics Statistics

    VectorSpaceLab/AREX-Skill

    A skill your agent uses for OmicVerse bulk RNA-seq, enrichment/signature scoring, metabolomics, proteomics, microbiome, and statistical table workflows.

    328 GitHub stars~1k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Scgpt

    JimLiu/science-skills

    Embed and annotate single-cell expression data with scGPT, a foundation model for single-cell biology.

    227 GitHub starsUsed in 4 repos~1.3k 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 yesterday
    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 Sc Gene Programs

What does Sc Gene Programs do?

Load when extracting gene programs (NMF / cNMF factorisation) and per-cell program usage scores from a non-negative scRNA AnnData. Sc Gene Programs is an agent skill from TianGzlab/OmicsClaw. Load when extracting gene programs (NMF / cNMF factorisation) and per-cell program usage scores from a non-negative scRNA AnnData.

When should I use Sc Gene Programs?

Sc Gene Programs fits situations like: tasks that involve Bioinformatics.

How do I install Sc Gene Programs in Claude Code?

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

How do I install Sc Gene Programs in Codex?

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

Can I use Sc Gene Programs 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 sc-gene-programs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sc-gene-programs, .gemini/skills/sc-gene-programs, .github/skills/sc-gene-programs and .opencode/skills/sc-gene-programs in your project.

What does Sc Gene Programs need to run?

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

Does Sc Gene Programs 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 Sc Gene Programs 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 Sc Gene Programs use?

Sc Gene Programs 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 Sc Gene Programs use?

About 1.8k tokens (SKILL.md is roughly 7.1k 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 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Sc Gene Programs?

Skills that share tags, products or a category with Sc Gene Programs: Scanpy Single-Cell Analysis (davila7/claude-code-templates, 32k stars), PyDESeq2 Differential Expression (davila7/claude-code-templates, 32k stars), Single-Cell Initial Analysis (LigphiDonk/Oh-my--paper, 738 stars) and Anndata (aipoch/medical-research-skills, 2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sc Gene Programs?

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.