Thank you! yes i understand, but i dont want to correlate with pearson, but linear mixed models. So i just need the clusters.
Therefore i need a code like:
mixed.lmer <- lmer(MEs ~ DiseaseScores + (1|df$PatientID_x), data = df)
Hello,
i have clustered my genes through this tutorial.
I want to correlate each these clusters with disease scores. Though i cant find my clusters as a dataframe.
How can I find the dataframe showing the genes and the clusters they belong to?
I want to correlate each these clusters with disease scores. Though i cant find my clusters as a dataframe.
You first calculate the module (cluster) eigengenes (MEs) with
MEs = moduleEigengenes(datExpr, moduleColors)$eigengenes
Then use the MEs to calculate the correlation values and significance with the disease score
moduleTraitCor = cor(MEs, datTraits, use= "p") # calculate the correlation (pearson)
moduleTraitPvalue = corPvalueStudent(moduleTraitCor, nSamples) # calculate the pvalues
If you do not understand what the MEs are, read the paper
Thank you! yes i understand, but i dont want to correlate with pearson, but linear mixed models. So i just need the clusters.
Therefore i need a code like:
mixed.lmer <- lmer(MEs ~ DiseaseScores + (1|df$PatientID_x), data = df)
Hi Recep,
sorry for the late reply. To subset the expression matrix of each module from the original datExpr you could use the following chunck of code:
datExpr_blue<-datExpr[,moduleColors=="blue" ] # to extract the expression matrix of the blue module
edit: I would run the lmer only for modules that show significant correlation with the DiseaseScores.
Log in to answer this question.