SkillAgentSearch skills...

celltypist-cell-annotation

Automated scRNA-seq cell type annotation via pre-trained logistic regression. 45+ models: immune, gut, lung, brain, fetal, cancer microenvironments. Input normalized AnnData; outputs per-cell labels, majority-vote cluster labels, confidence scores.

Install / Use

npx skills add jaechang-hits/SciAgent-Skills --skill celltypist-cell-annotation

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

91/100

Category

Automation

Supported Platforms

Zed

Tags

Our assessment of celltypist-cell-annotation

celltypist-cell-annotation scores 91/100 on our quality scale, 1099th of 2,771 Automation skills we index (top 40%).

Its SKILL.md is 21 KB long, well organised into 68 sections with 13 code examples: a thorough specification that gives an agent plenty to work with.

It has 367 GitHub stars, a meaningful sign that others use it.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
11/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 3 months ago, so celltypist-cell-annotation is actively maintained.
  • Our last check on 2026-11-20 found the source still online.
  • No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
  • Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-10-05. Automated pattern scan on 2026-10-05. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

celltypist-cell-annotation compared with similar skills

All 4 of these similar skills score higher than celltypist-cell-annotation; compare them before choosing.

SkillScoreStarsUpdatedFormat
celltypist-cell-annotation (this skill)by jaechang-hits913673mo agoSKILL.md
Agent-Reachby Panniantong100113.3k12d agoCLAUDE.md
rufloby ruvnet10082.1ktodayCLAUDE.md
Claude-Code-Game-Studiosby Donchitos10040.2k10d agoCLAUDE.md
Scraplingby D4Vinci100104.4k2d agoMCP Server

Frequently asked questions

How do I install celltypist-cell-annotation?
Run npx skills add jaechang-hits/SciAgent-Skills --skill celltypist-cell-annotation. The install tabs above show the steps for each supported agent.
Which AI agents does celltypist-cell-annotation work with?
It is written for Zed, as a SKILL.md file. Other agents that read the same format can often use it too.
Is celltypist-cell-annotation safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is celltypist-cell-annotation still maintained?
The repository was last updated about 3 months ago, so celltypist-cell-annotation is actively maintained.

name: "celltypist-cell-annotation" description: "Automated scRNA-seq cell type annotation via pre-trained logistic regression. 45+ models: immune, gut, lung, brain, fetal, cancer microenvironments. Input normalized AnnData; outputs per-cell labels, majority-vote cluster labels, confidence scores. Use for fast, reference-backed annotation without manual marker inspection." license: "MIT"

CellTypist Cell Type Annotation

Overview

CellTypist is an automated cell type classifier for single-cell RNA-seq data built on logistic regression models trained on curated reference atlases. Given a normalized AnnData object, it predicts cell type labels at the single-cell level and optionally applies majority voting within user-defined clusters to produce consensus, biologically coherent annotations. The tool ships with 45+ ready-to-use models spanning pan-immune, organ-specific, and developmental contexts, and supports training custom models from labeled data.

When to Use

  • Annotating PBMC, whole-blood, lymph node, or other immune cell datasets using a single standardized reference model
  • Generating a first-pass cell type annotation before manual curation with canonical marker genes
  • Annotating cluster-level cell types in published or in-house datasets using majority voting to smooth noisy per-cell predictions
  • Comparing annotation results across multiple tissue-specific models to determine the most biologically relevant reference
  • Training a custom CellTypist model from a labeled reference dataset for a tissue or species not covered by pre-built models
  • Quantifying annotation confidence to flag low-certainty cells (confidence score < 0.5) for manual review or exclusion
  • Use omics-plotting SKILL for generic result-table figures; UMAP/dotplot annotation views use scanpy sc.pl.*
  • Use scVI/scANVI (scvi-tools-single-cell) instead when you need probabilistic label transfer with batch correction and uncertainty quantification via a variational autoencoder
  • Use popV (popv-cell-annotation) instead when you want ensemble consensus from 10+ methods including deep learning and KNN-based approaches

Prerequisites

  • Python packages: celltypist>=1.6, scanpy>=1.9, anndata
  • Data requirements: AnnData with normalized, log1p-transformed counts in adata.X (10,000 UMIs per cell target sum). Raw counts must be normalized before calling CellTypist
  • Environment: Python 3.8+; 8 GB RAM sufficient for most datasets; internet access required for model downloads (first run only)
pip install celltypist "scanpy[leiden]" anndata

Pre-flight Interview

Settle these with the user before writing any analysis code.

