Entering edit mode
2.3 years ago
Recep
•
0
Hello im using WGCNA to cluster genes. I got this tutorial code from here.
I got the concept and how to choice the power but I am wondering, how can i select the parameters of power (like here from 10 to 30 and c is between 1 and 10) and h, which is here 0.90.
powers = c(c(1:10), seq(from =10, to=30, by=1)) #choosing a set of soft-thresholding powers
sft = pickSoftThreshold(datExpr, powerVector=powers, verbose =5, networkType="signed") #call network enter code heretopology analysis function
sizeGrWindow(9,5)
par(mfrow= c(1,2))
cex1=0.9
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")
abline(h=0.90, col="red")
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")
#from this plot, we would choose a power of 18 becuase it's the lowest power for which the scale free topology index reaches 0.90
I'm not sure I understand your question but
powers
is a vector from 1 to 30.which can be simplified in this way
h=0.90
inabline(h=0.90, col="red")
just draw a straight horizontal red line at the specified coordinates.The power values from 12 to 30 are generally used to calculate the scale free topology fitting index for
signed
network (seenetworkType="signed"
). In other words, depending on your dataset you would expect to achieve a 0.9 scale free topology index within the range 12 to 30.cross-posted on bioconductor: https://support.bioconductor.org/p/9146232/