arboreto
它能做什么
这个工具可以根据基因表达数据,帮助发现哪些基因可能控制其他基因的表达,并生成一份按可能性排序的基因关联列表。
适用场景
- ✓当你拥有基因表达数据,并想知道哪些基因可能在调控其他基因时。
- ✓当你想在生物样本中识别潜在的基因调控网络时。
- ✓当你想比较不同的基因网络分析方法时。
技能链接
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/arboreto/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请根据我的表达数据,帮我发现可能的基因关联。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会分析你的基因表达数据,并使用 GRNBoost2 或 GENIE3 等算法,预测哪些基因(调控因子)可能影响其他基因(靶基因)的表达。它会返回一份按可能性排序的潜在影响列表。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Arboreto
When to use
Use Arboreto to rank candidate regulator-target associations from expression measurements. GRNBoost2 fits stochastic gradient boosting regressions; GENIE3 fits random forests. Each target is predicted from candidate regulators, excluding itself. These are observational predictive associations, not proof of direct binding, activation/repression, or causal regulation.
The latest PyPI release checked is 0.1.6 (2021-02-09). Read the Docs still labels its documentation 0.1.5; the current GitHub source contains fixes that are not in the PyPI wheel. Do not assume a successful unpinned installation can run inference. See compatibility and distribution details.
Installation and compatibility
The following exact stack passed dense and CSC-sparse GRNBoost2, dense GENIE3, custom GBM/RF, and wrapper smoke tests on macOS arm64 with Python 3.11.11:
uv venv --python 3.11 .venv-arboreto
uv pip install --python .venv-arboreto/bin/python \
'arboreto==0.1.6' 'dask[complete]==2024.7.1' 'distributed==2024.7.1' \
'numpy==1.26.4' 'pandas==2.2.3' 'scikit-learn==1.5.2' 'scipy==1.13.1'
This is a bounded compatibility recipe, not a claim that current releases of all
dependencies work. PyPI Arboreto builds an empty metadata graph that the newer
Dask dataframe implementation rejects. For this pinned Dask version, select its
legacy dataframe backend before importing Arboreto or dask.dataframe:
import dask
dask.config.set({"dataframe.query-planning": False})
from arboreto.algo import grnboost2, genie3
The bundled wrapper does this for Dask 2024.7.1. Restart an existing notebook
kernel if it has already imported the newer dataframe backend. Sparse targets
also use .A inside Arboreto 0.1.6; this attribute was removed in SciPy 1.14.
Keep the tested SciPy pin for sparse inference. No monkeypatch to site-packages
is required by this recipe.
Workflow
- Select biologically comparable cells/samples; document normalization, filtering, batch handling, organism, identifier namespace, and expression layer.
- Prepare rows = observations, columns = genes. Exclude sample IDs from expression values. Require unique gene names, numeric finite values, and a TF list with a nonempty overlap. All-zero/constant genes provide no useful targets.
- Choose GRNBoost2 for an efficient starting analysis, GENIE3 for method comparison,
or
diyfor explicit regressor settings. See algorithms. - Run a small subset first in the pinned environment, then scale worker counts to
available memory. Keep the
if __name__ == "__main__":guard in process-based scripts. - Inspect worker warnings and target coverage, save the full ranked network, and assess stability across seeds and resampled observations before prioritizing edges.
Run the bundled wrapper
From this skill directory, with a TSV containing gene headers and numeric rows:
.venv-arboreto/bin/python scripts/basic_grn_inference.py expression_data.tsv network.tsv \
--tf-file tfs.txt --seed 777 --workers 2 --limit 5000
Add --index-col 0 only if the first column contains cell/sample identifiers.
The wrapper rejects duplicate headers before pandas can rename them, nonnumeric
or nonfinite values, empty TF overlap, invalid limits, and wholly empty results.
It reports TF overlap and uses a fresh bounded Dask client that closes on error.
The default is one worker; increase it after a successful pilot. Without a TF
file, all genes are candidate regulators, even though the output column is
named TF.
Output is a headerless TSV in TF, target, importance order. For downstream
consumers that require column headers (including pySCENIC adjacency loading),
write a separate copy with header=True rather than assuming every tool accepts
the headerless upstream example format.
Minimal Python example
This synthetic example checks execution and output structure; it is not a biological benchmark. The same calls were tested with a 32-observation, four-gene fixture.
import dask
dask.config.set({"dataframe.query-planning": False})
import numpy as np
import pandas as pd
from arboreto.algo import grnboost2
from distributed import Client, LocalCluster
if __name__ == "__main__":
rng = np.random.default_rng(123)
values = rng.normal(size=(32, 4))
values[:, 2] = 3 * values[:, 0] + rng.normal(scale=0.1, size=32)
…
常见问题
“调控因子”和“靶基因”是什么?
调控因子是能够控制其他基因表达的基因。靶基因是表达受到控制的基因。
生成的列表能证明一个基因控制另一个基因吗?
不能。该列表只显示基于数据的预测性关联,它提示了可能的联系,但不能证明因果关系或直接结合。
GRNBoost2 和 GENIE3 有什么区别?
这是工具可以选用的两种不同算法。GRNBoost2 使用“梯度提升”,GENIE3 使用“随机森林”。它们的结果可能略有不同,可以用来互相比较。
详情
作者的原始描述
Infers candidate gene regulatory networks from bulk or single-cell expression data using AertsLab Arboreto GRNBoost2 and GENIE3. Use for transcription factor-target association ranking, compatible Dask execution, sparse expression inputs, and network stability checks.
热度
- GitHub 星标
- 51k
- 排名
- #3426
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …