SciBet 细胞类型预测

SKILLAI 工具
AI 工具 未标注权限 许可证不明确
安装这个技能

Chat2Research Al科研工作台:Use when predicting cell types by training a SciBet classifier on a reference dataset. SelectGene selects informative genes, Learn returns the predictor.(Skill由Chat2Research Al科研工作台:https://icell.abiosciences.cn/?source=20e0489c 提供,登录平台可享免费算力和Token及更多分析组学Skills)

一句话选型结论

按资料字段整理

SciBet 细胞类型预测是AI 工具类的 Agent Skill,安装方式未标注,权限级别未标注,许可证不明确,有可直接复制的安装命令。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类AI 工具 安装方式未标注 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 未标注 仓库 未标注
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

未标注
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
skillhub install user_7ece4fea/scibet-cell-type-prediction
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    执行上面的命令安装;也可以把仓库里的 SKILL.md 手动放进客户端的 skills 目录。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

AI 工具
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方user_7ece4fea仓库 未标注 · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式未标注安装包 community
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 1791623331
正文体量15.5 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
组合多个 AI 能力

把写作、检索、总结串成一条流程。

搭工作流

把固定流程做成可重复调用的步骤。

做提示词与评测

整理提示词并对比输出效果。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在AI 工具场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
SciBet 细胞类型预测当前 未标注权限 未标注 未标注 未标注 有
执行计划 只读 GitHub 仓库 151.5 万 Codex、Claude、Cursor 有
Playwright MCP 测试 浏览器控制 ClawHub 市场 136.5 万 OpenClaw 有
完成前的验证 未标注权限 GitHub 仓库 131.9 万 Codex、Claude、Cursor 有
子 Agent 驱动开发 只读 GitHub 仓库 131.2 万 Codex、Claude、Cursor 有
前端设计 执行命令 GitHub 仓库 125.6 万 Codex、Claude、Cursor 有

SKILL.md 全文

15.5 KB
模型实际读到的说明书原文,来自技能仓库

SciBet reference training + cell type prediction

Overview

SciBet (scibet, Zhang Lab / Peking University) is a supervised cell type identifier: train a
multinomial model on a labelled reference dataset, then assign a cell type to every cell of a query
dataset. It works directly on the expression matrix (no PCA/clustering embedding is used), it is
order-of-magnitude faster than correlation/nearest-neighbour label transfer, and a trained model is
tiny (roughly <1 MB for 100 cell types x 1000 genes), so it is well suited to
cross-dataset / cross-platform / cross-species annotation.

The pipeline is three steps:

SelectGene(expr, k)                  -&gt; informative gene names   (supervised, entropy reduction)
gindex  &lt;- which(colnames==gene)     -&gt; 1-based positions
model   &lt;- Learn(expr, geneset=gindex-1)   -&gt; 0-based positions, returns a predictor function
model(query_expr)                    -&gt; predicted cell type per cell

Reference: Li et al., Nature Communications 2020, doi:10.1038/s41467-020-15523-2;
source <https://github.com/PaulingLiu/scibet>; guided tutorial <http://scibet.cancer-pku.cn/document.html>.

Inputs

  • Reference Seurat .rds: must contain a meta.data column with the cell type labels, and an
    expression matrix (log-normalized data layer is the established convention).
  • Query Seurat .rds (optional if you only want to train/save a model): same species and same
    gene symbol convention as the reference.
  • Optional a previously trained model .rds (the Learn() return value), or a fixed gene list.
  • Both objects are read with readRDS(); anything with @meta.data and an extractable assay works.

Steps

The reusable script is scripts/scibet_predict.R.txt — fully command-line parameterised, no hard-coded
paths
:

/opt/conda/bin/Rscript scripts/scibet_predict.R.txt \
  --reference-rds /path/ref.rds \
  --reference-label-col subCluster1 \
  --query-rds /path/query.rds \
  --query-label-col Annotation \
  --output-dir ./scibet_out \
  --k 2000

# train once, reuse the model later (second run skips training)
/opt/conda/bin/Rscript scripts/scibet_predict.R.txt \
  --reference-rds ref.rds --output-dir out --k 2000 --model-rds out/ref.model.rds
/opt/conda/bin/Rscript scripts/scibet_predict.R.txt \
  --reference-rds ref.rds --query-rds query.rds --model-rds out/ref.model.rds \
  --output-dir out

/opt/conda/bin/Rscript scripts/scibet_predict.R.txt --help

The script was exercised end to end on a synthetic 3-cell-type benchmark (train+predict, model
reuse, and --retrain), reaching a 180/180 correct confusion matrix.

What it does, and the same steps by hand:

  1. Extract the expression matrix. SciBet wants cells as rows, genes as columns, label as the
    last column
    . Seurat stores genes x cells, so transpose:

r train_set &lt;- tibble::as_tibble(t(as.matrix(train@assays$RNA@data))) train_set[[&quot;label&quot;]] &lt;- as.character(train$subCluster1) # MUST be the last column

  1. Select informative genes (supervised, by total entropy reduction across cell types):

r genes &lt;- scibet::SelectGene(train_set, k = 2000) # -&gt; character vector of gene names

  1. Convert gene names to 0-based column positions (see Pitfalls — this is mandatory):

r gindex &lt;- sapply(genes, function(x) which(colnames(train_set) == x)) gindex &lt;- unname(gindex)

  1. Train — Learn() returns a closure, not an S4 object:

r model &lt;- scibet::Learn(train_set, geneset = gindex - 1) # 0-based, exactly as SciBet expects saveRDS(model, &quot;tnk.model.rds&quot;)

  1. Predict on the query (the closure applies the log transform itself):

r sc_query &lt;- tibble::as_tibble(t(as.matrix(sce.all@assays$RNA@data))) major_type &lt;- model(sc_query) # character vector, one label per cell prob &lt;- model(sc_query, result = &quot;table&quot;) # cells x cell types probability matrix sce.all@meta.data$subtype &lt;- major_type table(sce.all@meta.data$Annotation, sce.all@meta.data$subtype) # original vs predicted

  1. Check the result: cross-tabulate predicted against the query's own annotation (agreement is
    the sanity metric), inspect the composition, and confirm the model/query gene overlap.

