I have a large RNAseq dataset where the expression of about 20,000 genes is determined for various different B-cell populations. I have performed WGCNA and have identified consensus modules using all conditions.
My next task is to see how these modules correlate with 'traits' (module-trait relationship) and to display these correlations in a heatmap, to identify which modules are associated with the various B-cell types.
Now comes my problem. can I use the gene expression values for the different B-cell categories as trait data? I have tried using the following code:
moduleTraitCor = cor(MEs, datTraits, use = "p"); moduleTraitPvalue = corPvalueStudent(moduleTraitCor, nSamples)
labeledHeatmap(Matrix = moduleTraitCor, xLabels = rownames(datTraits), yLabels = names(MEs), ySymbols = names(MEs), colorLabels = FALSE, colors = blueWhiteRed(50), textMatrix = textMatrix, setStdMargins = FALSE, cex.text = 0.4, zlim = c(-1,1), main = paste("Module-trait relationships"), cex.lab.y = 0.5)
the problem is that I have generated a heatmap displaying correlations for module eigengene values with expression level for ALL genes - I want to see the correlation between module eigengene values for the different B-cell groups
How can I do this?