Single Cell Rnaseq logo

Single Cell Rnaseq

Community
ssinder
single-cell-rnaseq

This skill should be used when running single-cell RNA-seq analysis: reading 10x/AnnData matrices, QC filtering, normalization, HVG selection, PCA, clustering, UMAP/t-SNE and cell type annotation. 用于单细胞转录组(scRNA-seq)质控、降维、聚类与细胞注释全流程。

Overview

Publisherssinder
Repositorybioinformatics-agent-skills
Skill namesingle-cell-rnaseq
Stars
75
Forks
2
Bundled files
7
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ssinder on GitHub. Read the source before you install it.

Installation

Install the Single Cell Rnaseq AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/single-cell-rnaseq
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ssinder/bioinformatics-agent-skills.git /tmp/bioinformatics-agent-skills
mkdir -p .claude/skills
cp -r /tmp/bioinformatics-agent-skills/skills/single-cell-rnaseq .claude/skills/single-cell-rnaseq
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Single Cell Rnaseq in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Single Cell Rnaseq on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Single Cell Rnaseq is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Overview

本技能把单细胞 RNA-seq 数据从原始计数矩阵处理到可解释的细胞分群与细胞类型注释:自动识别 10x HDF5 / MTX / 稠密 CSV / h5ad 四类输入格式,做基于线粒体比例、基因数与 UMI 数的质控过滤,随后进行 CP10K + log1p 归一化、高变基因筛选、z-score 缩放、截断 SVD 主成分分析、kNN 邻接图构建与图聚类,最后输出 UMAP / t-SNE 二维嵌入、每簇 marker 基因表与可视化图表。

分析提供 双后端:--backend scanpy 调用官方 scanpy 实现,--backend numpy 使用内置的纯 NumPy/SciPy/scikit-learn 降级实现(自实现的 Louvain/UMAP 谱初始化与力优化),在没有 scanpy 的环境中仍能产出统计等价的结果。

When to Use This Skill

  • 用户要做单细胞转录组分析(关键词:single-cell、scRNA-seq、单细胞、细胞图谱、细胞注释、UMAP、聚类)
  • 用户有 10x Genomics 原始计数(matrix.h5 / filtered_feature_bc_matrix/)需要走标准 QC 与聚类流程
  • 用户需要判断细胞质量(关键词:doublet、双细胞、线粒体比例、mitochondrial、QC、过滤阈值)
  • 用户需要找每个细胞群的 marker 基因并据此命名细胞类型
  • 用户环境里没有 scanpy,但仍需要可复现的降维与聚类结果
  • 用户已有聚类结果,需要补充 t-SNE / marker 热图 / 分析报告

不适用:bulk RNA-seq(用 bulk-rnaseq)、空间转录组(CST/Slide-seq 需专门流程)、单细胞 ATAC、轨迹推断(trajectory inference)。

Quick Start

bash
export PYTHONPATH="$PWD/packages"

# 完整流程(自动检测输入格式)
python skills/single-cell-rnaseq/scripts/run_pipeline.py \
    --input  /data/filtered_feature_bc_matrix \
    --output /results/scrna \
    --marker-file /ref/cell_marker_reference.csv

# 10x HDF5 + 强制使用降级后端(无 scanpy 环境)
python skills/single-cell-rnaseq/scripts/run_pipeline.py \
    --input /data/raw/filtered_feature_bc_matrix.h5 \
    --output /results/scrna \
    --backend numpy --n-neighbors 15 --resolution 1.0

# 只做质控,不做降维聚类
python skills/single-cell-rnaseq/scripts/quality_control.py \
    --input /data/filtered_feature_bc_matrix \
    --output /results/scrna_qc \
    --min-genes 200 --min-counts 500 --max-mt-pct 15

Workflow

  1. 数据读取 — 自动嗅探输入类型:10x HDF5(read_10x_h5)、10x MTX 目录(read_10x_mtx)、稠密 CSV/TSV(read_dense_table)、h5ad(read_h5ad);统一封装为轻量 SimpleAnnData 兼容容器,不强制依赖 anndata。
  2. 质控指标 — 逐细胞计算 total_counts / n_genes_by_counts / pct_counts_mt(线粒体)/ pct_counts_hb(血红蛋白)及对数版本。
  3. 质控过滤 — 按 min_genes、min_counts、max_mt_pct、可选 max_hb_pct 过滤细胞;按 min_cells_per_gene 过滤基因;输出过滤前后细胞数/基因数与去除率。
  4. 归一化 — library size 归一化到 CP10K(--target-sum),随后 log1p 变换稳定方差。
  5. 高变基因 — Seurat 风格分箱 z-score 法(20 个表达量分箱,对数期望值/标准差标准化,CV 校正),选出 --n-top-genes 个基因。
  6. 缩放与 PCA — 逐基因 z-score 缩放并截断到 ±10;用截断 SVD(稀疏输入)/ 稠密 SVD 得到 --n-comps 个主成分,同时记录解释方差比例。
  7. 邻接图 — 在 PCA 空间用 sklearn NearestNeighbors 找 k 近邻,用 Jaccard 相似度算边权,经 UMAP 式 prune 阈值剪枝后对称化并行归一化。
  8. 聚类 — 优先 Leiden(leidenalg + igraph,RBConfiguration),缺失时回退到内置 Louvain(模块度增益的局部移动 + 多层图聚合)。--resolution 控制粒度。
  9. 降维嵌入 — UMAP(umap-learn 可用时用官方实现;否则用内置谱初始化 + UMAP 真实力公式优化)与 t-SNE(sklearn TSNE)。
  10. Marker 与注释 — Welch t 检验 + BH 校正对每簇排序 marker;用 marker 参考文件做基因重叠打分给出细胞类型标签,无参考文件时输出匿名标签。
  11. 可视化与报告 — UMAP 分群图、UMAP 细胞类型图、簇大小条形图、marker 热图(PDF + PNG,300 DPI),并生成文字报告与 run_manifest.json。