Verified API (read from the package source R/SciBet.R and src/SciBet.cpp):

Function Signature Returns
SelectGene SelectGene(expr, k = 1000, r = FALSE) character vector of gene names (r=TRUE: data.frame)
Learn Learn(expr, geneset = NULL, k = 1000, a = 0) a function(expr, result = &quot;list&quot;) predictor
SciBet SciBet(train, test, k = 1000, result = &quot;list&quot;) one-shot wrapper: Learn(train, NULL, k, 0)(test, result)
ExportModel ExportModel(Bet) matrix, rows = genes, cols = cell types
LoadModel LoadModel(x, genes = NULL, labels = NULL) predictor function rebuilt from a matrix
Bet Bet(expr, result) documented but an empty stub in the source — do not call it

Parameters

Parameter Script flag Default Meaning
k --k 2000 Genes kept by SelectGene() (total entropy reduction). In-house scripts used 2000 (TNK model) and 4000 (myeloid/basal models).
a --a 0 E-test one-vs-rest genes. Only used when no explicit geneset is passed. Man page documents a = 5 but the shipped source default is a = 0.
geneset index convention — 0-based Learn(geneset=) takes 0-based column positions (gindex - 1); SelectGene() returns names.
reference label column --reference-label-col subCluster1 meta.data column of reference cell types; must end up as the last column of expr.
assay / layer --reference-assay, --reference-layer RNA / data Equivalent to @assays$RNA@data.
query label column --query-label-col none Optional truth column for the original-vs-predicted cross-tab.
output column --pred-col subtype meta.data column written onto the query object.
output root --output-dir . output root (default .); creates Img/, Stat/, Rdata/
model in/out --model-rds none If the file exists, training is skipped and the model is loaded (--retrain forces re-training); otherwise the trained model is saved there.
fixed gene list --geneset-file none Reuse a gene list (one gene per line / first column) instead of SelectGene().
threads --threads 0 Sets options(scibet.n_threads = n); 0 lets OpenMP decide.

Learn()'s k and a are ignored whenever geneset is supplied — with an explicit gene set the
only thing that matters is the index vector.

Outputs

