Agent skill

Sc Metacell

by TianGzlab in TianGzlab/OmicsClaw

Load when aggregating single cells into metacells (sample-aware coarse-grained pseudo-cells) on a normalised scRNA AnnData via SEACells or KMeans on a low-D embedding.

Apache-2.0Auto-check passedResearch & Science

Install Sc Metacell

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

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

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

At a glance

Load when aggregating single cells into metacells (sample-aware coarse-grained pseudo-cells) on a normalised scRNA AnnData via SEACells or KMeans on a low-D embedding.

  • Tasks that involve Bioinformatics
  • SKILL.md covers Use from a step, API, Methods and parameters and Gotchas, plus 3 more sections
  • Runs Python scripts from its folder; calls python
  • Tasks that involve Embeddings

What it does

Sc Metacell is an agent skill from TianGzlab/OmicsClaw. Load when aggregating single cells into metacells (sample-aware coarse-grained pseudo-cells) on a normalised scRNA AnnData via SEACells or KMeans on a low-D embedding. Skip when ranking marker genes per cluster (use sc-markers); trajectory pseudotime ordering (use sc-pseudotime).

Its SKILL.md is about 1.3k 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 and Embeddings. 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
  • Tasks that involve Embeddings

Example prompts

  • “/sc-metacell”

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), 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 Metacell loads about 1.3k tokens when it runs, and up to ~2.3k if it reads all its reference files. Until then it costs about 73 tokens; SKILL.md has 487 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
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
~2.3k

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). 487 words, ~1,333 tokens.

Download SKILL.mdSave it as .claude/skills/sc-metacell/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
sc-metacell
description
Load when aggregating single cells into metacells (sample-aware coarse-grained pseudo-cells) on a normalised scRNA AnnData via SEACells or KMeans on a low-D embedding. Skip when ranking marker genes per cluster (use sc-markers); trajectory pseudotime ordering (use sc-pseudotime).
tags
singlecell, scrna, metacell, seacells, aggregation, pseudo-cells

sc-metacell

Use from a step

python
aggregation = load_skill("sc-metacell")
cells = read_input("clustered.h5ad")
metacells = aggregation.metacells(cells, method="kmeans", n_metacells=30)
write_output(aggregation.cell_to_metacell(cells), "tables/cell_to_metacell.csv")
write_output(aggregation.metacell_summary(metacells), "tables/metacell_summary.csv")
write_output(metacells, "intermediate/metacells.h5ad")

The input receives obs['metacell']; the returned AnnData contains the aggregates. See examples/example_step.py for a PBMC example.

API

<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
metacells(adata, *, method: str='seacells', use_rep: str='X_pca', n_metacells: int=30, min_iter: int=10, max_iter: int=30, n_neighbors: int=15, n_pcs: int=20, random_state: int=0, celltype_key: str='leiden')

Annotate input cells and return a new mean-expression metacell AnnData.

KMeans uses the selected embedding. SEACells falls back to KMeans only when its package cannot be imported; a warning and run_info identify the fallback. Runtime errors propagate. Counts are averaged, not summed, using layers['counts'] when present, else X. Input X is preserved; obs['metacell'] receives the assignments.

:param method: seacells (default) or kmeans. :param use_rep: Existing embedding, default X_pca. :param n_metacells: Requested aggregates, default 30; at least 2 and fewer than cells. :param min_iter: SEACells minimum fitting iterations, default 10. :param max_iter: SEACells maximum fitting iterations, default 30. :param n_neighbors: Neighbor count for SEACells when its graph is absent, default 15. :param n_pcs: PCs for that graph, default 20. :param random_state: Seed for KMeans and SEACells initialization, default 0. :param celltype_key: SEACells dominant-celltype annotation, default leiden. KMeans retains the legacy dominant_label from the first obs column. :returns: A new AnnData with mean_expression layer, n_cells and dominant_label. :raises ValueError: The method, embedding or numerical parameters are invalid.

aggregate_metacells(adata, labels: pd.Series | None=None)

Return mean-expression aggregates for labels, or the input obs['metacell'].

Labels must cover every cell. Prefer layers['counts'] over X. This is not a summed pseudobulk matrix and does not infer biological replicates.

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

Read requested/executed method and aggregation diagnostics from the result.

metacell_summary(madata) -> pd.DataFrame

Return a copy of the aggregate's size and dominant-label metadata.

cell_to_metacell(adata) -> pd.DataFrame

Return cell and metacell columns from the annotated input AnnData.

size_distribution_figure(madata)

Return a matplotlib Figure of cells per metacell.

<!-- api:end -->
Show full SKILL.md (200 more words)Show less

Methods and parameters

method="seacells" retains the CLI default. If SEACells is unavailable, the API warns, uses KMeans and records both methods in run_info. Other backend errors propagate. method="kmeans" avoids that optional dependency.

Defaults remain use_rep="X_pca", n_metacells=30, min_iter=10, max_iter=30, n_neighbors=15 and n_pcs=20. KMeans uses the selected embedding, not a newly constructed neighbor graph. random_state=0 seeds KMeans and now also SEACells initialization; the wrapper previously ignored the seed for SEACells.

Gotchas

  • Aggregation takes the mean, not sum, of counts-layer values or X. This is not sample-level pseudobulk, and grouping is not sample-aware (_api.py:82).
  • The legacy KMeans dominant_label uses the first obs column, not celltype_key; that option controls SEACells' extra dominant-celltype column (_api.py:15).
  • run_info(metacells) reports fallback and expression source. Inspect aggregation="mean" before feeding an aggregate into a count-based model (_api.py:94).
  • CLI processed.h5ad contains original cells plus labels. tables/metacells.h5ad is the aggregate; use it explicitly when needed.

Inputs & Outputs

