Hello,
I performed WGCNA for 30 RNASeq samples ( a time-series data). I filtered genes that are significantly expressed over time-series (~3000 genes).
I picked soft thresold power, constructed modules with signed network, intramodular connectivity and identified top hub genes in each module chooseTopHubInEachModule
. I wish to plot gene significance vs intramodular connectivity to find interesting module. However, I am stuck at this point. the tutorial seems to make genesignificance with external trait data and I do not have it. How can create genesignificance and then plot intramodular connectivity vs gene significance ?
ADJ1=abs(cor(datExpr, use = "p"))^6
Alldegrees1=intramodularConnectivity(ADJ1, moduleColors)
#Genesignificance
GS1 = abs(cor(datExpr, use = "p"))^6
#plot gene significance against intramodular connectivity
colorLevels=unique(moduleColors)
par(mfrow=c(2,as.integer((0.5+length(colorLevels)/2))))
par(mar = c(4,5,3,1))
for (i in c(1:length(colorLevels)))
{
whichmodule=colorLevels[[i]];
restrict1 = (moduleLabels==whichmodule);
verboseScatterplot(Alldegrees1$kWithin[restrict1],
GS1[restrict1], col=colorLevels[restrict1],
main=whichmodule,
xlab="Connectivity", ylab = "Gene Significance", abline=TRUE)
}
This throws an error "Error in cor(x, y, use = "p") : 'x' has a zero dimension
"
Alldegrees1$Within[restrict1] is 3000 obs. of 4 variables, while GS1 is Largematrix with 9 million elements.
Thanks in advance.
You are trying to plot the Intramodular connectivity against an adjacency matrix of correlation values (GS1=ADJ1). Why? What are you trying to prove?
Hi, I am following the tutorial for WGCNA package, III. Using simulated data... Section 7. Module membership, Intramodular connectivity. Basically, above code is from section 7b. Tutorial. Essentially, this give gene significance against intramodular connectivity and helps to infer which of the modules is significant.
Hi,
I think you missed this tutorial:
I personally never tried this without external traits, but I think would be more appropiates inffering which module significantly correlates with your experimental variables by creating a binary trait data. You could follow this part of the tutorial
Can you humour me, please, and replace all instances of
cor()
in your code withWGCNA::cor()
? These are 2 functions with a clash in name, and they do have different functionality.Kevin