Parameters

参数默认说明
--input必填输入矩阵:10x h5 / 10x mtx 目录 / csv / h5ad
--output<results>/scrna输出根目录,下设 7 个步骤子目录
--marker-file无marker 参考 CSV(含 class_label / subclass_label / marker 列)
--backendautoauto / scanpy / numpy(降级实现)
--min-genes200细胞至少检测到的基因数
--min-counts100细胞至少的 UMI 数
--max-mt-pct20.0线粒体基因比例上限(%)
--max-hb-pct无血红蛋白基因比例上限(%),默认不过滤
--min-cells-per-gene3基因最少在多少细胞中表达
--target-sum1e4归一化目标总计数(CP10K)
--n-top-genes2000参与 PCA 的高变基因数
--n-comps50PCA 主成分数
--n-neighbors15kNN 邻居数 k
--resolution1.0聚类分辨率(越大簇越细)
--min-dist0.3UMAP 最小嵌入距离
--n-markers100每簇保留的 marker 基因数
--seed0随机种子
--no-tsne关跳过 t-SNE(较慢)

Outputs

文件说明
01_qc/obs_qc.csv每细胞质控指标(counts / genes / mt% / hb%)
01_qc/qc_summary.json过滤前后细胞数、基因数与所用阈值
02_normalized/var_hvg.csv每基因的均值与高变标记
03_dimensionality/embeddings.csvPCA / UMAP / t-SNE 坐标合并表
03_dimensionality/pca_variance.csv各主成分解释方差比例
04_clustered/聚类标签(写入 obs)
05_annotated/cluster_annotations.csv每个 cluster 的细胞类型标签与 marker 重叠数
05_annotated/marker_genes.csv每簇 marker 基因表(logFC / t 值 / p / padj)
05_annotated/cluster_summary.csv每簇细胞数与 marker 数
06_figures/Figure{1..4}_*.{pdf,png}UMAP 分群图、UMAP 细胞类型图、簇大小图、marker 热图
07_report/scrna_report.txt完整分析报告
run_manifest.json运行元数据(输入、后端、细胞/基因数、簇数)
qc_metrics.csv / qc_filtered_cells.csv / qc_summary.json(quality_control.py 独立产出)

Validation

  • 质控过滤率:细胞去除率通常在 5%–30%。超过 50% 说明阈值过严(常见于 --min-genes 偏高),低于 1% 说明阈值过松,应检查是否混入了大量低质量细胞。
  • 线粒体比例:健康细胞通常 < 10%。若绝大多数细胞 > 30%,提示样本解离质量差或存在应激,此时上调 --max-mt-pct 只会引入噪声细胞。
  • 簇大小:出现占比 < 1% 的小簇通常是双细胞或批次效应,可通过调高 --resolution 观察其是否稳定存在。
  • UMAP 形态:簇应呈连续、互不重叠的团块。若所有细胞挤成一点,通常是 --n-top-genes 过小或 PCA 维度不足;若出现极端离群细胞,检查是否有未过滤的低质量细胞。
  • marker 合理性:每簇的 top marker 应有明确生物学含义。若某簇的 marker 全是核糖体蛋白基因,多半是簇内缺少区分信号(分辨率过低)。
  • 降维一致性:UMAP 与 t-SNE 上同一 cluster 的位置若完全不一致,说明邻接图不稳定,可增大 --n-neighbors 后重跑。
  • 后端一致性:同一数据用 --backend scanpy 与 --backend numpy 各跑一次,聚类数与簇大小分布应大体一致(±1 个簇以内)。

References

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Single Cell Rnaseq AI skill do?

This skill should be used when running single-cell RNA-seq analysis: reading 10x/AnnData matrices, QC filtering, normalization, HVG selection, PCA, clustering, UMAP/t-SNE and cell type annotation. 用于单细胞转录组(scRNA-seq)质控、降维、聚类与细胞注释全流程。

Why use Single Cell Rnaseq on TypingMind?

Because you install it once and use it with any model. Single Cell Rnaseq is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Single Cell Rnaseq in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/single-cell-rnaseq. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Single Cell Rnaseq?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Single Cell Rnaseq?

As many as you like. As long as a model supports skills, you can use Single Cell Rnaseq with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Single Cell Rnaseq AI skill free?

Yes. It is published on GitHub by ssinder under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