decisions:
  - id: D1
    param: annotationStrategy
    kind: required
    source: user
    ask: "Name cell types from canonical markers by hand over the clusters, transfer them from a pre-trained model, or do both and compare the two?"
    default: "transfer from a model, then confirm against markers"

  - id: D2
    param: tissueContext
    kind: required
    source: user
    ask: "Which tissue is this, and in what state - healthy adult, fetal or developmental, diseased, or perturbed?"
    default: null

  - id: D3
    param: model
    kind: required
    source: literature
    depends_on: [D2]
    ask: "Which pre-trained model matches that tissue AND that state?"
    default: null

  - id: D4
    param: markerValidation
    kind: required
    source: user
    depends_on: [D1]
    ask: "Should the assigned labels be checked against canonical marker expression before they are accepted?"
    default: "checked - a mismatched model still labels every cell confidently"

  - id: D5
    param: validationMarkerPanel
    kind: required
    source: literature
    depends_on: [D2, D4]
    ask: "Which canonical markers should the assigned types be confirmed against?"
    default: null
    skip_if: "marker validation declined"

  - id: D6
    param: labelGranularity
    kind: required
    source: user
    depends_on: [D2]
    ask: "Name broad lineages, or subtypes and activation states within them?"
    default: null

  - id: D7
    param: majorityVoting
    kind: required
    source: user
    ask: "Assign labels cell by cell, or smooth them to a consensus within each cluster?"
    default: "per-cell, with voting recommended once clusters are trusted"

  - id: D8
    param: clusteringKey
    kind: derived
    source: upstream
    depends_on: [D7]
    ask: "Which clustering should the consensus be taken over?"
    default: "the clustering computed upstream"
    skip_if: "majority voting disabled"

  - id: D9
    param: assignmentThreshold
    kind: required
    source: user
    ask: "Should every cell receive its best-matching label, or should uncertain cells be left unassigned?"
    default: "best match regardless of confidence"

  - id: D10
    param: minClusterProportion
    kind: optional
    source: user
    depends_on: [D7]
    ask: "How much of a cluster must agree before the consensus label is applied?"
    default: "no minimum"
    skip_if: "majority voting disabled"

D1 is asked even though the user has arrived at an automated annotator, because the alternative is not visible from here: manual marker naming and model transfer fail in opposite directions, and "both, compared" is the right answer more often than either alone. If the answer is manual only, this skill is not the tool — see single-cell-annotation-guide.

D2 precedes D3 because a model is specific to a tissue and a state. An adult immune model applied to fetal or tumour tissue returns a confident label for every cell; the classifier has no way to say "these cells are not in my reference". D4 is what makes that failure visible, and it is separate from D9 — a confident assignment and a correct one are not the same thing, and only markers tell them apart.

Quick Start

Minimal pipeline — annotate a preprocessed AnnData with the pan-immune model:

import celltypist
import scanpy as sc

# Load a preprocessed AnnData (normalized + log1p, Leiden clusters already in adata.obs)
adata = sc.read_h5ad("preprocessed_pbmc.h5ad")

# Run annotation with majority voting across Leiden clusters
predictions = celltypist.annotate(
    adata,
    model="Immune_All_Low.pkl",
    majority_voting=True,
)
adata = predictions.to_adata()

print(adata.obs[["predicted_labels", "majority_voting", "conf_score"]].head(10))
# predicted_labels  majority_voting  conf_score
# CD4+ T cells      CD4+ T cells     0.92
# ...

Workflow

Step 1: Installation and Model Setup

Install CellTypist and download pre-trained models. Models are cached locally after the first download.

pip install celltypist "scanpy[leiden]" anndata
import celltypist
from celltypist import models

# Download all available models (only needed once; ~2 GB total)
models.download_models(force_update=False)

# List available models with metadata
models_df = models.models_description()
print(models_df[["model", "description", "n_celltypes", "n_cells"]].to_string())
# Output (excerpt):
#   model                          description                                 n_celltypes  n_cells
#   Immune_All_Low.pkl             Pan-immune low-hierarchy (98 cell types)   98           324,320
#   Immune_All_High.pkl            Pan-immune high-hierarchy (30 cell types)  30           324,320
#   Human_Lung_Atlas.pkl           Lung cell types from Human Lung Atlas       61           584,944

Step 2: Data Preparation

CellTypist requires normalized, log1p-transformed counts in adata.X. Run normalization before annotation. Raw counts must be stored separately.

import scanpy as sc

