Tests whether a set of modules defined in the reference dataset are preserved in the test dataset. Provides a convenient wrapper around modulePreservation for ModularExperiment and SummarizedExperiment objects.
Usage
modulePreservation(
reference_dataset,
test_dataset,
reference_assay_name = "normal",
test_assay_name = "normal",
module_assignments = NULL,
greyName = "module_0",
goldName = "random",
networkType = "signed",
corFnc = "cor",
savePermutedStatistics = FALSE,
...
)
Arguments
- reference_dataset
The dataset that was used to define the modules. Must be a
data.frame
ormatrix
with features as rows and samples as columns, or a ModularExperiment or SummarizedExperiment object.- test_dataset
The dataset that will be used to test for module preservation. Must be a
data.frame
ormatrix
with features as rows and samples as columns, or a SummarizedExperiment object. The features oftest_dataset
should be the same asreference_dataset
and in the same order.- reference_assay_name
If the reference dataset is a ModularExperiment or SummarizedExperiment object, this argument specifies which assay slot was used to define the modules.
- test_assay_name
If the reference dataset is a ModularExperiment or SummarizedExperiment object, this argument specifies which assay slot is to be used in preservation tests.
- module_assignments
If the reference dataset is not a ModularExperiment object, this argument is necessary to specify the module assignments.
- greyName
The name of the "module" of unassigned genes. Usually "module_0" (ReducedExperiment default) or "grey" (WGCNA default). See modulePreservation.
- goldName
The name to be used for the "gold" module (which is made up of a random sample of all network genes). See modulePreservation.
- networkType
A string referring to the type of WGCNA network used for the reference and test datasets. One of"unsigned", "signed" or "signed hybrid". See adjacency. See modulePreservation.
- corFnc
A string referring to the function to be used to calculate correlation. One of "cor" or "bicor". See modulePreservation.
- savePermutedStatistics
If
TRUE
, saves the permutation statistics as a .RData file. See modulePreservation.- ...
Additional arguments to be passed to modulePreservation.
Value
A data.frame
containing preservation statistics, as described
by modulePreservation.
Examples
# Get random ModularExperiments with rnorm, with 100 rows (features),
# 20 columns (observations) and 5/10 modules
me_1 <- ReducedExperiment:::.createRandomisedModularExperiment(100, 20, 5)
me_2 <- ReducedExperiment:::.createRandomisedModularExperiment(100, 20, 10)
# Test module preservation (test modules from dataset 1 in dataset 2)
mp <- modulePreservation(me_1, me_2, verbose = 0, nPermutations = 3)