Cell annotation

From zongtingwei/Bioclaw_Skills_Hub · View interactive version

Cell annotation is an AI agent skill from the GitHub repository zongtingwei/Bioclaw_Skills_Hub. Automated and marker-guided single-cell cell type annotation using CellTypist, marker review, reference transfer, and confidence-aware label curation.

How to use this skill

Skill file

Cell Annotation

Version Compatibility

Reference examples assume:

Before using code patterns, verify installed versions match the environment:

Overview

Use this skill when the user wants cluster labels or per-cell labels for scRNA-seq. The default stance is:

  1. inspect markers first
  2. run reference-based annotation
  3. keep uncertainty explicit
  4. export both raw predicted labels and a curated final label column

When To Use This Skill

Quick Route

Progressive Disclosure

Default Rules

Expected Inputs

Expected Outputs

Preferred Tools

Starter Pattern

import scanpy as sc
import celltypist

adata = sc.read_h5ad("results/processed.h5ad")
pred = celltypist.annotate(adata, model="Immune_All_Low.pkl", majority_voting=True)
adata = pred.to_adata()
adata.obs["cell_type_raw"] = adata.obs["majority_voting"]
adata.obs["cell_type_confidence"] = adata.obs["conf_score"]
adata.write("results/annotated.h5ad")

Workflow

1. Inspect markers before automation

Check canonical lineage markers on UMAP, dotplots, or heatmaps. If clusters do not support a plausible biological separation, do not lock in labels yet.

2. Choose the annotation level

3. Run reference-based annotation

Use CellTypist or another compatible reference transfer method. Store:

4. Curate with markers and cluster context

Review top markers per cluster and compare them against predicted labels. Rename or collapse labels if fine categories are not robust.

5. Export both raw and final labels

At minimum, keep:

Output Artifacts

Quality Review

Anti-Patterns

Related Skills

Optional Supplements

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.