decal — 差异细胞通讯的可辨识性诊断
Decoy-Calibrated communication audit. 在你报告"某条配体-受体通讯被改写"之前,先问一句:这个结论能不能和表达丰度区分开?
decal 给任意"两组细胞的配体-受体差异通讯"分析做三件事:
| 输出 | 含义 | 读法 |
|---|---|---|
delta |
每位供体的效应中位数(全局位移) | |δ|>0.3 → 排序是位移在排,不是生物学在排 |
rho_abund_S |
扣位移后残差与丰度的秩相关 | >0.5 → 排序≈丰度排序,别解释配对排序 |
decoy_auroc |
真对 vs 分层匹配诱饵的可分性 | 0.5 = 配对身份零信息 |
match_balance |
诱饵在丰度/检出上的残差 | >0.15 = 配平失败,decoy_auroc 不可解释 |
n_calls_q10 |
诱饵校准 + BH 后 q<0.10 的调用数 | 0 = 该主张无法与丰度区分 |
verdict |
四值判定 | 见下 |
verdict 取值:identifiable / marginal-dominated / not-identifiable / decoy-mismatch
安装
pip install decal-ccc # 发布后
# 或从源码
cd decal && pip install -e .
依赖只有 numpy 与 scipy,无 GPU、无其他包。
用法
Python
from decal import audit
# H, L: (n_donor, n_gene) 的两组均值矩阵(建议已按细胞总量归一化,如 log1p(CP10K))
# genes: 基因名列表
# lr: [(配体, 受体), ...] 或 [(通路, 配体, [受体, ...]), ...]
res = audit(H, L, genes, lr)
print(res["delta"], res["rho_abund_S"], res["n_calls_q10"], res["verdict"])
命令行
decal --npz means.npz --lr lr_db.json
decal --npz means.npz --lr lr_db.json --json
means.npz 需包含 means_H / means_L / genes。
为什么诱饵必须分层匹配
最近邻匹配会留下系统性残差。我们在真实数据上实测:
| 方法 | 真对 vs 诱饵 AUROC |
|---|---|
| TabPFN-3.5(2026 TabArena/BeyondArena 双榜前三,20 特征,配体分组 5 折) | 0.829 |
| Logistic 回归 | 0.618 |
| |E| 单特征 | 0.501 |
| 分层精确匹配(丰度五分位 × 检出五分位) | 0.509 |
那 0.32 的"领先"全部来自匹配残差(真受体比诱饵更低表达、更差检出)。 模型越强,越会学混杂。 所以 decal v2:
- 强制在同一 (丰度, 检出) 层内抽诱饵;
- 输出
match_balance; - 配平失败时直接返回
verdict="decoy-mismatch",拒绝解释 AUROC。
在 KPMP 上的实测输出
{
"n_pairs": 1572, "n_decoys": 4716,
"delta": 0.712, "delta_sd": 0.330, "frac_up": 0.946,
"rho_abund_S": 0.670, "decoy_auroc": 0.498,
"match_balance": {"abund": 0.113, "det": 0.015},
"n_calls_q05": 0, "n_calls_q10": 0,
"verdict": "not-identifiable"
}
94.6% 的对同向上调(δ=0.71);扣位移后残差与丰度相关 0.67;真对与诱饵 AUROC 0.50; FDR 0.10 下零调用。对照:LIANA 2.1.1 在同一批细胞上报 8,504 条"显著"交互。
建议的报告方式
- δ 大时,不要解释"哪一对通讯被改写",只解释"配体/受体程序整体上调"。
- 任何配对级主张,附上
n_calls_q10。若为 0,说明该主张无法与丰度匹配诱饵区分。 - 需要配对级结论时,去找正交证据(空间邻接、蛋白、扰动),而不是换打分公式。
- 报告层级:细胞类型对(可辨识)> 配体/受体程序 > LR 对(多数情况下不可辨识)。
引用
如果你用 decal 做了可辨识性诊断,请引用配套论文(见 CITATION.cff)。
License
MIT
Metadata
Release files for decal-ccc 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| decal_ccc-0.2.0.tar.gz | 11.3 kB | Without provenance | Details for decal_ccc-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| decal_ccc-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for decal_ccc-0.2.0-py3-none-any.whl |
Total release size: 22.0 kB
Release files / decal_ccc-0.2.0.tar.gz
| Download URL | decal_ccc-0.2.0.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae37c7823be1953ca3536b3cf20c0f5da79305f62b25dac1491d20c1eaa8baa2
|
|
BLAKE2b-256 checksum How to use checksums |
82ca10d27f180b6f63094451369259f51d4627d779c484e10788044fc7d08f41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Release files / decal_ccc-0.2.0-py3-none-any.whl
| Download URL | decal_ccc-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9246a4799a2dceb131399bae815e187568846545f6d77d8b68aa2e061f2b6556
|
|
BLAKE2b-256 checksum How to use checksums |
9064cf5a0d3cb59157569829e5890a250be8093d2d90e094f693d7d9201f2966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Security for decal-ccc 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.