build_grn {WGCNA} R Documentation

build the GRN prior network from the expression matrix or the cached bicor correlation store.

Description

Usage

build_grn(x, TF, opts,
    bicor = NULL,
    modules = NULL);

Arguments

x

gene expression matrix (genes x samples). [as Matrix]

TF

transcription factor gene id vector

opts

pipeline options. [as GRNBuildOptions]

bicor

optional cached bicor correlation matrix store (from open_bicor). When present, the candidate edges are read from the store instead of re-computing the correlation matrix. [as CorrelationMatrixStore]

modules

optional cached WGCNA module map (from open_modules). When Nothing and bicor is present, a sidecar cache {store}.modules is tried automatically (with fingerprint validation); on cache miss the WGCNA blockwise module detection runs once and the result is written back to the sidecar file. [as WGCNAModuleMap]

env

the R# runtime environment object. [as Environment]

Details

performance notes: when the bicor store is present, the candidate edges and p-values are read from the cached correlation matrix and the WGCNA module map is resolved through a three-level cache (explicit modules argument => {storeFile}.modules sidecar with fingerprint validation => fresh blockwise run with automatic cache write-back), so repeated calls with different thresholds do not re-run either the correlation computation or the WGCNA module detection.

Authors

TRNtoolkit

Value

the assembled GRNBuildResult: the prior regulatory network split by the WGCNA modules (each module holds a PriorNetwork of RegulatoryEdge edges carrying TF, target gene, regulation type, confidence and evidence tags), together with the build summary statistics. Use result.ToPriorNetwork() / result.ToPriorNetwork(minConfidence) to merge it into a single network for the downstream DBN or GNN modeling.

clr value class

Examples

 let opts = new("GRN_opts", minAbsCorrelation = 0.3, enableGpu = TRUE)
 |> string_links(string_db = "K:\hsa_grn\string-db");
 let grn = WGCNA::build_grn(hsa, TF$Ensembl, opts, bicor = bicor);

[Package WGCNA version 1.0.0.0 Index]