Written under --output-dir (default .) in the standard three-directory layout — Img/ for
figures, Stat/ for tables/text, Rdata/ for R objects — with prefix --prefix (default: reference
file basename). The script creates all three sub-directories and prints their contents when it exits.

File Content
&lt;out&gt;/Img/ reserved for figures (this script produces none)
&lt;out&gt;/Stat/&lt;prefix&gt;.genes.tsv selected genes with both index_1based and index_0based
&lt;out&gt;/Stat/&lt;prefix&gt;.predictions.csv cell, predicted_type
&lt;out&gt;/Stat/&lt;prefix&gt;.probabilities.csv per-cell probability of every reference cell type
&lt;out&gt;/Stat/&lt;prefix&gt;.confusion.tsv cross-tab of query annotation vs prediction (only with --query-label-col)
&lt;out&gt;/Rdata/&lt;prefix&gt;.model.rds trained predictor closure (only when trained in this run)
&lt;out&gt;/Rdata/&lt;prefix&gt;.query_predicted.rds query object carrying the prediction column (only with --save-query-rds)

An explicit --model-rds PATH is used verbatim (it is an input as much as an output); only the
default model location follows the Rdata/ convention.

Pitfalls

  • ⚠️ Degenerate reference input segfaults the R session (no error message). scibet::SelectGene()
    calls C++ (DsGene) that indexes without bounds checks, so a reference whose expression matrix is
    empty or has a single label level crashes R (An irrecoverable exception occurred. R is aborting now)
    instead of raising an error. Observed failure modes while validating this skill:
    (a) a reference object that never ran Seurat::NormalizeData() — Seurat's data layer is then 0×0,
    so the script reported reference: 0 cells x 0 genes and died inside SelectGene;
    (b) a reference with a single cell type — the entropy difference SelectGene maximises is undefined.
    The script now validates both cases up front and aborts with an actionable message
    (Reference expression matrix is degenerate … / Reference has only 1 label level(s) …).
    When calling the API directly, do the same: check dim(expr) is non-degenerate and that the label
    column has ≥ 2 levels before touching SelectGene().

  • ⚠️ The geneset argument is 0-based, so gindex - 1 is mandatory, not cosmetic. SelectGene()
    returns gene names; Learn() does prob &lt;- GenProb(expr, labels_in, geneset, ...) and
    genes &lt;- colnames(expr)[geneset + 1]. The C++ backend (GenProb) casts geneset to
    std::vector&lt;int&gt; and indexes the columns from 0. Passing the 1-based which() result — or the
    gene names — shifts every selected gene by one column or fails outright, silently producing a
    model trained on the wrong genes. Always convert which(colnames(train_set) == x) with - 1.
    Verified on synthetic data (independent cells, 3 cell types): Learn(geneset = gindex - 1) scored
    100% agreement and ExportModel() returned exactly the SelectGene() genes, whereas the 1-based
    vector aborted with REAL() can only be applied to a &#x27;numeric&#x27;, not a &#x27;character&#x27; and then
    segfaulted, and passing the gene names failed with
    Not compatible with requested type: [type=character; target=integer]. The C++ backend indexes
    columns without bounds checking, so the wrong index convention is a crash, not a warning.

  • ⚠️ Gene names must match between reference and query. The predictor resolves genes by name
    (have_genes &lt;- which(genes %in% colnames(expr))) and then silently drops whatever is missing —
    there is no error and no warning
    . A species/case mismatch (human CD3D vs mouse Cd3d) or a
    different annotation build therefore still "runs" and yields meaningless predictions. Always check
    the overlap; the script warns below 50%.
  • Train and predict on the same kind of matrix. GenProb sums log(x + 1)/log(2) over the
    reference and the predictor closure applies the identical log1p(x)/log(2) to the query, so SciBet
    transforms internally: do not pre-log your data and do not feed z-scored/ScaleData values.
    The in-house scripts use log-normalized @assays$RNA@data for both reference and query — keep
    that consistent, that is what makes the numbers comparable.
  • Seurat v4 vs v5 expression access. train@assays$RNA@data is the classic v4 form of
    GetAssayData(obj, &quot;RNA&quot;, slot = &quot;data&quot;). In Seurat v5 the RNA assay is an Assay5 whose data
    lives in @layers$data, so the @data slot access errors. Use
    SeuratObject::LayerData(obj, assay = &quot;RNA&quot;, layer = &quot;data&quot;) (or GetAssayData(..., layer = &quot;data&quot;)).
    The script's get_assay_data() tries the v5 path first and falls back to the v4 slot.
  • The label must be the last column and named exactly label. SelectGene/Learn treat
    ncol(expr) as the label (n_gene = LENGTH(expr_r) - 1 in C++), so an extra column anywhere
    corrupts the feature space. Never leave label in the query frame — the query has genes only.
  • Labels must be non-missing. factor(expr$label) feeds as.integer(...) directly; NA labels
    break the class numbering. Drop cells with NA/empty labels before training.
  • Storage type matters. The C++ reads every column with REAL(), which expects a double
    (REALSXP) vector. A matrix of integers (raw counts kept as integer) is misread. as.matrix()
    on a dgCMatrix already yields doubles; the script forces storage.mode(m) &lt;- &quot;double&quot; as a guard.
  • Cell order must line up. as_tibble(t(as.matrix(...))) drops cell names, so assign the label
    vector from the same object in the same order (or index meta.data by the matrix's colnames, as
    the script does).
  • t(as.matrix(...)) densifies the matrix. An all-genes dense matrix for a >100k-cell object is
    a large memory allocation; subset to the genes you need, or at least size the job accordingly
    (rm() + gc() after training).
  • Do not call scibet::Bet(). It exists only as an empty stub for documentation; the real
    predictor is the closure returned by Learn()/LoadModel().
  • Portability / web tool. For a model matrix to load elsewhere (including the JavaScript web
    client) use ExportModel(model) to get the matrix, then LoadModel(x). A plain saveRDS() of the
    closure only works in R.
  • Subset the reference if you want a cell-type-specific model; e.g.
    train &lt;- subset(train, subset = maingroups == &quot;Myeloid cells&quot;) before SelectGene(). Training on
    the full atlas and querying a subset are two different tasks — keep them straight.

