Question: Question about WGCNA Module Eigengenes to Pathway analysis
0
gravatar for Vasu
5 months ago by
Vasu490
Vasu490 wrote:

I have a very basic question for co-expression network analysis. I'm using WGCNA. I got 34 modules as output. After this, I calculated their eigengenes and clustered them on their correlation into 17 modules.

My question - Can I use the genes from the merged modules for pathway analysis? or do I need to use only the genes from modules before merging?

ADD COMMENTlink modified 5 months ago by andres.firrincieli930 • written 5 months ago by Vasu490
3
gravatar for andres.firrincieli
5 months ago by
andres.firrincieli930 wrote:

Can I use the genes from the merged modules for pathway analysis? or do I need to use only the genes from modules before merging?

Hi, You must use the genes from the merged modules

ADD COMMENTlink modified 5 months ago • written 5 months ago by andres.firrincieli930

thanks and I have a small question. I'm able to get the hub genes from the modules before merging i.e. from 34 modules. But I would like to know how to get the hub genes from the merged modules i.e. 17 modules. How to do it? The below code gave me hub genes from one of the modules before merging.

MEList = moduleEigengenes(datExpr, colors = dynamicColors)
MEs = MEList$eigengenes

# Calculate dissimilarity of module eigengenes 
MEDiss = 1-cor(MEs);  ### Is this correct?? Should use absolute correlation ????  YES ### 

library(flashClust)
# Cluster module eigengenes 
METree = flashClust(as.dist(MEDiss), method = "average"); 


# Plot the result 
sizeGrWindow(7, 6) 
plot(METree, main = "Clustering of module eigengenes", xlab = "", sub = "") 
## merge: choose a height cut of 0.2, corresponding to correlation of 0.8, to merge 
MEDissThres = 0.2 

# Plot the cut line into the dendrogram 
abline(h=MEDissThres, col = "red")


# Call an automatic merging function 
merge = mergeCloseModules(datExpr, 
                          dynamicColors, cutHeight = MEDissThres, verbose = 3) 

# The merged module colors 
mergedColors = merge$colors; 

# Eigengenes of the new merged modules: 
mergedMEs = merge$newMEs; 

# Numeric module labels
moduleLabels = merge$colors

# Convert labels to colors
moduleColors = labels2colors(moduleLabels)

plotEigengeneNetworks(mergedMEs, "", marDendro = c(0,4,1,2), marHeatmap = c(3,4,1,2))

# calculate the module membership values
datKME=signedKME(datExpr, MEs)

FilterGenes= abs(datKME$kMEturquoise)>0.8
table(FilterGenes)
head(datExpr)[1:5,1:5]
dimnames(data.frame(datExpr))[[2]][FilterGenes]

So above I'm able to get the hub genes from module turquoise, but this module is before merging. After merging I see that this module and some other modules are clustered together. And I want to get hub genes from the clustered module. How to do it?

ADD REPLYlink written 5 months ago by Vasu490
1

Just calculate again datKME using mergedMEs

datKME=signedKME(datExpr, mergedMEs)
ADD REPLYlink written 5 months ago by andres.firrincieli930

yes just now found that and I thought of doing this. thanks a lot.

ADD REPLYlink written 5 months ago by Vasu490

one help again.

datKME=signedKME(datExpr, mergedMEs)

FilterGenes= abs(datKME$kMEgreen)>0.8
table(FilterGenes)
FilterGenes
FALSE  TRUE 
14006  1019

dimnames(data.frame(datExpr))[[2]][FilterGenes]

When I used like above to get the hub genes from module green I see that it gave 1019 hub genes based on 0.8 correlation. This green module is basically after merging another 5 modules. So, after merging these 5 modules into the green module there are around 2000 genes.

And when I checked whether 1019 hub genes are present in the 2000 genes of the green module, I see that not all 1019 genes present in 2000 genes of the green module.

Some of the hub genes are not members of that green module.

Did I do something wrong here?

ADD REPLYlink modified 5 months ago • written 5 months ago by Vasu490

hey,

I think this is a problem with the way you use to select the hub. For example, a gene could have datKME$kMEgreen=0.81 and datKME$kMEblue=0.82. In this case the gene belong to the blue module. Instead of the module membership datKME you should use the function [intramodularConnectivity][1] to calculate the intramodular connectivity (kWithin) and use this measure to select the hub genes:

kIn<-intramodularConnectivity(adjMat, mergedColors, scaleByMax = FALSE)
merged_color_matrix<-as.matrix(mergedColors)
rownames(merged_color_matrix) <- names(datExpr)
Results_KIn<-merge(kIn, merged_color_matrix,by="row.names")

Results_kIn is a dataframe containing the kWithin of each gene and the module to which they belong. The genes with the highest kWithin are the hub genes. You could also attach the datKME values to Results_kIn .

ADD REPLYlink modified 5 months ago • written 5 months ago by andres.firrincieli930
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1269 users visited in the last hour