celltype-specificity-profiler

Computes tau specificity index and bimodality coefficient for a gene across single-cell atlas cell types.

1.1k|257|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/ClawBio/ClawBio --skill celltype-specificity-profiler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: celltype-specificity-profiler
Source: https://github.com/ClawBio/ClawBio/tree/main/skills/celltype-specificity-profiler
Command: npx skills add https://github.com/ClawBio/ClawBio --skill celltype-specificity-profiler

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires scanpy, anndata, numpy, scipy, pandas.

What problem does it solve?

Target prioritization and marker-gene discovery require knowing whether a gene's expression is restricted to specific cell types, but single-cell pipelines typically stop at embedding and clustering without returning a per-gene specificity metric. This Skill quantifies cell-type specificity from an annotated single-cell atlas using the tau specificity index and Sarle's bimodality coefficient.

Core Features & Use Cases

  • Tau Specificity Index: Computes the Yanai et al. 2005 tau index over pseudobulk per-cell-type means, excluding cell types with fewer than 20 cells.
  • Bimodality Coefficient: Calculates Sarle's bias-corrected BC over expressing cells to detect on/off expression patterns, with a low-expression flag for sparse genes.
  • Ranked Cell Types & Trial Prior: Outputs ranked expressing cell types, a tidy per-cell-type CSV, and optionally attaches Zhang et al. 2026 trial-success odds ratios.
  • Use Case: Given a lung atlas in h5ad format, profile CD276 to learn it is highly cell-type-specific (tau > 0.69), then feed the JSON profile into downstream target-validation scoring.

Quick Start

Ask the agent to run the celltype-specificity-profiler demo to profile the MS4A1 gene on the bundled real pbmc3k dataset and return its tau and bimodality scores.

Frequently Asked Questions about celltype-specificity-profiler

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

FAQPage Schema
How do I compute the tau specificity index for a gene in single-cell data?

Run the profiler with a gene symbol and an annotated h5ad atlas: python profiler.py --gene CD276 --atlas lung_atlas.h5ad --output out. It aggregates pseudobulk mean expression per cell type and returns tau in profile.json, where values near 1 indicate cell-type-restricted expression.

What input format does the cell-type specificity profiler require?

It requires an AnnData .h5ad file with log-normalized non-negative expression in X and cell-type labels in an obs column. Z-scored matrices produce meaningless tau values, and a --demo mode uses scanpy's bundled real pbmc3k dataset instead.

Can I compare tau specificity scores across different single-cell atlases?

No, tau should not be compared across atlases with different annotation granularities. Coarse labels inflate apparent ubiquity while fine labels raise tau, so always report the annotation level and only compare within the same ontology.

Why is the bimodality coefficient unreliable for some genes?

The bimodality coefficient is unstable for genes expressed in fewer than 1% of cells, so the profiler sets low_expression: true in that case. It also returns NaN when fewer than 4 expressing cells exist or variance is zero.

Is the tau 0.69 threshold a universal cutoff for cell-type specificity?

No, 0.69 is a cohort-specific value derived by Zhang et al. 2026 as a K-means midpoint of their trial-level tau distribution. Treat continuous tau as the primary output and recalibrate the cutoff on your own distribution if you need a binary call.