WGCNA Analysis - blockwiseModules data processing
0
0
Entering edit mode
8 months ago
Raito92 ▴ 90

Good evening, I am currently running a WGCNA analysis. As suggested by a colleague, I switched from regular single-block WGCNA calculation to blockwiseModules, due to large (42,000 genes) dataset size. By setting the max block dimension to 40,000 , I obtain two separate blocks. Also, TOM matrices are exported and saved separately.

I don’t know how to proceed at this point. The function produced some data objects, but also exported two separated TOMs matrices.

What should I do? Most of the downstream functions explicitly require to work on a TOM (exporting data to Cytoscape for instance). I can easily import the matrix back into R, but I have two of them (same as number of blocks). Do I need to merge them somehow? Or should work on the two matrices separately? If so, how is this done? The tutorial doesn’t really expand on this.

Thank you in advance!

WGCNA blockwiseModules • 1.2k views
ADD COMMENT
0
Entering edit mode

Some of the discussion I had previously re: exporting/saving/combining TOMs here might help: https://support.bioconductor.org/p/125161/

ADD REPLY
0
Entering edit mode

Hello, Maybe it's too late for this answer, sorry...

I was looking for Horvath's website, but it appears unavailable (I don't know if it was mired or another general problem).

https://horvath.genetics.ucla.edu/html/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/Consensus-NetworkConstruction-blockwise.pdf

This was my code:

# Block-wise network

cor <- WGCNA::cor
bwnet = blockwiseModules(datExpr, power = 24, 
TOMType = "signed", 
maxBlockSize = 5000,  
minModuleSize = 30,
reassignThreshold = 0,
mergeCutHeight = 0.20, 
numericLabels = TRUE, pamRespectsDendro = FALSE,
saveTOMs = F, 
verbose = 3)

save(bwnet, file = "1_AtTOM-blockwise.RData")
#load("1_AtTOM-blockwise.RData")
cor<- stats::cor
save.image("part2_TOM.RData") #save all objects

#str(bwnet)
summary(bwnet)
# get number of genes for each module
table(bwnet$colors)

###Plot module_tree_blockwise
# open a graphics window
#sizeGrWindow(12, 9)

mergedColors = labels2colors(bwnet$colors)

# Plot the dendrogram and the module colors underneath
pdf(file = "4_Plot_module_tree_blockwise.pdf", width = 8, height = 6);
plotDendroAndColors(bwnet$dendrograms[[1]], mergedColors[bwnet$blockGenes[[1]]],
                    "Module colors",
                    dendroLabels = FALSE, hang = 0.03,
                    addGuide = TRUE, guideHang = 0.05)
dev.off()

#
moduleLabels = bwnet$colors
moduleColors = labels2colors(bwnet$colors)
MEs = bwnet$MEs;
geneTree = bwnet$dendrograms[[1]];
save(MEs, moduleLabels, moduleColors, geneTree, 
     file = "Consensus-NetworkConstruction-auto_AtTOM.RData")
#This file saved can be used to export the nwt to cytoscape
###https://horvath.genetics.ucla.edu/html/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/FemaleLiver-06-ExportNetwork.pdf
ADD REPLY

Login before adding your answer.

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