Skill Tracer
Skills › Scientific Agent Skills › arboreto

arboreto

skill · 203 lines · BSD-3-Clause license · skills/arboreto/SKILL.md

The facts

Its description

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.

The description the agent reads to decide when to use it.

From its settingsline 3

Runs scripts

bin/python, scripts/basic_grn_inference.py

Scripts the text names. Found by matching words, so treat them as pointers.

Found by matching wordsline 34 line 75

Files it mentions

references/distributed_computing.md, references/algorithms.md, references/basic_inference.md

Files the text names, such as ones to read or write. Found by matching words, so treat them as pointers.

Found by matching wordsline 25 line 64 line 121

Licence

BSD-3-Clause license, from the skill file

The terms its author shares it under, which let it be shown here.

From its settingsline 4 licence text

Other settings

compatibility: Requires the isolated Python 3.11 compatibility stack below, including Arboreto, Dask/distributed, NumPy, pandas, scikit-learn and SciPy. Network access is needed for installation, not local inference. No credentials required. metadata: version: "1.3" skill-author: K-Dense Inc. last-reviewed: "2026-09-30"

More settings at the top of the file, shown as written.

From its settingsline 5 line 6
Other files in this skill (4) Close

The text

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1---
2name: arboreto
3description: 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.
4license: BSD-3-Clause license
5compatibility: Requires the isolated Python 3.11 compatibility stack below, including Arboreto, Dask/distributed, NumPy, pandas, scikit-learn and SciPy. Network access is needed for installation, not local inference. No credentials required.
6metadata:
7 version: "1.3"
8 skill-author: K-Dense Inc.
9 last-reviewed: "2026-09-30"
10---
12# Arboreto
14## When to use
16Use Arboreto to rank candidate regulator-target associations from expression
17measurements. GRNBoost2 fits stochastic gradient boosting regressions; GENIE3
18fits random forests. Each target is predicted from candidate regulators, excluding
19itself. These are observational predictive associations, not proof of direct
20binding, activation/repression, or causal regulation.
22The latest PyPI release checked is **0.1.6** (2021-02-09). Read the Docs still
23labels its documentation 0.1.5; the current GitHub source contains fixes that are
24**not in the PyPI wheel**. Do not assume a successful unpinned installation can
25run inference. See [compatibility and distribution details](references/distributed_computing.md).

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.

Raw lines 14 to 26
27## Installation and compatibility
29The following exact stack passed dense and CSC-sparse GRNBoost2, dense GENIE3,
30custom GBM/RF, and wrapper smoke tests on macOS arm64 with Python 3.11.11:
32```bash
33uv venv --python 3.11 .venv-arboreto
34uv pip install --python .venv-arboreto/bin/python \
35 'arboreto==0.1.6' 'dask[complete]==2024.7.1' 'distributed==2024.7.1' \
36 'numpy==1.26.4' 'pandas==2.2.3' 'scikit-learn==1.5.2' 'scipy==1.13.1'
37```
39This is a bounded compatibility recipe, not a claim that current releases of all
40dependencies work. PyPI Arboreto builds an empty metadata graph that the newer
41Dask dataframe implementation rejects. For this pinned Dask version, select its
42legacy dataframe backend **before importing Arboreto or `dask.dataframe`**:
44```python
45import dask
46dask.config.set({"dataframe.query-planning": False})
47from arboreto.algo import grnboost2, genie3
48```
50The bundled wrapper does this for Dask 2024.7.1. Restart an existing notebook
51kernel if it has already imported the newer dataframe backend. Sparse targets
52also use `.A` inside Arboreto 0.1.6; this attribute was removed in SciPy 1.14.
53Keep the tested SciPy pin for sparse inference. No monkeypatch to site-packages
54is required by this recipe.

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.

