Entering edit mode
2.4 years ago
jms2520
▴
30
I am trying to plot my gene dendrogram while following the online tutorials for WGCNA. When using the function "table(bwnet$colors)" it shows that there should be 24 modules for my data. When I continue running the code for plotting the dendrogram (code below) I somehow keep getting a plot that looks like this. It seems to me that this is not consistent with there being 24 modules.
bwnet = blockwiseModules(datExpr0, maxBlockSize = 2000,
power = 6, TOMType = "unsigned", minModuleSize = 30,
reassignThreshold = 0, mergeCutHeight = 0.25,
numericLabels = TRUE,
saveTOMs = TRUE,
saveTOMFileBase = "TOM-blockwise",
verbose = 3)
# open a graphics window
sizeGrWindow(12, 9)
# Convert labels to colors for plotting
mergedColors = labels2colors(bwnet$colors)
# Plot the dendrogram and the module colors underneath
plotDendroAndColors(bwnet$dendrograms[[1]], mergedColors[bwnet$blockGenes[[1]]],
"Module colors",
dendroLabels = FALSE, hang = 0.03,
addGuide = TRUE, guideHang = 0.05)
table(bwnet$colors)
![> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
1287 4001 3115 2498 1774 1706 1135 735 484 305 299 269 265 157 117 111 104 101 77 71 68 63 61
23 24
60 44]
![enter image description here][1]
what is the output of
table(bwnet$unmergedColors)
?my guess is that you are plotting the dendrongram of the genes from block 1
bwnet$blockGenes[[1]]
which happen to belong togrey (0)
,blue (2)
andbrown (1)
modules.By default, the maximum block size is
5000
so the maximum number of genes you can plot in the dendrogram can't exceed that numberI am just guessing because I never used the function
blockwiseModules
I decided to choose
blockwiseModules
because my RNA seq is analyzing 18000+ probes. So that would mean I may have to plot each block separately to get a visual? I was mostly concerned that something mathematically went wrong that I missed in the network construction because my dendrogram looked so different from the ones in the tutorials but perhaps it is because my dataset is so much larger and the maximum block size?the code looks fine, and the dendrogram look like that because you are plotting only the genes from two modules that have opposite expression patterns = a gene dendrogram with only two main branches.
edit:
How much RAM do you have?
I am working on a laptop with only 8 gigs
Yeah, 8 gigs is not enough for 18k probes
I may have access to a 16 gig workstation- would that be enough?
That should be enough
So you would suggest I use the automatic network construction on a stronger computer versus using the
blockwiseModules
? If I do that would I need to increase the maximum block size in order to plot more than one module?If you have enough RAM for 18k probes you can follow the step-by-step network construction.
Peter Langfelder explains very well why WGCNA analysis on a single block (all genes) is preferred over the blockwiseModules approach: link
With access to 16gigs of RAM could I use the automatic network construction and increase the
maxblocksize
to 18k instead of 5000 default?you can set
maxBlockSize
to the total number of genes you have indatExpr