Skip to content
Back to skills

Sc Integrate Cluster

ASecurity

Load when running a single batch-correction representation (none/Harmony/Scanorama/scVI)

  • 8 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 6, 2026
datapythongobashbackend

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add lilinji/GeneTind-Life-Skills --skill sc-integrate-cluster --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sc Integrate Cluster?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sc Integrate Cluster
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lilinji-sc-integrate-cluster/badge)](https://www.skillsdirectory.com/skills/lilinji-sc-integrate-cluster)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
# AUTO-GENERATED header from skill.yaml — do not edit by hand.
# Edit skill.yaml, then run: python scripts/generate_skill_md.py <skill_dir>
name: sc-integrate-cluster
description: Load when running a single batch-correction representation (none/Harmony/Scanorama/scVI)
  + clustering of single-cell data as one self-contained unit — normally fanned out as a member of sc-consensus-integration.
  Skip when you want the full integration consensus (use sc-consensus-integration); resolution-robust
  clustering (use sc-consensus-clustering).
version: 0.1.0
author: OmicsClaw
license: MIT
tags:
- singlecell
- scrna
- integration
- clustering
- consensus
requires:
- anndata
- harmonypy
- matplotlib
- numpy
- pandas
- scanorama
- scanpy
- scikit-learn
- seaborn
- torch
---

# sc-integrate-cluster

**Domain:** Single-Cell Omics (scRNA) · **Role:** consensus member skill

## When to use

One self-contained *integrate + cluster* unit, used as a fan-out member of
`sc-consensus-integration` (ADR 0016 / 0029). It produces a batch-correction
representation **and** clusters on it at a fixed resolution, emitting the standard
`sc-clustering` artifact schema so the consensus `ScClusteringArtifactReader`
reads it unchanged. You normally do **not** call this directly — the consensus
planner fans it out across methods. Input is a preprocessed AnnData with an `obs`
batch key (≥2 batches for any real integration method); an `X_pca` baseline is
computed if absent.

This is the single-cell analog of `spatial-domains --method <m>`: the integration
consensus fans out genuinely different batch-correction representations.

## Inputs & Outputs

<!-- AUTO-GENERATED from skill.yaml (interface) — do not edit by hand. Regenerate: python scripts/generate_skill_md.py <skill_dir> -->

**Inputs**

- Modalities: scrna
- File types: `.h5ad`
- Requires a preprocessed AnnData (`X` normalised, PCA/neighbours present)

**Outputs**

- `figure_data/embedding_points.csv`
- `figure_data/clustering_summary.csv`
- `processed.h5ad`
- `result.json`
- Processed AnnData (`saves_h5ad`) — adds `obsm`: `X_pca`

## Flow

1. Load the preprocessed AnnData; compute an `X_pca` baseline if absent.
2. Run the `--method` backend to produce `obsm[representation_used]`
   (`X_pca` for `none`).
3. Build the neighbour graph on that representation and cluster with
   `--cluster-method` at the fixed `--resolution`.
4. Write `figure_data/embedding_points.csv` + `figure_data/clustering_summary.csv`
   + `processed.h5ad` + `result.json`.

## Gotchas

- **`processed.h5ad` carries the member's integrated embedding** — the consensus
  driver reads `obsm[representation_used]` from it to compute the integration
  intrinsic panel (ADR 0029). Do not strip obsm keys before the driver runs.
- **`result.json["representation_used"]` records which embedding was used** —
  `X_pca` for `--method none`, `X_<method>` otherwise; the consensus reader keys
  off this rather than re-deriving it.
- **Fixed `--resolution` is by design** — members must produce comparable cluster
  counts for the consensus operator; sweeping resolution belongs in
  `sc-consensus-clustering`, not here.
- **scVI is GPU/stochastic** — reproducible within tolerance, not bit-identical;
  serialise GPU members (`--max-parallel 1` at the consensus level).

## Key CLI

```bash
# Synthetic smoke demo (no input needed)
python omicsclaw.py run sc-integrate-cluster --demo --output /tmp/sic_demo

python skills/singlecell/scrna/sc-integrate-cluster/sc_integrate_cluster.py \
  --input <preprocessed.h5ad> --output <member_dir> \
  --method harmony --batch-key batch --resolution 1.0 --cluster-method leiden --seed 0
```

## See also

- `references/methodology.md` — integrate-then-cluster member rationale
- `references/output_contract.md` — the `figure_data/` schema the consensus reads
- `references/parameters.md` — every CLI flag (generated from `skill.yaml`)
- Adjacent skills: `sc-preprocessing` (upstream), `sc-consensus-integration` (the consensus that fans this out), `sc-clustering` (the non-integration single-resolution clusterer)
- ADR 0016/0029 — workflow runtime, integration intrinsic panel

Files in this skill

  • SKILL.md4.1 KB
  • references/methodology.md2.2 KB
  • references/output_contract.md1.4 KB
  • references/parameters.md970 B
  • sc_integrate_cluster.py12.8 KB
  • skill.yaml2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.