View source: R/utility_functions.R
getSoftThreshold2 | R Documentation |
Analysis of scale free topology for multiple soft thresholding powers. The aim is to help the user pick an appropriate soft-thresholding power for network construction. Inspired by WGCNA::pickSoftThreshold and updated from first version (scMiko::getSoftThreshold)
getSoftThreshold2(
s.mat,
power = c(seq(0.5, 5, by = 0.5), seq(6, 10)),
network.type = "signed",
nBreaks = 20,
removeFirst = T,
rescale.adjacency = F,
n.cores = 4,
r2.target = 0.9
)
s.mat |
similarity matrix |
power |
Numeric vector of powers to evaluate. Default is c(seq(0.5,5, by = 0.5), seq(6,10)) |
nBreaks |
Number of bins in connectivity histograms. Default is 20. |
removeFirst |
Logical specifying whether the first bin should be removed from the connectivity histogram. Default is True. |
rescale.adjacency |
Logical indicating if s.mat should be rescaled to [0,1] |
n.cores |
Number of cores to use for parallelization. Default is 4. |
r2.target |
Retrieves soft power that corresponds to network topology corresponding to r2 >= r2.target. Default is 0.9. |
networkType |
Allowed values are (unique abbreviations of) "unsigned", "signed", "signed hybrid". See WGCNA::adjacency. |
named list containing power estimates, r2 estimates, distribution plots, optimiation plot and results data.frame.
getConnectivity
# determine optimal soft threshold
sft <- getSoftThreshold2(s.mat, power =c(seq(0.5,5, by = 0.5), seq(6,10)),
network.type = "signed", rescale.adjacency = F)
# visualize optimization plot
print(sft$optimization.plot)
# visualize node-linkage density plots
cowplot::plot_grid(plotlist = sft$distribution.plot, ncol = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.