| write_bicor {TRN} |
R Documentation |
compute the signed bicor correlation matrix once and persist it into a
Description
random-access correlation store for repeated threshold filtering experiments.
Usage
write_bicor(x, repo,
type = Float32,
wgcnaOpts = NULL,
corKind = Bicor);
Arguments
x
the gene expression matrix (genes in rows, samples in columns) that the robust biweight midcorrelation (bicor) is computed from. Should be batch-normalized and variance-filtered already (see batch_normalize and top_variance). [as Matrix]
repo
the data repository directory. Two files are written into it: {repo}/{corKind}.dat (the row blocks of the correlation matrix, named bicor.dat or pearson.dat after the correlation kind) and {repo}/index.dat (the gene table + row directory). The WGCNA module map sidecar cache is written as {repo}/modules.dat. [as string]
type
the on-disk encoding of the correlation values: CorrelationEncodings.Float32 (4 bytes per value, ~1e-7 precision, default) or CorrelationEncodings.QuantizedInt16 (2 bytes per value, ~3e-5 precision, about half of the storage size). [as CorrelationEncodings]
wgcnaOpts
optional WGCNA blockwise configuration used by the module detection that runs in the same pass. Nothing (default) uses the default configuration with the GPU backend enabled and the network graph materialization disabled. [as WGCNAConfig]
corKind
the correlation estimator used for the matrix computation: CorrelationKind.Bicor (robust biweight midcorrelation, default) or CorrelationKind.Pearson. The kind is not stored in the index but implied by the data file name. [as CorrelationKind]
env
the R# runtime environment object. [as Environment]
Details
computing the full N×N correlation matrix of a large expression matrix is very expensive (hours for 50,000 genes), while all downstream network generations are just threshold filters over this matrix. So this function performs the expensive computation once and persists two artifacts:
- the raw unfiltered signed correlation matrix (open it later via
open_bicor);
- the WGCNA module map sidecar cache
{repo}/modules.dat (consumed by
build_grn, so the WGCNA blockwise module detection is not re-run). After this one-time computation, every different correlation threshold experiment only costs a fast filtering over the cached matrix.
Authors
cytoscape
Value
TRUE when the correlation store (and the module map cache) is written successfully.
clr value class
Examples
write_bicor(hsa, repo = "Z:/hsa_mat");
[Package
TRN version 1.0.0.0
Index]