Input needs the selected embedding and more cells than requested aggregates. The API returns a new metacell AnnData and table/Figure helpers.

CLI files: processed.h5ad, its metacells_annotated.h5ad alias, tables/metacells.h5ad, tables/metacell_summary.csv, tables/cell_to_metacell.csv, report.md, result.json, figures/metacell_centroids.png and figures/metacell_size_distribution.png. Plot data/manifests and optional R-enhanced figures are also exported.

Key CLI

bash
python skills/singlecell/scrna/sc-metacell/sc_metacell.py --demo --method kmeans --output /tmp/sc_metacell_demo
python skills/singlecell/scrna/sc-metacell/sc_metacell.py --input clustered.h5ad --method kmeans --n-metacells 30 --output results/

Dependencies

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

© 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-metacell 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_metacell.py
  • tests/test_metacell_api.py
  • tests/test_sc_metacell_methods.py

Open the folder on GitHubat commit 90a3bec

Compare with similar skills

Sc Metacell 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 Metacell compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sc Metacell this skillTianGzlab/OmicsClaw161—~1.3kAutomated safety check: PassApache-2.0
ScgptJimLiu/science-skills2284 repos~1.3kAutomated safety check: PassApache-2.0
Scrna EmbeddingClawBio/ClawBio1.2k1 repos~2kAutomated safety check: PassMIT
Evo2JimLiu/science-skills2284 repos~1.3kAutomated safety check: PassApache-2.0
Genimldavila7/claude-code-templates33k11 repos~2.5kAutomated safety check: PassMIT
Celltype Specificity ProfilerClawBio/ClawBio1.2k—~4.3kAutomated safety check: PassMIT

Similar skills

  • Scgpt

    JimLiu/science-skills

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

    228 GitHub starsUsed in 4 repos~1.3k tokens
    Research & ScienceAuto-check passed
  • Scrna Embedding

    ClawBio/ClawBio

    Local scVI/scANVI-based single-cell latent embedding and batch-aware integration from raw-count .h5ad or 10x Matrix Market input, with stable integrated AnnData export for downstream latent analysis.

    1.2k GitHub starsUsed in 1 repo~2k tokens
    AI & LLM EngineeringAuto-check passed
  • Evo2

    JimLiu/science-skills

    Score, embed, and generate DNA sequences with Evo 2, a long-context genomic foundation model.

    228 GitHub starsUsed in 4 repos~1.3k tokens
    Research & ScienceAuto-check passed
  • Geniml

    davila7/claude-code-templates

    This skill should be used when working with genomic interval data (BED files) for machine learning tasks.

    33k GitHub starsUsed in 11 repos~2.5k tokens
    Research & ScienceAuto-check passed
  • Given a gene and a single-cell atlas, compute how cell-type-specific its expression is — the tau specificity index, Sarle's expression bimodality coefficient, and the cell types that drive the…

    1.2k GitHub stars~4.3k tokensUpdated yesterday
    Research & ScienceAuto-check passed
  • Umap Tsne Analysis

    aipoch/medical-research-skills

    A skill your agent uses when performing sample-level dimensionality reduction and visualization on abundance or OTU-style matrices with a companion group file, generating UMAP and/or t-SNE…

    1.9k GitHub stars~2.7k tokensUpdated 23 days ago
    Research & ScienceAuto-check passed

More from TianGzlab/OmicsClaw

All 88 skills in this repo
  • 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 3 days ago
    Auto-check passed
  • Bulkrna Batch Correction

    TianGzlab/OmicsClaw

    Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation.

    161 GitHub stars~1.2k tokensUpdated 3 days ago
    Auto-check passed
  • Bulkrna Coexpression

    TianGzlab/OmicsClaw

    Load when discovering bulk gene co-expression modules and hub genes with R WGCNA.

    161 GitHub stars~1.3k tokensUpdated 3 days ago
    Auto-check passed
  • Bulkrna De

    TianGzlab/OmicsClaw

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

    161 GitHub stars~867 tokensUpdated 3 days ago
    Auto-check passed
  • Bulkrna Deconvolution

    TianGzlab/OmicsClaw

    Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or signature-matrix reference.

    161 GitHub stars~757 tokensUpdated 3 days ago
    Auto-check passed
  • Bulkrna Enrichment

    TianGzlab/OmicsClaw

    Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list.

    161 GitHub stars~860 tokensUpdated 3 days ago
    Auto-check passed

Works with

Questions about Sc Metacell

What does Sc Metacell do?

Load when aggregating single cells into metacells (sample-aware coarse-grained pseudo-cells) on a normalised scRNA AnnData via SEACells or KMeans on a low-D embedding. Sc Metacell is an agent skill from TianGzlab/OmicsClaw. Load when aggregating single cells into metacells (sample-aware coarse-grained pseudo-cells) on a normalised scRNA AnnData via SEACells or KMeans on a low-D embedding.

When should I use Sc Metacell?

Sc Metacell fits situations like: tasks that involve Bioinformatics; tasks that involve Embeddings.

How do I install Sc Metacell in Claude Code?

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

How do I install Sc Metacell in Codex?

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

Can I use Sc Metacell 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-metacell -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-metacell, .gemini/skills/sc-metacell, .github/skills/sc-metacell and .opencode/skills/sc-metacell in your project.

What does Sc Metacell need to run?

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

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

Sc Metacell 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 Metacell use?

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

What are the alternatives to Sc Metacell?

Skills that share tags, products or a category with Sc Metacell: Scgpt (JimLiu/science-skills, 228 stars), Scrna Embedding (ClawBio/ClawBio, 1.2k stars), Evo2 (JimLiu/science-skills, 228 stars) and Geniml (davila7/claude-code-templates, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sc Metacell?

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.