What is the difference between the following two chunks of code?
geneModuleMembership = as.data.frame(cor(datExpr, MEs, use = "p")); MMPvalue = as.data.frame(corPvalueStudent(as.matrix(geneModuleMembership), nSamples)); geneTraitSignificance = as.data.frame(cor(datExpr, weight, use = "p")); GSPvalue = as.data.frame(corPvalueStudent(as.matrix(geneTraitSignificance), nSamples));
datKME = signedKME(datExpr, MEs, outputColumnName = "kME")
The first chunk is to calculate Gene Significance GS (the absolute value of the correlation between the gene and the trait) and module membership MM (the correlation of the module eigengene and the gene expression profile). While in the second, the signedKME is used for calculation of (signed) eigengene-based connectivity, also known as module membership.
Is there any difference between them in calculation of module membership? Which one should be used and in what scenario? For hub gene selection, which is better - kME, GS or MM?