getSoftThreshold | 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. This is an adaptation of the WGCNA::pickSoftThreshold function which has been customized for scRNAseq applications.
getSoftThreshold(
s.mat,
dataIsExpr = F,
weights = NULL,
RsquaredCut = 0.85,
powerVector = c(seq(1, 10, by = 1), seq(12, 20, by = 2)),
removeFirst = FALSE,
nBreaks = 10,
blockSize = 1000,
corFnc = cor,
corOptions = list(use = "p"),
networkType = "signed",
moreNetworkConcepts = FALSE,
gcInterval = NULL,
verbose = 0,
indent = 0
)
s.mat |
similarity matrix |
RsquaredCut |
Rsq cutoff. Default is 0.85. |
networkType |
Allowed values are (unique abbreviations of) "unsigned", "signed", "signed hybrid". See WGCNA::adjacency. |
... |
Additional arguments passessed to pickSoftThreshold pickSoftThreshold |
list of soft threshold picks
# determine optimal soft threshold
sft <- getSoftThreshold(s.mat)
# Plot the results
sizeGrWindow(9, 5)
par(mfrow = c(1,2));
cex1 = 0.9;
# Scale-free topology fit index as a function of the soft-thresholding power
plot(sft$fitIndices[,1], -sign(sft$fitIndices[,3])*sft$fitIndices[,2],xlab="Soft Threshold (power)",ylab="Scale Free Topology Model Fit, signed R^2",type="n", main = paste("Scale independence"));
text(sft$fitIndices[,1], -sign(sft$fitIndices[,3])*sft$fitIndices[,2],labels=powers,cex=cex1,col="red");
# Red line corresponds to using an R^2 cut-off
abline(h=0.80,col="red")
# Mean connectivity as a function of the soft-thresholding power
plot(sft$fitIndices[,1], sft$fitIndices[,5],xlab="Soft Threshold (power)",ylab="Mean Connectivity", type="n",main = paste("Mean connectivity"))
text(sft$fitIndices[,1], sft$fitIndices[,5], labels=powers, cex=cex1,col="red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.