Environment

  • R: /opt/conda/bin/Rscript — R 4.5.3. Library search path: /opt/user_R_libs, /opt/public_R_libs,
    /opt/conda/lib/R/library.
  • Dependency status in this container (checked with requireNamespace()):
Package Status
Rcpp, RcppEigen, ggsci, viridis, tidyverse, Matrix installed
Seurat (5.5.1), SingleCellExperiment, data.table, tibble installed
scibet 1.0 installed at /opt/public_R_libs/scibet
  • Install scibet (it is not on CRAN). It is already present in this container; the commands
    below are for a fresh environment. The package compiles C++ (src/Makevars, OpenMP), so build
    tools must be present:

r install.packages(c(&quot;Rcpp&quot;, &quot;RcppEigen&quot;, &quot;ggsci&quot;, &quot;viridis&quot;, &quot;tidyverse&quot;)) remotes::install_github(&quot;PaulingLiu/scibet&quot;) # default branch: master

For installing R/Bioconductor packages into this container's shared library, see the
abio-r-package-install skill.
- Unofficial alternative implementing the same algorithm: zhangwenjie-tina/scibetR
(SciBet_R(train, test, k = 1000, result = &quot;list&quot;)); prefer the original PaulingLiu/scibet.

> Packaging note. Scripts and tables in this skill carry a .txt suffix on their
> original extension (e.g. .R.txt, .tsv.txt) because the SkillHub upload allowlist
> does not accept .R or .tsv. This is cosmetic: Rscript is extension-agnostic, so
> Rscript scripts/&lt;name&gt;.R.txt ... behaves exactly like .R, and tab-separated data
> parses identically from .tsv.txt. Keep the suffix when repackaging.

常见问题

5 问
答案由本站依据条目字段整理
SciBet 细胞类型预测怎么安装?

在支持 Skills 的客户端里执行:skillhub install user_7ece4fea/scibet-cell-type-prediction。安装方式为未标注。装完刷新技能列表或重开客户端。

SciBet 细胞类型预测支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

SciBet 细胞类型预测权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

SciBet 细胞类型预测收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

SciBet 细胞类型预测用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。