sc-dynamic-clustering

Normalizes scRNA-seq data and clusters it with Leiden or Louvain into an annotated AnnData.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/ya-way/cytoclaw-skills --skill sc-dynamic-clustering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sc-dynamic-clustering
Source: https://github.com/ya-way/cytoclaw-skills/tree/main/workspace/skills/sc-dynamic-clustering
Command: npx skills add https://github.com/ya-way/cytoclaw-skills --skill sc-dynamic-clustering

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires scanpy, numpy, and includes scripts (resource) components.

What problem does it solve?

Clustering of scRNA-seq data often requires manual tuning of dimensionality reduction and clustering parameters; this Skill automates HVG selection, PCA, UMAP embedding, and graph-based clustering to accelerate discovery.

Core Features & Use Cases

  • HVG selection and PCA/UMAP embedding for neighborhood graph construction.
  • Leiden clustering with fallback to Louvain and automatic summary of cluster sizes.
  • Use Case: when comparing multiple resolutions to identify stable subpopulations in qc_filtered data.

Quick Start

Provide a cleaned AnnData file, specify n_pcs and resolution, and set an output directory to run iterative clustering and generate a summary.

Frequently Asked Questions about sc-dynamic-clustering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Leiden clustering on scRNA-seq data with scanpy?

To run Leiden clustering on scRNA-seq data, this Skill normalizes a qc_filtered.h5ad file, selects highly variable genes, applies PCA and UMAP, and executes graph-based clustering to output a clustered AnnData object.

What's the best way to compare multiple resolutions for scRNA-seq clustering?

Comparing multiple resolutions for scRNA-seq clustering involves iteratively adjusting the resolution parameter and n_pcs. This Skill automates that parameter exploration to identify stable subpopulations and records cluster counts in a summary JSON file.

Does this scRNA-seq clustering workflow require a pre-filtered AnnData input?

Yes, this scRNA-seq clustering workflow strictly requires a pre-filtered AnnData input. You must provide a qc_filtered.h5ad file to ensure the HVG selection, PCA, and UMAP embedding steps operate on quality-controlled data.

Can I use Louvain instead of Leiden for neighborhood graph clustering in scanpy?

Yes, you can use Louvain instead of Leiden. This Skill performs Leiden clustering with an automatic fallback to Louvain to generate the clustered.h5ad file and summarize the resulting cluster sizes.

Why does my scRNA-seq clustering fail without highly variable gene selection?

ScRNA-seq clustering requires highly variable gene selection to build a meaningful neighborhood graph. This Skill enforces HVG selection before applying PCA and UMAP, ensuring the Leiden algorithm identifies optimal cluster granularity.

What outputs are generated when tuning PCA and UMAP parameters for single-cell data?

When tuning PCA and UMAP parameters for single-cell data, this Skill generates a clustered.h5ad file containing the AnnData object with embeddings, and a clustering_summary.json file recording the chosen cluster key and counts.