WGCNA: correlations module-traits, and module membership-gene significance
0
0
Entering edit mode
@rodrigoduarte88-16306
Last seen 6 months ago
United States

Hi all

I apologise for what may be a very stupid question, but I am currently trying to interpret my WGCNA results, and I could not find anything online about what the following means.

I am interested in this module turquoise (Module-trait relationship table). There is a fairly weak correlation between this module and traits "3" and "6". However, when I plot gene significance (the degree of association between genes in the turquoise module with traits 3 and 6) vs module membership (the degree each gene is associated with these modules), I get very dissimilar degrees of association.

Trait 3 - GS vs MM

Trait 6 - GS vs MM

For example, for trait 3, there really is nothing there (as expected, based on the trait-relationship association described on the table). However, for trait 6, there is a strong correlation between GS and MM - but why is this not reflected on the trait/module correlation calculated in the trait-module relationship table (link above)? Is WGCNA correcting for something else when the table is calculated?

I hope this makes sense!

Thanks!

WGCNA co-expression analysis gene significance module membership module-trait relationship • 6.2k views
ADD COMMENT
0
Entering edit mode

For trait 6 I do not see anything wrong.

None of the hub genes (genes with the highest module membership) in the turquoise module show a strong correlation with the trait 6. Also, the majority of the genes in the turquoise module show a correlation (pearson) < 0.1 with that trait:

geneTraitSignificance = as.data.frame(cor(datExpr, trait6, use = "p"));

This explain why the Module eigengene (1st Principal component) of the turquoise module poorly correlate with the trait 6 (Module-trait relationship table).

Perhaps, I would plot the heatmap of each module to see if the gene expression in your modules is in agreement with your experiment design. I suppose that the gene in the turquoise module are co-expressed only in few samples

To plot the heatmaps, try this:

library(gplots)
col = colorpanel(300, 'purple','black','yellow')
colorsA1 = names(table(moduleColors))
pdf("Heatmap.pdf",height=9,width=9)
for (c in 1:length(colorsA1)){
      moduleColors == colorsA1[c]
      heatmap.2(t(datExpr[moduleColors==colorsA1[c]]), scale = "row", col=col, density.info ="none", trace="none", cexCol=0.5, cexRow=0.8, margin=c(19,11), main = colorsA1[c], Colv = FALSE)
      }; dev.off()
ADD REPLY
0
Entering edit mode

Dear Andres,

I have a similar question also regarding the difference between Module-trait correlation and GS - MM correlation. I strugle understanding what exactly these numbers represent and why are they so different.

In example, in my yellow module, for my trait DG_brain_region I have module-trait correlation == - 0.8 (pval = 3e-05) but when I plot GS vs MM for this trait in module yellow I get cor=0.51, p = 2e-37.

This module is highly correlated with another brain region CA3 - according to module-trait heatmap correlation is 0.69, pval = 9e-04. When I plot GS va MM, I get cor=0.34, p = 3.3e-16.

So frrm the scatterplots it looks like yellow module is actually more corelated with DG and not with CA3 while the heatmap shows the opposite. Or do I misunderstand the plots?

Could you please explain why these values are so different?

ADD REPLY
0
Entering edit mode

Hi Anna,

Are you working with a signed or unsigned network? Can you show the heatmap of the yellow module?

ADD REPLY
0
Entering edit mode

Hello, sorry for my late response. this is the heatmap:

https://drive.google.com/file/d/165fizcsWcA2uzRPVV2cKNPOcqM1d2WfG/view?usp=sharing

I also have another very similar question, I posted it here: Calculation of module membership in WGCNA

ADD REPLY
0
Entering edit mode

Hi Anna,

thank you for posting the heatmap of the yellow module.

So frrm the scatterplots it looks like yellow module is actually more corelated with DG and not with CA3 while the heatmap shows the opposite.

By looking at the yellow modules, I can see you are working with an unsigned network, which is the default analysis in all WGCNA tutorials. When it comes to module-trait correlations and GS-MM correlation plots, would be much easier to interpret the results if you build a signed network instead.

Try it and let me know

ADD REPLY
0
Entering edit mode

Hi Andres,

Thank you very much for this suggestion. I was confused a bit with that, I will try signed. or hybrid-signed? What the difference is?

edit: I found this article about the network types, by P. Langfelder https://peterlangfelder.com/2018/11/25/signed-or-unsigned-which-network-type-is-preferable/

ADD REPLY
0
Entering edit mode

Hi again,

I used a signed network but I think, at first glance, the modules are quite similar. My trait-data are binary so I wonder if in this case the unsigned network could still be ok?

I mean, there are modules of the same color in both analysis correlated to similar traits, in example the blue module and brown module, they seem the same in both heatmaps. Please see the module-trait heatmaps linked below:

https://drive.google.com/drive/folders/1hd2NEraQFTlqBPTIaRxNxTsCi8GxZTf6?usp=sharing

ADD REPLY
0
Entering edit mode

Hi,

I mean, there are modules of the same color in both analysis correlated to similar traits, in example the blue module and brown module, they seem the same in both heatmaps.

how did you build the signed network? The type of network you are trying to build must be specified in the following functions:

pickSoftThreshold(datExpr, powerVector=powers, networkType = "signed", verbose = 2) # calculate soft threshold for signed network

