View source: R/utility_functions.R
getModulePreservation | R Documentation |
Determine module preservation between reference and query network using expression matrices from two scRNAseq comparison groups. Uses WGCNA::modulePreservation() to assess how well a module in one sample is preserved in another. 5<Z<10 indicates moderate presevation, while Z>10 indicates high preservation. Grey module contains uncharacterized genes while gold module contains random genes (these are used as controls). Note that future updates will extend the functionality to accomodate >2 networks.
getModulePreservation(
ref.mat,
query.mat,
ref.module,
query.modules = NULL,
networkType = "unsigned",
referenceNetworks = 1,
...
)
ref.mat |
reference data (expression matrix, cols are genes and rows and samples) |
query.mat |
query data (expression matrix, cols are genes and rows and samples) |
query.modules |
query module membership. Vector of colors (length is equal to number of samples), specfiying sample membership to each module. |
networkType |
Allowed values are (unique abbreviations of) "unsigned", "signed", "signed hybrid". See WGCNA::adjacency. |
referenceNetworks |
a vector giving the indices of expression data to be used as reference networks. Reference networks must have their module labels given in multiColor. |
... |
Additional arguments passessed to modulePreservation WGCNA package |
ref.modules |
reference module membership. Vector of colors (length is equal to number of samples), specfiying sample membership to each module. |
data.frame of module preservation statistics
modulePreservation
mColorh.1 <- optimalDS(dist2hclust(d.1), d.1, pamStage = F,cutHeight = 0.99)
modules.1 = mColorh.1[,4]
stats <- getModulePreservation(ref.mat = de.1, query.mat = de.2, modules.1, nPermutations=30,maxGoldModuleSize=100,maxModuleSize=400, verbose=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.