{geneTree} R# Documentation

geneTree


require(GCModeller);

#' XGBoost based gene regulatory network simulator and the in silico perturbation toolkit
imports "geneTree" from "biosystem";

XGBoost based gene regulatory network simulator and the in silico perturbation toolkit

This package module is the R# front end of the GeneTree model: the ARACNE inferred mutual information network is turned into a non linear dynamical system by fitting one gradient boosting tree regressor per target gene (x_i = f_i(X_Reg(i))), and the virtual perturbation experiment is then performed by solving the fixed point of the fitted system with the damped iteration x_i^new = (1 - alpha) * x_i^old + alpha * f_i(X_Reg(i)^old).

The typical workflow:

 imports ["geneTree", "bnlearn"] from "biosystem";
 
 let opts = geneTree::make_profile("fast", population = 100);
 let grn = geneTree::new(aracne, expr, opts) |> fit_tree();
 
 # 相对训练时的野生型基线做虚拟敲除
 let ko = grn |> knockouts(c("TP53", "MYC"));
 
 # 切换到指定的表达状态上下文之后再扰动(fix = TRUE 时上下文基因被钳制)
 let state = grn |> geneTree::steady_state();
 let perturbed = grn
     |> geneTree::set_context(c("TP53"), c(0.0), fix = TRUE)
     |> knockouts(c("EGFR"))
 ;
 

The fitted XGBoostGRN object implements the InsilicoPerturbationExperiment interface, so the generic knockouts / overexpress / knockdown / make_exports api of the bnlearn package module can be used directly on it.

.NET clr type export
xgboost_grn: XGBoostGRN

基于 XGBoost 的非线性基因调控网络虚拟扰动实验(门面类)。

把 readme 中的三段流程串起来:

  1. 拓扑:由 aracne.zip 得到 GeneRegulationGraph(靶基因 → 调控因子);
  2. 拟合:用原始表达矩阵训练 N 个梯度提升树模型 f_i(X_Reg(i));
  3. 扰动:阻尼定点迭代求解扰动之后的新稳态,返回 InterventionResult。

典型用法:

 Dim grn = XGBoostGRN.Open("./aracne.zip", "./GRN_expression_matrix.csv")
 
 Call grn.Fit()
 
 Dim ko = grn.KnockoutGene("TP53")
 Dim oe = grn.OverexpressGene("MYC")
 

本类实现了 InsilicoPerturbationExperiment 接口, 因此可以与 GEARS、BNLearn 之中已有的虚拟扰动实现互换使用。

geneTree_opts: GeneTreeConfig

GeneTree(XGBoost 非线性基因调控网络)的全量超参数配置。

配置分成四组:

geneTree_report: TrainingReport

逐基因拟合的训练报告:既可以在控制台打印摘要,也可以写成两张可读的表格文件 (report.tsv 与 importance.tsv),用于人工核查调控网络是否合理。

geneTree_graph: GeneRegulationGraph

ARACNE 网络拓扑在 GeneTree 中的表示:靶基因 → 调控因子集合。

与 AracneNetwork 的区别在于:

  • 不保存互信息矩阵与表达向量,内存占用只与边数有关;
  • 可以直接从 aracne.zip 的 genes.tsv / tfs.txt / edges.csv 三个条目重建, 因此不需要读取 4.5GB 的 expression.bin;
  • 每个靶基因的调控因子已经按照互信息降序裁剪到 top-K,可以直接作为回归特征。


.NET clr function exports
make_profile

Create the training/solving configuration profile of the GeneTree model.

parallel_opts

Override the parallelism of a trained model (the perturbation solver) or of a configuration object (the model training).

discovery

Enable the residual two-stage structure discovery on a GeneTree configuration.

load_topology

Build the regulation graph model from the ARACNE inferred network.

load_expression

Attach the gene expression matrix to the regulation graph, the created model is not trained yet.

new

Create the GeneTree model from the ARACNE network and the gene expression matrix.

fit_tree

Train the gradient boosting tree models of each target gene.

write_report

Export the training report as two readable table files.

training_stats

Get the summary statistics of the model training.

discovered_edges

Get the candidate edges that were examined by the residual two-stage structure discovery.

report_table

Get the per gene fitting quality table of the trained model.

feature_importance

Get the split importance of the regulators, this table is the data driven "sign and weight" of the ARACNE network edges.

gene_stats

Get the gene alignment and the wildtype baseline of the model.

gene_names

Get the gene ids of the model.

set_context

Inject an expression state context into the model, the context becomes the starting state as well as the differential analysis baseline of the following in silico perturbation experiments.

solve_control
solver_opts

Override the fixed point solving options of a trained model at runtime, so that the solver can be tuned without re-training the whole network.

reset_context

Remove the expression state context, the model is restored back to the wildtype baseline that was estimated during the model training.

get_context

Get the expression state context that is currently applied on the model.

steady_state

Solve the control steady state of the network, i.e. the "attractor" of the fitted dynamical system when no intervention is applied.

solver_history

Get the diagnostics of the last fixed point solving.

perturb

Set the expression value of a set of genes to the given values, i.e. run a Custom mode in silico intervention.

perturb_combined

Run a combined in silico intervention on a set of genes at the same time.


[Document Index]