adj = adjacency(datExpr, power = power, type="signed") # build adjacency matrix signed

distTOM = TOMdist(adj, TOMType = "signed") # calculate dissimilarity TOM signed

My trait-data are binary so I wonder if in this case the unsigned network could still be ok?

It doesn't matter if the traits are binary or continuous. Finally, without looking at the data is very difficult to understand what is going on with your modules. Would you mind to share the datExpr (normalized expression matrix? You can change the gene name into gene1, gene2 ect ect

ADD REPLY
0
Entering edit mode

Hi,

Please find the datExpr here: https://drive.google.com/file/d/1yBTnl1wqhpdbTejsmApXgVXEhPh1DcHW/view?usp=sharing

I used the code from the tutorial, blockwiseModules function:

net = blockwiseModules(datExpr, 
                   maxBlockSize = 16000,
                   power = 5,
                   TOMType = "signed", minModuleSize = 30,
                   reassignThreshold = 0, mergeCutHeight = 0.25,
                   numericLabels = TRUE, pamRespectsDendro = FALSE,
                   saveTOMs = TRUE,
                   saveTOMFileBase = "42_HPC_TOM", 
                   verbose = 3)

Should I use the other way instead?

Also, when I checked soft Thresholds for "signed" network, it is now different than the default, the power 12 or 14 seems to be adequate...

ADD REPLY
1
Entering edit mode

Here we go:

Prepare the data

WT_VSD <- read_delim("~/biocond/WT_VSD.csv", delim = ";", escape_double = FALSE, trim_ws = TRUE) # load the expression matrix
datExpr<-t(data.frame(WT_VSD, row.names = 1)) # convert the expression matrix into a data frame and transpose

Calculation of network adjacencies and Topological Overlap Matrix (TOM)

adj = adjacency(datExpr, power = 14, type="signed") # build adjacency matrix signed
distTOM = TOMdist(adj, TOMType = "signed") # calculate dissimilarity TOM signed

Clustering and module identification

geneTree = hclust(as.dist(distTOM), method = "average") # Calculate the gene tree dendrogram
minModuleSize = 100 # Choose the minimum module size
dynamicMods = cutreeDynamic(dendro = geneTree, distM = distTOM,deepSplit = 3, pamRespectsDendro = FALSE,minClusterSize = minModuleSize) # Module identification using dynamic tree cut
Colors = labels2colors(dynamicMods) # Change module labels to colors
plotDendroAndColors(geneTree, Colors, "Dynamic Tree Cut", dendroLabels = FALSE, hang = 0.03, addGuide = TRUE,  guideHang = 0.05, main = "Gene dendrogram and module colors")  # Plots the gene dendrogram

enter image description here

Merge modules sharing similar expression profiles

MEs = moduleEigengenes(datExpr, Colors)$eigengenes # Calculate the module eigengenes
MEDiss = 1-cor(MEs) # Calculate dissimilarity of module eigengenes
METree = hclust(as.dist(MEDiss), method = "average") # Cluster module eigengenes
# Plot the MEs dendrogram and selecte a dissimilarity threshold of 0.25 (0.75 similarity)
MEDissThres = 0.25
plot(METree, main = "Clustering of module eigengenes", xlab = "", sub = "")
abline(h=MEDissThres, col = "red")

enter image description here

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

# The merged MEs and module colors
mergedMEs = merge$newMEs
mergedColors = merge$colors

# Plots the gene dendrogram with merged and non-merged modules
plotDendroAndColors(geneTree, cbind(Colors, mergedColors),  c("Unmerged", "Merged"), dendroLabels = FALSE, hang = 0.03, addGuide = TRUE,  guideHang = 0.05, main = "Gene dendrogram and module colors")

enter image description here

Plot an heatmap for each module (mergedColors)

library(gplots)
col = colorpanel(300, 'purple','black','yellow')
colorsA1 = names(table(mergedColors))
pdf("Heatmap.pdf",height=9,width=9)
for (c in 1:length(colorsA1)){
    mergedColors == colorsA1[c]
    heatmap.2(t(datExpr[, mergedColors==colorsA1[c]]), scale = "row", col=col, density.info ="none", trace="none", cexCol=0.7, cexRow=0.7, margin=c(19,11), main = colorsA1[c], Colv = FALSE)
}; 
dev.off()

If you check the pdf file with the heatmaps of each module you will definitely see that almost every module is strongly associated with your experimental traits. Here is some example:

  1. In the brown module all genes are expressed at very high level in N3P and WTP samples but downregulated in SM samples
  2. In the royalblue all genes are expressed at very high level in SM samples but downregulated in N3P and WTP samples
  3. In the cyan all genes are up-regulated in CA1 samples
  4. In the darkred all genes are up-regulated in DG samples

Go ahead with the module-trait relationship analysis and remember that the final modules and the module eigengenes are in mergedColors and mergedMEs, respectively

ADD REPLY
0
Entering edit mode

Thank you very much! This is a very kind of you and very helpful, thank you!

ADD REPLY
0
Entering edit mode

Thank you for the datExpr

Also, when I checked soft Thresholds for "signed" network, it is now different than the default, the power 12 or 14 seems to be adequate

This is ok. The soft Thresholds for signed networks almost double.

ADD REPLY

Login before adding your answer.

Traffic: 448 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