PI/Ti 临床关联指数

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

Chat2Research Al科研工作台:Use when computing PI/Ti clinical-association indices from cell-subset ratios in a Seurat object. Parameterized R script for the Predictive Index (pre-treatment ratio vs clinical change) and Therapeutical Index (paired pre/post delta-ratio vs clinical change) plus per-treatment lollipop plots.(Skill由Chat2Research Al科研工作台:https://icell.abiosciences.cn/?source=20e0489c 提供,登录平台可享免费算力和Token及更多分析组学Skills)

一句话选型结论

按资料字段整理

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

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

安装

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

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

  2. 2
    拿到技能文件

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

  3. 3
    刷新技能列表

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

  4. 4
    验证是否生效

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

技能档案

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

典型使用场景

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

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

搭工作流

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

做提示词与评测

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

选择建议

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

值得选的地方

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

先想清楚的地方

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

更适合

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

不太适合

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

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
PI/Ti 临床关联指数当前 未标注权限 未标注 未标注 未标注 有
执行计划 只读 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 全文

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

PI / Ti Clinical Association Index (cell-subset ratio vs clinical change)

Overview

Both indices reduce a cell-subset frequency (ratio) to a single signed number that
measures how strongly that subset tracks a clinical score change. The statistic is
index = (-slope / |slope|) * R2 from lm(clin_value ~ ratio):
the sign of the slope (a decrease in the subset with a better clinical outcome
gives a positive index) multiplied by the regression R2 (effect strength).
Range is [-1, 1]; 0 and NA slopes become NA.

PI — Predictive Index Ti — Therapeutical Index
Sampling pre-treatment only (cross-sectional, time == pre) paired pre + post (longitudinal, same patient)
Predictor ratio = subset cells / sample cells delta_ratio = ratio_post - ratio_pre
Unit sample (library) patient
Question does the baseline abundance predict the clinical change? does the therapy-induced shift relate to the clinical change?
Clinical column in the author's script NPS.change SNOT.change
Output column Pi Ti

PI is horizontal (between patients at baseline); Ti is longitudinal (within patient
across treatment). Use PI when only baseline samples exist, Ti when both time points
are available for enough patients.

Canonical script

  • scripts/pi_ti_clinical_index.R.txt — CLI-parameterized version of the author's
    original PI_TI.R. Statistical definition is byte-identical in behaviour
    (verified: base-R recomputation on mock data reproduced all slope / R2 / Pi
    values exactly).
  • Original (read-only, do not modify): the author's PI_TI.R, with README.md in the same directory.
  • The author's script hardcoded absolute project paths and the input rds path; those paths do not exist in this container.

Inputs

An .rds of a Seurat object (only meta.data is used), or an .rds holding a plain
data.frame of meta.data (useful for testing). One row per cell. Required columns
are checked explicitly; a missing one aborts with the list of available columns.

Role CLI flag Author's column Notes
time --time-col time must contain the --pre-level (and --post-level for Ti) values
treatment / group --group-col treatment one lollipop panel per level
sample (PI) --sample-col sample library / aliquot id — the ratio denominator
patient (Ti) --sample-col-ti patient defaults to --sample-col; must be constant across that patient's pre/post samples
cell subset --cluster-col subCluster1 any granularity (subCluster1, subCluster2, celltype …)
clinical change (PI) --clin-col-pi NPS.change must be the change score, not the raw pre/post value
clinical change (Ti) --clin-col-ti SNOT.change same

The clinical change column is usually derived, e.g. the author commented
meta$NPS.change <- meta$NPS.post - meta$NPS.pre. The script never computes it —
add it to meta.data yourself before running.

Steps

PI (pre-treatment, cross-sectional)
1. Subset meta to time_col == pre_level (aborts if the level is absent, listing the
observed levels).
2. group_by(sample_col, cluster_col) → n(); then per sample ratio = n / sum(n)
→ one row per sample × subset.
3. Build a per-sample clinical table (distinct(sample_col, .keep_all = TRUE) →
sample, clin_value = clin_col_pi, treatment = group_col) and left_join it
onto the ratio table.
4. Per treatment × subCluster1: keep only n() >= min_n and sd(ratio) > 0.
5. lm(clin_value ~ ratio) → slope, R2, Pi = (-slope/|slope|) * R2;
sort by treatment, desc(Pi).
6. One lollipop panel per treatment, arranged side by side.

Ti (paired pre/post, longitudinal)
1. group_by(sample_col_ti, time_col, cluster_col) → n(); ratio = n / sum(n)
within each patient × time point.
2. Join the same per-patient clinical table (by patient).
3. pivot_wider(names_from = time, values_from = ratio, names_prefix = "ratio_")
→ columns ratio_pre / ratio_post (names follow --pre-level / --post-level).
4. delta_ratio = ratio_post - ratio_pre; drop rows with NA delta — i.e. patients
with only one time point (the pairing requirement; count is logged).
5. Per treatment × subCluster1: keep only n() >= min_n and sd(delta_ratio) > 0.
6. lm(clin_value ~ delta_ratio) → slope, R2, Ti = (-slope/|slope|) * R2;
sort by treatment, desc(Ti).
7. One lollipop panel per treatment.

--mode PI|Ti|both selects which blocks run; both share the same palette and output
directory.

Usage

S=scripts/pi_ti_clinical_index.R.txt
Rscript $S --help

# author's own design (CD4T object: PI on baseline samples, Ti on paired patients)
Rscript $S \
  --input-rds /path/CD4T.seu.globalC.rds \
  --output-dir ./PI_TI_results \
  --time-col time --pre-level pre --post-level post \
  --group-col treatment \
  --sample-col sample --sample-col-ti patient \
  --cluster-col subCluster1 \
  --clin-col-pi NPS.change --clin-col-ti SNOT.change \
  --mode both --min-n 3

Parameters

Flag Default Meaning
--input-rds (required) Seurat object rds or meta.data data.frame rds
--output-dir ./PI_TI_results creates Img/, Stat/, Rdata/
--mode both PI, Ti or both
--time-col time pre/post column
--pre-level / --post-level pre / post levels inside --time-col
--group-col treatment treatment column → one panel per level
--sample-col sample sample column used by PI
--sample-col-ti = --sample-col patient column used by Ti (author used patient)
--cluster-col subCluster1 cell-subset column
--clin-col-pi NPS.change clinical change column for PI
--clin-col-ti SNOT.change clinical change column for Ti
--clin-col — sets both clinical columns at once (mode-specific flags win)
--min-n 3 minimum samples per treatment × subset (author's n() >= 3)
--palette-csv — 2-column CSV cluster,color (header optional) replacing the built-in map
--auto-palette off give unmatched subsets a grey fallback colour instead of warning
--plot-width / --plot-height 4 × n_treatments / 5 inches of the combined PDF
--help — usage, exit 0

Built-in palette (the author's CD4 map, used when --palette-csv is absent) — the
names must be edited for other datasets:

CD4_Tcm_IL7R #9AA7B1   CD4_Tem_CCL4 #BA5B49    CD4_Th17_CCR6 #D3CCD6
CD4_Th2_IL13 #a382bd   CD4_Tn_CCR7  #BC836B    CD4_Treg_FOXP3 #B1D5C8
CD4_Treg_TNFRSF4 #EE7959   CD4_Ttrm_TOX2 #E5A84B

Outputs

<output-dir>/

Path Content
Stat/pi_df.csv treatment, subCluster1, slope, R2, Pi — one row per retained treatment × subset
Stat/ti_df.csv treatment, subCluster1, slope, R2, Ti
Stat/pi_ti_run_log.txt stdout log: input, column check, per-block filtering counts
Img/PI_lollipop_by_treatment.pdf ggarrange panel: one lollipop plot per treatment, x = subsets ordered by descending Pi, dashed 0 line, y = "Predictive Index"
Img/TI_lollipop_by_treatment.pdf same for Ti, subsets ordered by descending Ti, y = "Therapeutical Index"
Rdata/pi_ti_results.rds list(pi_df, ti_df, ratio_wide, palette, params)

The lollipop geometry is the author's: grey stem from 0 (geom_segment, grey70,
linewidth 0.8) plus a grey90 halo point (shape 21, size 6, stroke 1.2) and the filled
point on top (shape 21, size 5, stroke 0.3), theme_classic(base_size = 14), x labels
at 45°, no legend. Subsets are ordered by descending index, so sign and magnitude are
read straight off the y-axis.

Pitfalls

  • Column names must exist in meta.data exactly. The script aborts with the full
    available-column list rather than guessing; check colnames(obj@meta.data) first.
  • library(SingleCellExperiment) silently masks dplyr::rename. S4Vectors
    exports its own rename, so a later library(SingleCellExperiment) breaks
    rename(sample = !!col) with 参数类型无效 / invalid argument type (base ! gets
    evaluated instead of tidyselect injection). Fix in the script: re-attach dplyr
    after all libraries and call dplyr::rename explicitly. The author's script was
    immune only because its library(dplyr) line came after
    library(SingleCellExperiment). Same class of trap: matrixStats::count,
    IRanges::slice (ggpubr::mutate is identical to dplyr::mutate, so it is safe).
  • n() >= 3 and sd(x) > 0 silently drop whole groups. These filters remove
    any treatment × subset combination with fewer than 3 samples (PI: samples; Ti:
    paired patients) and any combination where the ratio/delta is constant (R2 is
    undefined). Small subsets therefore vanish entirely from the table and the plot —
    the run log prints before -> after counts per block, so check it before
    concluding a subset has no signal. Loosening --min-n trades coverage for
    unreliable slopes.
  • Ti needs true pairing. delta_ratio is NA whenever a patient has only one
    time point (or one of the two, e.g. post missing) and those rows are dropped —
    a patient contributes to Ti only if both --pre-level and --post-level rows
    exist for the same --sample-col-ti value. The ratio is also computed per patient
    × time point, so an unbalanced pre/post cell count is fine.
  • Palette names must match your subset names. scale_fill_manual(values = pal, limits = names(pal)) means any subset absent from the palette is set to NA and
    the point is dropped from the panel (ggplot warns "Removed k rows…"). The script
    pre-empts this with its own warning listing the offending subsets; pass
    --palette-csv (or edit default_palette) with your real subset names.
  • PI and Ti use different sample/clinical columns in the author's design
    (sample + NPS.change vs patient + SNOT.change). Keep --sample-col-ti and
    the two --clin-col-* flags straight; --clin-col is a shortcut that sets both.
  • --sample-col-ti must be constant within a patient across pre/post, otherwise the
    pairing breaks and every delta_ratio is NA.
  • The clinical column has to be the change score. Passing a raw value silently
    produces a meaningless index (no error) — PI/Ti assume clin_value already is a
    delta or a change-from-baseline score.
  • The library(Matrix/scales/matrixStats/slingshot/SingleCellExperiment) lines are
    carried over from the author's script; only Seurat, tidyverse/dplyr/tidyr,
    ggplot2, ggpubr, RColorBrewer are actually needed. The optional ones are
    soft-checked (a message instead of an error if missing) so the script still runs.

Environment

  • Author's environment (README): a Singularity/Apptainer base image,
    conda activate R.4.4.3, start-rstudio.
  • Abio container: Rscript is /opt/conda/bin/Rscript (R 4.5.3). .libPaths() =
    /opt/user_R_libs → /opt/public_R_libs → /opt/conda/lib/R/library.
    The env exports a stale R_HOME=/usr/local/lib/R; R 4.5.3 ignores it and prints
    WARNING: ignoring environment value of R_HOME — harmless.
  • optparse is NOT installed in the Abio container, so the script parses
    commandArgs(trailingOnly = TRUE) in base R (--flag value, --flag = TRUE).
    Do not add an optparse dependency unless the user asks for it.
  • Verified present (container, R 4.5.3): Matrix, scales, matrixStats,
    slingshot, Seurat, SingleCellExperiment, tidyverse, RColorBrewer,
    ggplot2, dplyr, ggpubr, tidyr.
  • Write outputs under <output-dir>/{Img,Stat,Rdata} (the Abio convention), and keep
    anything user-visible in the container /output tree so the frontend can preview it.
  • Validation actually run (not the real object): a synthetic meta.data with 2
    treatments × 5 subsets × 8 samples (one unpaired post sample, one 2-patient arm)
    went through --mode both — 15 → 10 groups kept, 1 unpaired patient dropped,
    PDFs written, and all slope / R2 / Pi values matched an independent base-R
    recomputation exactly. Rscript --help exits 0 and
    invisible(parse(file = ...)) is clean.

> 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/<name>.R.txt ... behaves exactly like .R, and tab-separated data
> parses identically from .tsv.txt. Keep the suffix when repackaging.

常见问题

5 问
答案由本站依据条目字段整理
PI/Ti 临床关联指数怎么安装?

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

PI/Ti 临床关联指数支持哪些客户端?

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

PI/Ti 临床关联指数权限高吗,安全吗?

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

PI/Ti 临床关联指数收费吗?

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

PI/Ti 临床关联指数用什么许可证?

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

热门专题

按场景挑技能
全部专题 →

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