Single Cell Annotation 标志

Single Cell Annotation

社区
jaechang-hits
single-cell-annotation

Best practices for single-cell RNA-seq cell type annotation including marker-based, reference-based, and automated classification approaches.

Add to TypingMind

概览

发布者jaechang-hits
代码仓库SciAgent-Skills
技能名称single-cell-annotation
星标数
381
复刻数
45
附带文件
仅含指令
许可协议open
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 jaechang-hits 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Single Cell Annotation AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/jaechang-hits/SciAgent-Skills/tree/main/legacy/single-cell-annotation
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jaechang-hits/SciAgent-Skills.git /tmp/SciAgent-Skills
mkdir -p .claude/skills
cp -r /tmp/SciAgent-Skills/legacy/single-cell-annotation .claude/skills/single-cell-annotation
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Single Cell Annotation,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Single Cell Annotation。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Single Cell Annotation 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Single Cell RNA-seq Cell Type Annotation


Metadata

Short Description: Best practices for annotating cell types in single-cell RNA-seq data using marker-based, automated, and reference-based approaches.

Authors: Distilled from "Single-cell best practices" by Luecken, M.D. et al.

Affiliations: Helmholtz Munich, Wellcome Sanger Institute, Harvard Medical School, and contributors

Version: 1.0

Last Updated: January 2025

License: CC BY 4.0

Commercial Use: ✅ Allowed

Source: https://www.sc-best-practices.org/cellular_structure/annotation.html

Citation: Luecken, M.D., Theis, F.J. et al. (2023). Current best practices in single-cell RNA-seq analysis: a tutorial. Molecular Systems Biology.


Overview

Cell type annotation is the process of assigning cell type labels to clusters or individual cells in single-cell RNA-seq data. This guide covers three main approaches and their practical implementation.

Key Concepts

Cell Type vs. Cell State

A cell type is a stable identity defined by a developmental trajectory and core marker gene program (e.g., CD4+ T cell, hepatocyte). A cell state is a transient condition (activated, cycling, stressed) overlaid on a cell type. Annotation should target cell types first; states are attributes that may further subdivide a type but should not be conflated with type identity.

Marker Genes and Marker Panels

Marker genes are genes whose expression is enriched in a specific cell type relative to other cells in the same tissue context. Reliable annotation uses panels of multiple markers (typically 3-5 per type) rather than a single gene, because expression is noisy in droplet-based scRNA-seq and many markers are shared across related types. Markers come in two flavors: canonical (literature-derived, e.g., CD3D for T cells) and data-derived (from differential expression on the dataset).

Reference Atlases and Label Transfer

A reference atlas is a previously annotated dataset (e.g., Human Cell Atlas, Tabula Sapiens) used to project labels onto a new "query" dataset. Label transfer methods (scArches, scANVI, Azimuth, SingleR) align query cells into the reference latent space and assign the nearest neighbor's label. Quality of transfer depends on tissue match, technology match (e.g., 10x v3 vs. Smart-seq2), and species match.

Decision Framework

Use this tree to choose an annotation approach:

                Do you have a well-characterized tissue
                with a high-quality reference atlas?
                            │
              ┌─────────────┴─────────────┐
              │                           │
             YES                          NO
              │                           │
              ▼                           ▼
   Is this a standard tissue       Are you studying
   (PBMC, lung, gut) with a       novel cell types or
   pre-trained classifier?         exploratory data?
              │                           │
        ┌─────┴─────┐               ┌─────┴─────┐
        │           │               │           │
       YES          NO             YES          NO
        │           │               │           │
        ▼           ▼               ▼           ▼
   Automated    Reference-     Manual marker  Manual +
   (CellTypist) based          based          automated
                (scArches,     (Scanpy,       cross-check
                 Azimuth,      Seurat)
                 SingleR)

Decision Table

