jaechang-hits/sciagent-skills/arboreto-grn-inference
Claude Code and agent skill by jaechang-hits/sciagent-skills
- community
Checking that the SKILL.md file is still in the repository.
GRN inference from expression via GRNBoost2 (gradient boosting) or GENIE3 (Random Forest). Load matrix, filter by TFs, infer TF-target-importance links, save network. Dask-parallelized to single-cell scale. Core SCENIC component.
Install
npx vskill@latest install jaechang-hits/sciagent-skills/arboreto-grn-inferenceSKILL.md
The same SKILL.md was published earlier as jaechang-hits/sciagent-skills/arboreto-grn-inference.
Arboreto GRN Inference
Overview
Arboreto infers gene regulatory networks (GRNs) from gene expression data using parallelized tree-based regression. For each target gene, it trains a regression model with all other genes (or a specified TF list) as features and emits TF-target-importance triplets. It provides two interchangeable algorithms -- GRNBoost2 (gradient boosting, fast) and GENIE3 (Random Forest, classic) -- sharing identical input/output formats. Computation is Dask-parallelized, scaling from laptop cores to HPC clusters.
When to Use
- Inferring transcription factor-to-target gene regulatory relationships from bulk RNA-seq expression data
- Building gene regulatory networks from single-cell RNA-seq count matrices (cells as rows, genes as columns)
- Generating the adjacency matrix (Step 1) of the pySCENIC regulatory analysis pipeline
- Comparing regulatory network structure across experimental conditions (e.g., control vs treatment)
- Producing consensus regulatory networks by running inference across multiple random seeds
- Validating GRN results by comparing GRNBoost2 and GENIE3 outputs on the same dataset
- For downstream regulon identification and activity scoring, use arboreto output with pySCENIC
- For single-cell preprocessing (QC, normalization, clustering) before GRN inference, use scanpy-scrna-seq
Prerequisites
- Python packages:
arboreto,pandas,numpy,dask,distributed,scikit-learn,scipy - Data requirements: Gene expression matrix (genes as columns, observations as rows) in TSV/CSV; optionally a TF list file (one gene name per line)
- Environment: Python 3.8+; optional
networkx,matplotlibfor visualization
Pre-flight Interview
Settle these with the user before writing any analysis code.
D3 is the decision that separates a usable network from a hairball. Leaving regulators unrestricted lets any correlated gene appear as a regulator, and the result still returns a fully populated ranked table. D4 has no safe default: the algorithm scores all pairs, so where the list is cut is the user's call about the network they intend to interpret.
Quick Start
Complete GRN inference in a single block. The if __name__ == '__main__': guard is required because Dask spawns worker processes via multiprocessing.
Workflow
Step 1: Load Expression Data
Arboreto accepts a pandas DataFrame (recommended) or NumPy array. Rows are observations (cells or samples), columns are genes. Gene names must be column headers.
Step 2: Load Transcription Factor List
Providing a TF list restricts regulators to known transcription factors, reducing computation time and improving biological relevance. If omitted, all genes are treated as potential regulators.
Step 3: Configure Dask Client (Optional)
By default arboreto creates an internal Dask client using all local cores. Create an explicit client for resource control, monitoring, or cluster deployment.
Step 4: Run GRN Inference
Call grnboost2() (recommended) or genie3(). Both share the same signature and output format.
Step 5: Filter Results
Raw output contains links for every TF-target pair with non-zero importance. Filter to retain high-confidence regulatory interactions.
Step 6: Save Network
Save as a TSV file with three columns: TF, target, importance.
Step 7: Visualize Results (Optional)
Plot the top regulatory interactions as a directed network graph.
Key Parameters
| Parameter | Default | Range / Options | Effect | |
|---|---|---|---|---|
expression_data | (required) | DataFrame or ndarray | Expression matrix, observations x genes | |
tf_names | 'all' | list of str or 'all' | Restrict regulators to known TFs; 'all' uses every gene | |
gene_names | None | list of str | Required when expression_data is a NumPy array | |
client_or_address | 'local' | Client, str, or 'local' | Dask client instance or scheduler address | |
seed | None | int | Random seed for reproducibility; always set for replicable results | |
verbose | False | bool | Print progress messages during inference |
Key Concepts
Algorithm Selection Guide
Both algorithms follow the same multiple-regression strategy (train one model per target gene, extract feature importances) but differ in the underlying regressor.
| Feature | GRNBoost2 | GENIE3 | |
|---|---|---|---|
| Method | Stochastic gradient boosting with early stopping | Random Forest (or ExtraTrees) | |
| Speed | Fast -- optimized for large datasets | Slower -- higher per-model cost | |
| Memory | Lower (early stopping limits tree depth) | Higher (full forests per target) | |
| Best for | Default choice; 10k+ observations, single-cell scale | Comparison with published GENIE3 results; validation | |
| Import | from arboreto.algo import grnboost2 | from arboreto.algo import genie3 | |
| Output format | TF, target, importance (identical) | TF, target, importance (identical) |
Decision rule: Start with GRNBoost2. Use GENIE3 only when reproducing published GENIE3 analyses or as an independent validation of GRNBoost2 results.
Output Format
The network DataFrame has three columns, sorted by descending importance:
| Column | Type | Description | |
|---|---|---|---|
TF | str | Transcription factor (regulator) gene name | |
target | str | Target gene name | |
importance | float | Regulatory importance score (higher = stronger predicted regulation) |
Importance scores are not p-values. They represent feature importance from the tree-based model. Filter by absolute threshold or top-N per target for downstream analysis.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/genomics-bioinformatics/arboreto-grn-inference/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jaechang-hits/sciagent-skills/arboreto-grn-inference)