verboseScatterplot generate cor and pvalue not same as moduleTraitCor
0
0
Entering edit mode
7.6 years ago

Dear all,

I have the code as this:

Define numbers of genes and samples

 nGenes = ncol(VAX_Expr)
 nSamples = nrow(VAX_Expr)

Recalculate MEs (1st principal component) with color labels

 MEs0 = moduleEigengenes(VAX_Expr, moduleColors)$eigengenes

ME is the correlation matrix of module and sample, by row is sample, by column is module

 MEs = orderMEs(MEs0)

make correlation btween module and trait

 moduleTraitCor = cor(MEs, VAX_Bench, use = "p")
 moduleTraitPvalue = corPvalueStudent(moduleTraitCor, nSamples)

The correlation value btw trait and module can be found in the moduleTraitCor, however, when I plot GS vs MM, the cor and corp is not the same in the moduleTraitCor and moduleTraitPvalue.

Caculate the module membership (GS for each module)

  geneModuleMembership = as.data.frame(cor(VAX_Expr, MEs, use = "p"))
  MMPvalue = as.data.frame(corPvalueStudent(as.matrix(geneModuleMembership), nSamples))

names (colors) of the modules

  modNames = substring(names(MEs), 3)

  names(geneModuleMembership) = paste("MM", modNames, sep="")
  names(MMPvalue) = paste("p.MM", modNames, sep="")

  module = "brown"
  column = match(module, modNames)    
  moduleGenes = moduleColors == module     
  verboseScatterplot(abs(geneModuleMembership[moduleGenes,column]),
                     abs(df_geneTraitGS[moduleGenes,1]),
                     xlab = paste("Module Membership in", module, "module"),
                     ylab = c("Gene significance"),
                     main = paste("Module membership vs. Gene significance\n"),
                     cex.main = 1.2, cex.lab = 1.2, cex.axis = 1.2, 
                     pch = 21, col = "black", bg = module)
wgcna WGCNA • 3.1k views
ADD COMMENT
0
Entering edit mode

I don't understand the question, what is not the same, could you post the numeric differences between them (and where do you calculate each?)

ADD REPLY
0
Entering edit mode
ADD REPLY

Login before adding your answer.

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