ScenarioApproachPrimary ToolValidation
Standard human PBMC, large dataset (>100k cells)AutomatedCellTypistSpot-check with manual markers
Well-characterized tissue (lung, kidney, brain)Reference-based label transferscArches / AzimuthMarker consistency on top clusters
Novel/rare tissue, no good referenceManual marker-basedScanpy / SeuratHierarchical, broad-to-fine
Cross-species (e.g., zebrafish)Manual markers + ortholog mappingScanpy + custom panelCompare to closest reference species
Developmental / continuous trajectoryReference-based with state-aware modelscANVI / scArchesTrajectory coherence + markers
Disease tissue with known perturbationManual + automated cross-checkCellTypist + ScanpyConfirm disease-specific states separately

Three Annotation Approaches

1. Manual Marker-Based Annotation

Identify cell types by examining expression of known marker genes in each cluster.

Tools: Scanpy, Seurat Best for: Small datasets, novel cell types, high confidence needs

2. Automated Annotation

Use pre-trained classifiers to automatically assign cell type labels.

Tools: CellTypist, scAnnotate Best for: Standard tissues, quick preliminary annotation, large datasets

3. Reference-Based Label Transfer

Transfer labels from annotated reference datasets to your query data.

Tools: scArches, scANVI, Azimuth, SingleR Best for: Well-characterized tissues, integration with public data

Recommended Workflow

Step 1: Quality Control First

  • Remove low-quality cells before annotation
  • Filter doublets (expected doublet rate: 0.8% per 1000 cells)
  • Check for ambient RNA contamination
  • Verify cluster quality and resolution

Step 2: Initial Marker-Based Assessment

python
# Scanpy example
import scanpy as sc

# Calculate marker genes for clusters
sc.tl.rank_genes_groups(adata, 'leiden', method='wilcoxon')

# Visualize top markers
sc.pl.rank_genes_groups(adata, n_genes=25, sharey=False)

# Plot known markers
markers = {
    'T cells': ['CD3D', 'CD3E', 'CD4', 'CD8A'],
    'B cells': ['CD19', 'MS4A1', 'CD79A'],
    'Monocytes': ['CD14', 'FCGR3A', 'LYZ'],
    'NK cells': ['NCAM1', 'NKG7', 'GNLY']
}

sc.pl.dotplot(adata, markers, groupby='leiden')

Step 3: Use Automated Tools for Validation

python
# CellTypist example (fast, accurate for immune cells)
import celltypist
from celltypist import models

# Download immune cell model
model = models.Model.load(model='Immune_All_Low.pkl')

# Predict cell types
predictions = celltypist.annotate(adata, model=model, majority_voting=True)
adata = predictions.to_adata()

Step 4: Reference-Based Refinement

python
# scArches example for label transfer
import scarches as sca

# Load pre-trained reference model
model = sca.models.SCANVI.load_query_data(
    adata=adata,  # Your query data
    reference_model="path/to/reference_model"
)

# Transfer labels
model.train(max_epochs=100)
adata.obs['transferred_labels'] = model.predict()

Best Practices

Do's:

  1. Always combine multiple approaches - Use marker-based validation even with automated tools
  2. Check cluster purity - Ensure clusters represent single cell types
  3. Validate with multiple marker sets - Don't rely on single markers
  4. Consider biological context - Tissue type, disease state, developmental stage
  5. Document confidence levels - Note uncertain annotations
  6. Use hierarchical annotation - Broad categories first, then subtypes

Don'ts:

  1. Don't over-cluster - Too fine resolution creates artificial distinctions
  2. Don't ignore batch effects - Correct before annotation
  3. Don't trust automation blindly - Always validate predictions
  4. Don't mix cell states with cell types - Activated vs. resting cells are states, not types
  5. Don't annotate low-quality cells - Remove them first

