Intramodular connectivity and gene significance in WGCNA
0
0
Entering edit mode
2.2 years ago

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.

RNA-Seq WGCNA co-expression network • 2.3k views
ADD COMMENT
0
Entering edit mode

You are trying to plot the Intramodular connectivity against an adjacency matrix of correlation values (GS1=ADJ1). Why? What are you trying to prove?

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
1
Entering edit mode

Hi,

I think you missed this tutorial:

The result is shown in Fig. 5. The advantage of this second approach is that it can be used for any gene significance measure. A gene significance measure could be defined without reference to a sample trait. For example, it could indicate pathway membership (1 or 0) or gene essentiality (1 or 0), etc.

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

ADD REPLY
0
Entering edit mode

Can you humour me, please, and replace all instances of cor() in your code with WGCNA::cor()? These are 2 functions with a clash in name, and they do have different functionality.

Kevin

ADD REPLY

Login before adding your answer.

Traffic: 718 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6