Hi,
I have working with the following code from Peter Langfelder’s tutorial, it’s about module-trait association in WGCNA but I have a doubt about the heatmap. When we run the following code from Peter Lagnfelder’s tutorial, we can put Matrix = moduleTraitPvalue
instead Matrix = moduleTraitCor
?
This is the tutorial's code:
nGenes = ncol(datExpr)
nSamples = nrow(datExpr)
MEs0 = moduleEigengenes(datExpr, moduleColors)$eigengenes
MEs = orderMEs(MEs0)
moduleTraitCor = cor(MEs, datTraits, use = "p")
moduleTraitPvalue = corPvalueStudent(moduleTraitCor, nSamples)
textMatrix = paste(signif(moduleTraitCor, 2), "\n(",
signif(moduleTraitPvalue, 1), ")", sep = "")
dim(textMatrix) = dim(moduleTraitCor)
par(mar = c(6, 8.5, 3, 3))
labeledHeatmap(Matrix = moduleTraitCor,
xLabels = names(datTraits),
yLabels = names(MEs),
ySymbols = names(MEs),
colorLabels = FALSE,
colors = greenWhiteRed(50),
textMatrix = textMatrix,
setStdMargins = FALSE,
cex.text = 0.5,
zlim = c(-1,1),
main = paste("Module-trait relationships"))
If I put Matrix=moduleTraitPvalue
can I interpretate my results as correct? Can I work with the moduleTraitPvalue
?
Thanks,
Silvia
Ok, thank you Andres! But one thing, if my clinical traits are only the clinical outcome, I mean, the results of the applied treatment: positive, negative or unchanged in the patients, is it correct write in the file’s data trait 1 for the positive, -1 for the negative and 0 for the unchanged? Because I want to know which modules are implied in the positive results.
Thanks!
You could treat the clinical traits:
positive
,negative
andunchanged
as binary traits. You can assign1
to thepositive
and0
tonegative and unchanged
(Positive vs All). However, you should do the same for thenegative
andunchanged
because a module could significantly correlates with more than one trait.Ok, I don’t know how to work with binary trait so I do
positive
(1
) vs All(negative
andunchanged
0
) but you suggest me to do the same with negative and unchanged, what are you meaning when you say do the same?Thanks for your patience
This is just an example but the
datTraits
should look like this:Wow, it’s a very good idea thank you so much! The heatmap I have obtained it’s the following:
So the conclusion that I can interpret is the modules correlated with the positive clinical outcome are the brown and black, is it correct?
Hi Silvia,
First, that
Samples
trait should not be there. You did some mistake when you prepared thedatTraits
object. Second, unfortunatelly none of your modules significantly correlates with your traits: the p-values are very high (number in parentheses) and the degree of correlation is very low.It is difficult to say what went wrong. This might be how your samples behave or you did not perform a proper data pre-processing steps.
For example: i) how many samples do you have? ii) how many differentially expressed genes did you find? iii) how did you normalized the expression data? iv) did your run a PCA to see if your samples cluster accroding to your experimental variables: Positive, Negative and Unchagend
Oh, yes sorry I have forgotten to remove the
Samples
. Well, I have 20 samples which corresponds to 10 patients, every patient have the control sample and the treatment sample. I obtained 246 DEG and I have normalized it using the RMA method. Yes, I have did a PCA and the sample aggregation was poor because of the heterogenity of the samples. The tow conditions (control and treatment) don't differentiate very well between them.Well, my two conditions are control and treatment the results of the treatment are the positive, negative and unchanged are results of the experiment.