Error in "Relating the consensus modules to female set-specific modules"
1
0
Entering edit mode
@bahmanikmsuedu-23146
Last seen 11 months ago
Michigan State University

Hi, I'm new in WGCNA, and trying to learn. I'm using the second tutorial (female vs male), but in the third section of the tutorial (Relating the consensus modules to female set-specific modules) when I try to execute all pairwaise comparisons using the code chunk 4:

for (fmod in 1:nFemMods) for (cmod in 1:nConsMods) { femMembers = (femaleColors == femModules[fmod]); consMembers = (moduleColors == consModules[cmod]); pTable[fmod, cmod] = -log10(fisher.test(femMembers, consMembers, alternative = "greater")$p.value); CountTbl[fmod, cmod] = sum(femaleColors == femModules[fmod] & moduleColors == consModules[cmod]) }

I get an error saying that in fisher test, x and y should be same length. I don't know why I am getting this error, and after trying different things, the only reason that comes to my mind is maybe because gsg function removed different number of genes from my female and male groups (58 genes removed from female data, but 17 genes removed from male data). Can this be a reason for the error? If yes, what do I need to do about it? If not, what might be the reason? Thanks for any help/advice,

WGCNA • 194 views
ADD COMMENT
1
Entering edit mode
@peter-langfelder-4469
Last seen 12 months ago
United States

You need to restrict the femaleColors and moduleColors to the same genes. Something like (I haven't tested the code so try to understand it and make it work if I wrote a typo):

load(file = "FemaleLiver-01-dataInput.RData")

femGenes = colnames(datExpr)
consGenes = mtd.colnames(multiExpr)
common = intersect(femGenes, consGenes)
femaleColors.common = femaleColors[match(common, femGenes)];
moduleColors.common = moduleColors[match(common, consGenes)];

then run the overlap code with femaleColors.common and moduleColors.common instead of femaleColors and moduleColors.

ADD COMMENT
0
Entering edit mode

It worked. Thank you very much

ADD REPLY

Login before adding your answer.

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