arboreto
БесплатноЗапускает вложенные скриптыНе проверенGene regulatory network inference with GRNBoost2/GENIE3 algorithms. Infer TF-target relationships from expression data, scalable with Dask, for scRNA-seq and…
Об этом скилле
Arboreto - Gene Regulatory Network Inference
Overview
Arboreto is a Python library for inferring gene regulatory networks (GRNs) from gene expression data using machine learning algorithms. It enables scalable GRN inference from single machines to multi-node clusters using Dask for distributed computing. The skill provides comprehensive support for both GRNBoost2 (fast gradient boosting) and GENIE3 (Random Forest) algorithms.
When to Use This Skill
This skill should be used when:
- Inferring regulatory relationships between genes from expression data
- Analyzing single-cell or bulk RNA-seq data to identify transcription factor targets
- Building the GRN inference component of a pySCENIC pipeline
- Comparing GRNBoost2 and GENIE3 algorithm performance
- Setting up distributed computing for large-scale genomic analyses
- Troubleshooting arboreto installation or runtime issues
Core Capabilities
1. Basic GRN Inference
For standard gene regulatory network inference tasks:
Key considerations:
- Expression data format: Rows = observations (cells/samples), Columns = genes
- If data has genes as rows, transpose it first:
expression_df.T - Always include
seedparameter for reproducible results - Transcription factor list is optional but recommended for focused analysis
Typical workflow:
import pandas as pd
from arboreto.algo import grnboost2
from arboreto.utils import load_tf_names
# Load expression data (ensure correct orientation)
expression_data = pd.read_csv('expression_data.tsv', sep='\t', index_col=0)
# Optional: Load TF names
tf_names = load_tf_names('transcription_factors.txt')
# Run inference
network = grnboost2(
expression_data=expression_data,
tf_names=tf_names,
seed=42 # For reproducibility
)
# Save results
network.to_csv('network_output.tsv', sep='\t', index=False)
Output format:
- DataFrame with columns:
['TF', 'target', 'importance'] - Higher importance scores indicate stronger predicted regulatory relationships
- Typically sorted by importance (descending)
Multiprocessing requirement:
All arboreto code must include if __name__ == '__main__': protection due to Dask's multiprocessing requirements:
if __name__ == '__main__':
# Arboreto code goes here
network = grnboost2(expression_data=expr_data, seed=42)
2. Algorithm Selection
GRNBoost2 (Recommended for most cases):
- ~10-100x faster than GENIE3
- Uses stochastic gradient boosting with early-stopping
- Best for: Large datasets (>10k observations), time-sensitive analyses
- Function:
arboreto.algo.grnboost2()
GENIE3:
- Uses Random Forest regression
- More established, classical approach
- Best for: Small datasets, methodological comparisons, reproducing published results
- Function:
arboreto.algo.genie3()
When to compare both algorithms:
Use the provided compare_algorithms.py script when:
- Validating results for critical analyses
- Benchmarking performance on new datasets
- Publishing research requiring methodological comparisons
3. Distributed Computing
Local execution (default): Arboreto automatically creates a local Dask client. No configuration needed:
network = grnboost2(expression_data=expr_data)
Custom local cluster (recommended for better control):
from dask.distributed import Client, LocalCluster
# Configure cluster
cluster = LocalCluster(
n_workers=4,
threads_per_worker=2,
memory_limit='4GB',
diagnostics_port=8787 # Dashboard at http://localhost:8787
)
client = Client(cluster)
# Run inference
network = grnboost2(
expression_data=expr_data,
client_or_address=client
)
# Clean up
client.close()
cluster.close()
Distributed cluster (multi-node): On scheduler node:
dask-scheduler --no-bokeh
On worker nodes:
dask-worker scheduler-address:8786 --local-dir /tmp
In Python:
from dask.distributed import Client
client = Client('scheduler-address:8786')
network = grnboost2(expression_data=expr_data, client_or_address=client)
4. Data Preparation
Common data format issues:
- Transposed data (genes as rows instead of columns):
# If genes are rows, transpose
expression_data = pd.read_csv('data.tsv', sep='\t', index_col=0).T
- Missing gene names:
# Provide gene names if using numpy array
network = grnboost2(
expression_data=expr_array,
gene_names=['Gene1', 'Gene2', 'Gene3', ...],
seed=42
)
- Transcription factor specification:
# Option 1: Python list
tf_names = ['Sox2', 'Oct4', 'Nanog', 'Klf4']
# Option 2: Load from file (one TF per line)
from arboreto.utils import load_tf_names
tf_names = load_tf_names('tf_names.txt')
5. Reproducibility
Always specify a seed for consistent results:
network = grnboost2(expression_data=expr_data, seed=42)
Without a seed, results will vary between runs due to algorithm randomness.
6
Установить arboreto в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл arboreto?
Gene regulatory network inference with GRNBoost2/GENIE3 algorithms. Infer TF-target relationships from expression data, scalable with Dask, for scRNA-seq and GRN analysis.
Как установить скилл arboreto?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл arboreto запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic