Skip to content
Back to skills

Consensus Domains

ASecurity

Load when you want a verified multi-method consensus over spatial tissue domains on a preprocessed

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 6, 2026
datapythonrustgobash

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 consensus-domains --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Consensus Domains?

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

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

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: consensus-domains
description: Load when you want a verified multi-method consensus over spatial tissue domains on a preprocessed
  spatial AnnData β€” fanning out N domain methods, ranking base clusterings, and emitting a typed consensus
  with cross-method disagreement. Skip when one method suffices (use spatial-domains); the data is single-cell
  (use sc-consensus-clustering).
version: 0.1.0
author: OmicsClaw
license: Apache-2.0
emoji: 🧩
tags:
- spatial
- consensus
- typed-consensus
- expert-in-the-loop
- saccelerator
- bc-ranking
- kmode
- lca
- weighted
requires:
- anndata
- numpy
- pandas
- PyYAML
- scanpy
- scikit-learn
- scipy
---

# consensus-domains

## When to use

The user has a preprocessed spatial AnnData (typically already QC'd via
`spatial-preprocess`) and wants a **more trustworthy** tissue-domain
assignment than any single method can produce β€” because the user knows
single-method results disagree on cancer / non-standard tissues, or
because the analysis is going to drive a downstream decision (cell-type
deconvolution, region-specific DE, paper figure).

This skill fans out `spatial-domains` over N method choices, computes a
typed statistical consensus, and surfaces the **cross-method
disagreement** explicitly. It does NOT replace `spatial-domains`; 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**

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

**Outputs**

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

## Flow

1. **Plan** β€” `runtime/consensus/plan.propose_members` reads
   `spatial-domains`' `param_hints` (from its `skill.yaml`),
   queries the evaluation-chair LLM (or falls back deterministically),
   produces N PlannedMember entries.
2. **Fan out** β€” `runtime/consensus/team.run_team` invokes
   `omicsclaw.skill.runner.run_skill("spatial-domains", ...)` per
   member with `max_parallel = min(N, cpu_count//2, 4)` and a 600 s
   per-member timeout. `cancel_event` is propagated through.
3. **Score** β€” `runtime/consensus/scoring.score_all_members` ranks
   survivors by composite `alpha * cross_NMI + beta * mean_local_purity`
   with the `max_class_frac > 0.8` hard filter.
4. **BC pick** β€” on the CLI surface in interactive mode, prompt the
   user with the top-K-by-score default; on Desktop/Channel surfaces
   (or `--non-interactive`), accept the default.
5. **Consensus** β€” invoke the chosen operator
   (`kmode` / `weighted` / `lca`) on the selected base clusterings.
6. **Report** β€” write `report.md` starting with the mandatory ADR 0010
   banner; persist `plan.json` for audit; ready for graph-memory
   storage under `analysis://typed/<run_id>`.

## Gotchas

- **A path is allowed to fail loudly.** If fewer than 2 members survive
  the fan-out, this skill raises `InsufficientSurvivorsError` and does
  NOT silently downgrade to narrative consensus. Re-run with
  `--members` adjusted or fall back to the dedicated narrative skill
  (when shipped).
- **Banner is non-configurable.** The `[A: Verified consensus]` header
  is enforced by `runtime/consensus/dispatch.output_banner`. Do not
  edit `report.md` to strip it before distribution.
- **Member intrinsic quality is a multi-metric panel (ADR 0028).** Spatial-domain
  members are scored on a normalized panel of three unsupervised metrics β€”
  `chaos` (1-hop coherence), `pas` (anomaly rate), `mlami` (multi-scale
  spatial-graph AMI) β€” combined into one `[0,1]` intrinsic for the Ξ² term of the
  BC composite score. The per-member breakdown is written to
  `member_intrinsic_panel.csv`. Pass `--no-spatial-panel` to score on the single
  `mean_local_purity` signal instead.
- **`--n-clusters` is reserved β€” accepted but not consumed.** The operator
  returns however many clusters the math yields (bounded at the max member k);
  passing `--n-clusters` changes nothing today (disposition pending DEC-5).
- **LCA requires R + diceR.** When unavailable, the skill prints an
  installation hint and exits non-zero rather than silently switching
  operators. Pass `--operator kmode` to bypass.
- **`requires_preprocessed: true`** β€” the underlying spatial-domains
  members expect `obsm["X_pca"]` and `obsm["spatial"]` populated. Run
  `spatial-preprocess` first.

## Key CLI

```bash
# Minimal interactive run (CLI surface) β€” LLM picks 5, you confirm BCs
oc run consensus-domains --input preprocessed.h5ad --output out/

# Non-interactive (server / scripted)
oc run consensus-domains --input preprocessed.h5ad --output out/ \
  --non-interactive

# Explicit members + weighted operator
oc run consensus-domains --input preprocessed.h5ad --output out/ \
  --members banksy,graphst,sedr,leiden,spagcn \
  --operator weighted

# SACCELERATOR-style benchmark (run ALL eligible methods)
oc run consensus-domains --input preprocessed.h5ad --output out/ --all
```

## See also

- `references/methodology.md` β€” the consensus scoring + operator 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: `spatial-preprocess` (upstream β€” produces the input), `spatial-domains` (the per-member method this wraps), `consensus-interpret` (downstream β€” narrates the consensus result), `sc-consensus-clustering` (parallel β€” the single-cell analogue)
- ADR 0010/0011/0016 β€” runtime layer, scoring protocol, workflow-runtime generalisation

Files in this skill

  • SKILL.md5.7 KB
  • consensus_domains.py1.1 KB
  • references/methodology.md2.2 KB
  • references/output_contract.md1.9 KB
  • references/parameters.md511 B
  • skill.yaml1.8 KB
  • tests/test_cli_smoke.py3.8 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…