| discovery {geneTree} |
R Documentation |
Enable the residual two-stage structure discovery on a GeneTree configuration.
Description
Usage
discovery(config, candidates,
max.per.gene = 2,
max.candidates = 5,
min.correlation = 0.1,
min.delta.r2 = 0.002,
sample.size = 1000,
max.genes = 0);
Arguments
config
the configuration object created by the make_profile api (it is modified in place and returned, so it can be chained). [as GeneTreeConfig]
candidates
a character vector of the candidate regulator gene id; the discovery only searches inside this set, it never guesses the candidate space by itself.
to make a non-transcription-factor perturbation target able to propagate to its downstream genes, the target gene itself must be included in this candidate set.
max.per.gene
the maximum number of the new edges that could be accepted for each target gene, default is 2. [as integer]
max.candidates
the maximum number of the candidates that are tried for each target gene (each try costs one more model fitting), default is 5. [as integer]
min.correlation
the minimal |pearson r| between the target gene residual and the candidate gene expression, default is 0.1. [as double]
min.delta.r2
the minimal validation R² gain that is required for accepting one new edge, default is 0.002. [as double]
sample.size
the number of the cells that are used by the residual correlation screening, default is 1000, 0 uses all of the training cells. [as integer]
max.genes
only the first n target genes run the discovery, 0 means all of them (useful for a quick trial). [as integer]
env
the R# runtime environment object. [as Environment]
Details
The discovery runs in two stages:
- only the ARACNE edges are used to fit the target gene model, and the residual
(label - prediction) is computed;
- the candidates are ranked by the correlation with the residual, then they are added
into the feature set one by one; a candidate is accepted as a new regulation edge only when the validation R² gain is above min_delta_r2 and the feature is actually used by the trees.
the ARACNE edges are always kept, the accepted edges are appended after them, so the topology of a discovery model is still comparable with the previous models.
Authors
biosystem
Value
the input configuration object with EdgeDiscovery = ResidualTwoStage; an R# error message object is returned when the candidate set is empty or the resulting configuration is invalid.
clr value class
Examples
imports ["geneTree"] from "biosystem";
let tfs = read.csv("./tfs.csv");
let opts = geneTree::make_profile("fast", population = 100, max_regulators = 10)
|> geneTree::discovery(tfs$gene_id, max_per_gene = 2);
let grn = geneTree::new(aracne, expr, opts) |> fit_tree();
geneTree::discovered_edges(grn, top_n = 100) |> print();
[Package
geneTree version 1.0.0.0
Index]