Raw lines 27 to 55
Runs code bin/python :34
56## Workflow
581. Select biologically comparable cells/samples; document normalization, filtering,
59 batch handling, organism, identifier namespace, and expression layer.
602. Prepare **rows = observations, columns = genes**. Exclude sample IDs from
61 expression values. Require unique gene names, numeric finite values, and a TF
62 list with a nonempty overlap. All-zero/constant genes provide no useful targets.
633. Choose GRNBoost2 for an efficient starting analysis, GENIE3 for method comparison,
64 or `diy` for explicit regressor settings. See [algorithms](references/algorithms.md).
654. Run a small subset first in the pinned environment, then scale worker counts to
66 available memory. Keep the `if __name__ == "__main__":` guard in process-based scripts.
675. Inspect worker warnings and target coverage, save the full ranked network, and
68 assess stability across seeds and resampled observations before prioritizing edges.

Workflow

  1. Select biologically comparable cells/samples; document normalization, filtering, batch handling, organism, identifier namespace, and expression layer.
  2. 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.
  3. Choose GRNBoost2 for an efficient starting analysis, GENIE3 for method comparison, or diy for explicit regressor settings. See algorithms.
  4. 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.
  5. Inspect worker warnings and target coverage, save the full ranked network, and assess stability across seeds and resampled observations before prioritizing edges.
Raw lines 56 to 69
Reads a file references/algorithms.md :64
70## Run the bundled wrapper
72From this skill directory, with a TSV containing gene headers and numeric rows:
74```bash
75.venv-arboreto/bin/python scripts/basic_grn_inference.py expression_data.tsv network.tsv \
76 --tf-file tfs.txt --seed 777 --workers 2 --limit 5000
77```
79Add `--index-col 0` only if the first column contains cell/sample identifiers.
80The wrapper rejects duplicate headers before pandas can rename them, nonnumeric
81or nonfinite values, empty TF overlap, invalid limits, and wholly empty results.
82It reports TF overlap and uses a fresh bounded Dask client that closes on error.
83The default is one worker; increase it after a successful pilot. Without a TF
84file, **all genes** are candidate regulators, even though the output column is
85named `TF`.
87Output is a headerless TSV in `TF`, `target`, `importance` order. For downstream
88consumers that require column headers (including pySCENIC adjacency loading),
89write a separate copy with `header=True` rather than assuming every tool accepts
90the headerless upstream example format.

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.

Raw lines 70 to 91
Runs code bin/python :75
Runs code scripts/basic_grn_inference.py :75
92## Minimal Python example
94This synthetic example checks execution and output structure; it is not a
95biological benchmark. The same calls were tested with a 32-observation,
96four-gene fixture.
98```python
99import dask
100dask.config.set({"dataframe.query-planning": False})
101import numpy as np
102import pandas as pd
103from arboreto.algo import grnboost2
104from distributed import Client, LocalCluster
106if __name__ == "__main__":
107 rng = np.random.default_rng(123)
108 values = rng.normal(size=(32, 4))
109 values[:, 2] = 3 * values[:, 0] + rng.normal(scale=0.1, size=32)
110 matrix = pd.DataFrame(values, columns=["TF1", "TF2", "G1", "G2"])
111 with LocalCluster(n_workers=1, threads_per_worker=1,
112 dashboard_address=None) as cluster, Client(cluster) as client:
113 network = grnboost2(expression_data=matrix, tf_names=["TF1", "TF2"],
114 seed=777, client_or_address=client)
115 assert not network.empty
116 assert not (network["TF"] == network["target"]).any()
117 network.to_csv("network.tsv", sep="\t", index=False, header=False)
118```
120For real DataFrame, ndarray, CSC, and AnnData input conventions, read

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)
    matrix = pd.DataFrame(values, columns=["TF1", "TF2", "G1", "G2"])
    with LocalCluster(n_workers=1, threads_per_worker=1,
                      dashboard_address=None) as cluster, Client(cluster) as client:
        network = grnboost2(expression_data=matrix, tf_names=["TF1", "TF2"],
                            seed=777, client_or_address=client)
    assert not network.empty
    assert not (network["TF"] == network["target"]).any()
    network.to_csv("network.tsv", sep="\t", index=False, header=False)

