set_context {geneTree} R Documentation

Inject an expression state context into the model, the context becomes the

Description

starting state as well as the differential analysis baseline of the following<br /> in silico perturbation experiments.

Usage

set_context(tree, genes, expression,
    fix = FALSE,
    align = TRUE);

Arguments

tree

the trained XGBoostGRN model object. [as XGBoostGRN]

genes

a character vector of the gene id of the context; the ids must live in the same identifier space as the expression matrix that the model was trained on.

expression

a numeric vector of the expression value of the context, in the same order as genes; the values may come from a different normalisation pipeline, they are mapped onto the model scale by the quantile alignment below.

fix

when TRUE the context genes are clamped to the given values during the whole iteration(a gene knock-in like experiment); otherwise they are only used as the starting point and will be updated by the network like the other genes.

clamping only makes sense for a small gene set: when the clamped gene number exceeds MaxClampRatio(5% by default) of the network, the whole network would lose its degrees of freedom and the perturbation effect would vanish, so the library degrades the context to "starting state only" automatically and reports a warning here. [as boolean]

align

whether to run the quantile alignment of the context onto the model expression scale, default is TRUE: the context values are mapped onto the per gene distribution of the model population, so that the relative order of the genes is kept and no feature falls outside of the training range of its tree model. [as boolean]

env

the R# runtime environment object. [as Environment]

Details

genes that are not described in the context keep their own wildtype value, so a context is allowed to cover only a subset of the network.

Authors

biosystem

Value

the input model object that the context has been applied, so that it can be chained with knockouts / overexpress / knockdown; an R# error message object is returned when the sizes of the two vectors do not match or no gene of the context could be mapped onto the model.

clr value class

Examples


[Package geneTree version 1.0.0.0 Index]