# Load raw count matrix
adata = sc.read_h5ad("raw_counts.h5ad")
# Alternatively from 10X:
# adata = sc.read_10x_mtx("filtered_feature_bc_matrix/")
# adata.var_names_make_unique()

# Store raw counts before normalization
adata.layers["counts"] = adata.X.copy()

# Normalize to 10,000 UMIs per cell and log1p-transform
sc.pp.normalize_total(adata, target_sum=1e4)
sc.pp.log1p(adata)

print(f"Prepared: {adata.n_obs} cells x {adata.n_vars} genes")
print(f"adata.X mean: {adata.X.mean():.3f}  (expected ~0.5–2.0 after log1p normalization)")

Step 3: Model Selection

Choose the model that best matches your tissue type and desired annotation resolution.

from celltypist import models

# Show full model table with filtering
models_df = models.models_description()

# Filter to human immune models
immune_models = models_df[models_df["description"].str.contains("immune|Immune", case=False)]
print(immune_models[["model", "description", "n_celltypes"]].to_string())

# Load a specific model to inspect its cell type labels
model = models.Model.load("Immune_All_Low.pkl")
print(f"Model cell types ({len(model.cell_types)}):")
print(model.cell_types[:20])  # first 20 labels

Available models (key selection guide):

| Model | Cell Types | Best For | |-------|-----------|---------| | Immune_All_Low.pkl | 98 | Pan-immune with fine subtypes (e.g., MAIT, Tfh, cDC1) | | Immune_All_High.pkl | 30 | Pan-immune major lineages (T, B, NK, monocyte, DC) | | Human_Lung_Atlas.pkl | 61 | Lung: alveolar, stromal, immune, endothelial | | Pan_Fetal_Human.pkl | 139 | Fetal human multi-organ development | | Developing_Human_Brain.pkl | 51 | Brain development: progenitors, neurons, glia | | Human_Colorectal_Cancer.pkl | 62 | Colorectal cancer cells + tumor microenvironment |

Step 4: Automated Annotation

Run celltypist.annotate() with majority_voting=True for cluster-level consensus labels alongside per-cell predictions.

import celltypist
import scanpy as sc

# Ensure Leiden clusters exist for majority voting
# If not already computed:
sc.pp.highly_variable_genes(adata, n_top_genes=2000)
sc.pp.pca(adata)
sc.pp.neighbors(adata, n_pcs=30)
sc.tl.leiden(adata, resolution=0.5, key_added="leiden")

# Run CellTypist annotation
predictions = celltypist.annotate(
    adata,
    model="Immune_All_Low.pkl",
    majority_voting=True,          # cluster-level consensus
    over_clustering="leiden",      # clustering key for majority voting
    p_thres=0.5,                   # cells below threshold → "Unassigned"
    mode="best match",             # assign the single highest-probability label
)

# Inspect prediction object
print(type(predictions))  # celltypist.classifier.AnnotationResult
print(predictions.predicted_labels.head())
print(predictions.probability_matrix.shape)  # (n_cells, n_cell_types)

Step 5: Results Integration

Transfer predictions back to the AnnData object and review confidence scores.

# Merge predictions into adata.obs
adata = predictions.to_adata()

# Key result columns:
# adata.obs["predicted_labels"]  — per-cell best-match label
# adata.obs["majority_voting"]   — cluster-level consensus label
# adata.obs["conf_score"]        — probability of the predicted label (0–1)

print(adata.obs[["predicted_labels", "majority_voting", "conf_score"]].head(10))
print(f"\nCell type distribution (majority voting):")
print(adata.obs["majority_voting"].value_counts().head(15))

# Flag low-confidence cells
low_conf = adata.obs["conf_score"] < 0.5
print(f"\nLow-confidence cells (conf_score < 0.5): {low_conf.sum()} ({low_conf.mean():.1%})")
adata.obs["high_conf"] = ~low_conf

Step 6: Visualization and Validation

Plot predictions on UMAP, validate with canonical marker genes, and confirm annotation quality.

import scanpy as sc
import matplotlib.pyplot as plt

# Compute UMAP if not already done
if "X_umap" not in adata.obsm:
    sc.tl.umap(adata)

# UMAP colored by annotation results
fig, axes = plt.subplots(1, 3, figsize=(21, 6))
sc.pl.umap(adata, color="majority_voting", legend_loc="on data",
           legend_fontsize=7, title="Majority Voting", ax=axes[0], show=False)
sc.pl.umap(adata, color="predicted_labels", legend_loc="right margin",
           legend

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars367
CategoryAutomation
Updated2mo ago
Forks36

Languages

Python

Trust signals

88/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 medium