For real DataFrame, ndarray, CSC, and AnnData input conventions, read basic inference.

Raw lines 92 to 122
123## Interpret and validate output
125| Column | Meaning |
126| --- | --- |
127| `TF` | Candidate predictor gene, restricted only if a TF list was supplied |
128| `target` | Gene whose expression was predicted |
129| `importance` | Nonnegative feature importance used to rank candidate links |
131Results are sorted by decreasing importance; zero-importance links are omitted.
132GRNBoost2 rescales feature importance by the fitted number of trees, so its
133scores can exceed 1 and are not on the same scale as GENIE3. There is no universal
134`importance > 0.5` confidence cutoff. `limit=N` keeps the top N links globally;
135it does not limit target regressions or return N links per target.
137For consensus, define a per-run selection rule first, then count the fraction of
138**all runs** retaining each TF-target pair. An edge missing from a run is not an
139observed score to average only over present rows. Archive individual networks,
140seeds, package versions, filters, and identifier lists. Match preprocessing,
141sample sizes and gene sets across conditions; differences in scores alone do not
142establish differential regulation. Use independent motif, binding or perturbation
143evidence to assess candidates. Agreement between GRNBoost2 and GENIE3 is method
144sensitivity analysis, not independent biological validation.
146Upstream retries target-level regression failures and can return empty target
147results after warnings. A nonempty overall network does not prove every target
148fit succeeded. Check logs and expected target coverage; absence of an edge may
149reflect zero importance, filtering, missing predictors, or a failed regression.

Interpret and validate output

ColumnMeaning
TFCandidate predictor gene, restricted only if a TF list was supplied
targetGene whose expression was predicted
importanceNonnegative feature importance used to rank candidate links

Results are sorted by decreasing importance; zero-importance links are omitted. GRNBoost2 rescales feature importance by the fitted number of trees, so its scores can exceed 1 and are not on the same scale as GENIE3. There is no universal importance > 0.5 confidence cutoff. limit=N keeps the top N links globally; it does not limit target regressions or return N links per target.

For consensus, define a per-run selection rule first, then count the fraction of all runs retaining each TF-target pair. An edge missing from a run is not an observed score to average only over present rows. Archive individual networks, seeds, package versions, filters, and identifier lists. Match preprocessing, sample sizes and gene sets across conditions; differences in scores alone do not establish differential regulation. Use independent motif, binding or perturbation evidence to assess candidates. Agreement between GRNBoost2 and GENIE3 is method sensitivity analysis, not independent biological validation.

Upstream retries target-level regression failures and can return empty target results after warnings. A nonempty overall network does not prove every target fit succeeded. Check logs and expected target coverage; absence of an edge may reflect zero importance, filtering, missing predictors, or a failed regression.

Raw lines 123 to 150
151## pySCENIC boundary
153Arboreto supplies the adjacency inference stage; motif pruning/regulon definition
154and AUCell are separate downstream steps. pySCENIC supplies the separate
155`arboreto_with_multiprocessing.py` utility to run inference without Dask. Do not
156assume `pyscenic grn` automatically uses that utility: the reviewed CLI still
157calls Arboreto with a Dask client. Its `custom_multiprocessing` default concerns
158`ctx` pruning. Downstream pySCENIC execution was not tested in this refresh.

pySCENIC boundary

Arboreto supplies the adjacency inference stage; motif pruning/regulon definition and AUCell are separate downstream steps. pySCENIC supplies the separate arboreto_with_multiprocessing.py utility to run inference without Dask. Do not assume pyscenic grn automatically uses that utility: the reviewed CLI still calls Arboreto with a Dask client. Its custom_multiprocessing default concerns ctx pruning. Downstream pySCENIC execution was not tested in this refresh.

