Skip to content
Back to skills

Sc Consensus Clustering

ASecurity

Load when you want resolution-robust single-cell clusters on a preprocessed scRNA AnnData

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

Works with

  • cli

Security analysis

A100/100

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

Scanned September 6, 2026

npx -y skills add lilinji/GeneTind-Life-Skills --skill sc-consensus-clustering --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sc Consensus Clustering?

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

Security grade badge for Sc Consensus Clustering
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/lilinji-sc-consensus-clustering/badge)](https://www.skillsdirectory.com/skills/lilinji-sc-consensus-clustering)

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-consensus-clustering
description: Load when you want resolution-robust single-cell clusters on a preprocessed scRNA AnnData
  β€” fanning out leiden/louvain across a resolution sweep, scoring members by silhouette + cross-method
  NMI, and voting a typed consensus. Skip when one resolution suffices (use sc-clustering); spatial domains
  (use consensus-domains).
version: 0.1.0
author: OmicsClaw
license: Apache-2.0
emoji: 🧩
tags:
- singlecell
- consensus
- typed-consensus
- multi-resolution
- silhouette
- bc-ranking
- kmode
- lca
- weighted
requires:
- anndata
- numpy
- pandas
- PyYAML
- scanpy
- scikit-learn
- scipy
---

# sc-consensus-clustering

## When to use

The user has a preprocessed scRNA AnnData (PCA + neighborhood graph
already computed via `sc-preprocessing`) and wants robust cell-cluster
assignments insensitive to the chosen `resolution`. Single-resolution
Leiden/Louvain results are notoriously resolution-sensitive β€” at
`r=0.4` you get 6 broad types, at `r=1.5` you get 22 sub-states. This
skill runs a SACCELERATOR-style consensus across a resolution sweep
(and optionally across `leiden` vs `louvain`) and reports the **stable
core** of the labels.

It does NOT replace `sc-clustering`; it wraps it.

## 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)
- Expects `obsm`: `X_pca`

**Outputs**

- `consensus_labels.tsv`
- `member_scores.csv`
- `cross_method_nmi.csv`
- `plan.json`
- `report.md`
- `result.json`

## Flow

1. **Plan members** β€” either user-supplied (`--members` / `--all`) or
   derived from the resolution sweep Γ— cluster-methods combinations.
2. **Fan out** β€” runtime invokes `sc-clustering` once per member.
3. **Score** β€” `silhouette_score` from each member's
   `clustering_summary.csv` is the intrinsic-quality signal; cross-method
   NMI is computed across members.
4. **BC pick** β€” top-K-by-composite-score default; CLI interactive
   override allowed.
5. **Consensus** β€” kmode / weighted / LCA on the selected base
   clusterings.
6. **Report** β€” banner + score table + NMI matrix.

## Gotchas

- **`--cluster-methods` defaults to `leiden` ONLY**, not both, because
  `louvain` and `leiden` agree to within 1–2% on most datasets and the
  consensus signal comes mostly from the resolution sweep.
- **Resolutions must span at least one factor of 2** for the consensus
  to be informative; default sweep covers 0.5–2.0.
- The mandatory banner is enforced by
  `runtime/consensus/dispatch.output_banner`. Do NOT strip it.
- `requires_preprocessed: true` β€” run `sc-preprocessing` first.

## Key CLI

```bash
# Default sweep (leiden at 5 resolutions)
oc run sc-consensus-clustering --input preprocessed.h5ad --output out/

# Both methods Γ— 5 resolutions = 10 members; SACCELERATOR-style benchmark
oc run sc-consensus-clustering --input preprocessed.h5ad --output out/ \
  --cluster-methods leiden,louvain --resolutions 0.5,0.8,1.0,1.4,2.0

# Explicit
oc run sc-consensus-clustering --input preprocessed.h5ad --output out/ \
  --members leiden:resolution=0.5,leiden:resolution=1.0,louvain:resolution=1.0
```

## See also

- `references/methodology.md` β€” the resolution-sweep consensus rationale
- `references/output_contract.md` β€” `consensus_labels.tsv` / `member_scores.csv` / `plan.json` schema
- `references/parameters.md` β€” every CLI flag (generated from `skill.yaml`)
- Adjacent skills: `sc-preprocessing` (upstream β€” produces the input), `sc-clustering` (the per-member method this wraps), `consensus-domains` (parallel β€” the spatial analogue), `sc-consensus-integration` (parallel β€” consensus over integration backends)
- ADR 0010/0011/0016 β€” runtime layer, scoring protocol, workflow-runtime generalisation

Files in this skill

  • SKILL.md4 KB
  • references/methodology.md1.9 KB
  • references/output_contract.md1.7 KB
  • references/parameters.md793 B
  • sc_consensus_clustering.py1.2 KB
  • skill.yaml2.2 KB
  • tests/test_cli_smoke.py3.5 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.

Comments

Loading comments…