Common Pitfalls

  1. Doublet Clusters: Clusters that show markers from multiple cell types are often doublets, not novel hybrid populations.
    • How to avoid: Run doublet detection tools (Scrublet, DoubletFinder) before annotation and remove flagged cells.
  2. Ambient RNA Contamination: Background markers appear across all cells, blurring cell type boundaries.
    • How to avoid: Apply SoupX or CellBender decontamination during preprocessing — don't trust raw counts on droplet data.
  3. Over-interpretation of Small Clusters: Rare clusters (<25 cells) are often technical artifacts rather than biological subtypes.
    • How to avoid: Require a minimum cell count threshold and validate with an independent dataset before naming the cluster.
  4. Reference Mismatch: Transferring labels from a reference built on a different tissue, species, or condition produces confidently wrong annotations.
    • How to avoid: Use tissue- and species-matched references, and check marker-gene overlap between query and reference before label transfer.
  5. Confusing Cell States with Cell Types: Activated vs. resting T cells, M1 vs. M2 macrophages, and cycling vs. quiescent cells are states, not distinct types.
    • How to avoid: Annotate cell type first using stable lineage markers, then layer state annotations on top — don't mix the two axes.
  6. Trusting Automated Tools Blindly: CellTypist or SingleR predictions look authoritative but can fail silently on out-of-distribution cells.
    • How to avoid: Always cross-check automated calls against marker-based dot plots, and flag low-confidence predictions for manual review.
  7. Annotating Low-Quality Cells: Including cells with high mitochondrial content or low gene counts contaminates downstream signatures.
    • How to avoid: Apply QC filters (mt%, n_genes, n_counts) before clustering — don't annotate first and clean up later.

Tool Selection Guide

ScenarioRecommended ToolWhy
Immune cells (human)CellTypistPre-trained on large immune atlases
Mouse tissuesscArches + Mouse Cell AtlasComprehensive mouse reference
Novel cell typesManual + Scanpy/SeuratNeed domain expertise
Large datasets (>100k cells)CellTypistFast, scalable
Cross-speciesManual markersLimited reference transfer
Developmental datascArchesHandles continuous states

Key Marker Genes by Cell Type

Blood/Immune:

  • T cells: CD3D, CD3E (all T cells); CD4, CD8A (subtypes)
  • B cells: CD19, MS4A1 (CD20), CD79A
  • Monocytes/Macrophages: CD14, CD68, LYZ
  • NK cells: NCAM1 (CD56), NKG7, KLRD1
  • Dendritic cells: FCER1A, CD1C

Epithelial:

  • General epithelial: EPCAM, KRT18, KRT19
  • Lung AT1: AGER, PDPN
  • Lung AT2: SFTPC, SFTPA1
  • Intestinal: VIL1, MUC2

Stromal:

  • Fibroblasts: COL1A1, DCN, LUM
  • Endothelial: PECAM1 (CD31), VWF, CDH5
  • Smooth muscle: ACTA2, MYH11, TAGLN

Validation Checklist

  • Cluster purity: >80% cells with same label per cluster
  • Marker consistency: Top DE genes match expected markers
  • Biological plausibility: Expected proportions for tissue type
  • Cross-method agreement: Manual and automated annotations align
  • Reference quality: >70% cells successfully transferred
  • Doublet check: No clusters with multi-lineage markers
  • Documentation: Record confidence levels and uncertain calls

References

Tools:

Marker Databases & Atlases:

Pre-trained Models:

  • CellTypist models: 30+ tissue-specific models
  • Azimuth references: PBMC, lung, kidney, etc.
  • scArches models: Multiple tissue references

Troubleshooting

Issue: All clusters look similar → Increase clustering resolution, check if data is normalized

Issue: Too many small clusters → Decrease resolution, merge similar clusters based on markers

Issue: Automated tool gives inconsistent results → Check input normalization, try multiple tools, fall back to manual

Issue: Can't find clear markers for cluster → May be transitional state, doublet, or low-quality cells

Issue: Reference transfer fails → Check batch correction, ensure overlapping gene sets, verify tissue match

常见问题

Single Cell Annotation AI 技能有什么作用?

Best practices for single-cell RNA-seq cell type annotation including marker-based, reference-based, and automated classification approaches.

为什么在 TypingMind 中使用 Single Cell Annotation?

因为您只需安装一次,就能搭配任何模型使用。Single Cell Annotation 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Single Cell Annotation?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/jaechang-hits/SciAgent-Skills/tree/main/legacy/single-cell-annotation。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Single Cell Annotation?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Single Cell Annotation 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Single Cell Annotation 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Single Cell Annotation AI 技能免费吗?

是的。jaechang-hits 已在 GitHub 上根据 open 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