Raw lines 151 to 159
160## Troubleshooting
162- **`Must supply at least one delayed object`**: check the installed release and
163 Dask backend first; this can be PyPI 0.1.6's empty metadata graph even with valid input.
164- **Sparse `.A` error or repeated empty targets**: use the tested SciPy pin and
165 `scipy.sparse.csc_matrix`, not a newer sparse array type.
166- **Import error with very old Dask**: Dask 2023.12.1 failed on Python 3.11.11's
167 `inspect` behavior during review; do not mix arbitrary old and new components.
168- **Cancelled futures on repeat runs**: use a fresh client/cluster per run when
169 reusing scattered inputs triggers this error; a repeated in-process client
170 probe hit it during review, while separate process clients passed.
171- **Memory pressure**: reduce worker count, restrict regulators, and estimate
172 dense matrix plus per-worker TF copies before scaling. A cluster does not make
173 the client-side expression matrix out-of-core.

Troubleshooting

  • **Must supply at least one delayed object**: check the installed release and Dask backend first; this can be PyPI 0.1.6's empty metadata graph even with valid input.
  • **Sparse .A error or repeated empty targets**: use the tested SciPy pin and scipy.sparse.csc_matrix, not a newer sparse array type.
  • Import error with very old Dask: Dask 2023.12.1 failed on Python 3.11.11's inspect behavior during review; do not mix arbitrary old and new components.
  • Cancelled futures on repeat runs: use a fresh client/cluster per run when reusing scattered inputs triggers this error; a repeated in-process client probe hit it during review, while separate process clients passed.
  • Memory pressure: reduce worker count, restrict regulators, and estimate dense matrix plus per-worker TF copies before scaling. A cluster does not make the client-side expression matrix out-of-core.
Raw lines 160 to 174
175## Sources and review scope
177Reviewed 2026-09-30: [PyPI release](https://pypi.org/project/arboreto/0.1.6/),
178[official guide](https://arboreto.readthedocs.io/en/latest/userguide.html),
179[algorithm source](https://github.com/aertslab/arboreto/blob/master/arboreto/algo.py),
180[core source](https://github.com/aertslab/arboreto/blob/master/arboreto/core.py),
181[Dask 2024.7.1 backend selection](https://github.com/dask/dask/blob/2024.7.1/dask/dataframe/__init__.py),
182[SciPy 1.14 removals](https://docs.scipy.org/doc/scipy/release/1.14.0-notes.html), and
183[pySCENIC CLI](https://github.com/aertslab/pySCENIC/blob/master/src/pyscenic/cli/pyscenic.py).
184Local synthetic runs verify mechanics only. Remote scheduling, large biological
185datasets, Windows/Linux, and pySCENIC downstream analysis remain untested.
186There are no hosted service endpoints, authentication, or pagination in this skill.

Sources and review scope

Reviewed 2026-09-30: PyPI release, official guide, algorithm source, core source, Dask 2024.7.1 backend selection, SciPy 1.14 removals, and pySCENIC CLI. Local synthetic runs verify mechanics only. Remote scheduling, large biological datasets, Windows/Linux, and pySCENIC downstream analysis remain untested. There are no hosted service endpoints, authentication, or pagination in this skill.

Raw lines 175 to 187
Boilerplate, lines 188 to 203. The same text appears in 125 other files here. Close
188## Citing Scientific Agent Skills
190This skill is part of Scientific Agent Skills by K-Dense. If it materially contributed to a
191manuscript, report, presentation, or code release, add the paper to the references or
192software section and tell the user you did so:
194> Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent
195> Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065.
196> https://doi.org/10.48550/arXiv.2609.00065
198Always cite the current version. The DOI and https://arxiv.org/abs/2609.00065 resolve to the
199latest arXiv version, so never append a version suffix such as `v1`. When network access is
200available, fetch https://arxiv.org/abs/2609.00065 (or
201http://export.arxiv.org/api/query?id_list=2609.00065) before writing the reference and take
202the author list, year, and version from that record. If the record lists a journal reference
203or publisher DOI, cite the published version instead.

From K-Dense-AI/scientific-agent-skills at 5f2bc03, 2026-10-26. Not read by a model yet. Summary and techniques by Claude Opus 5.5 on 2026-11-06.