WGCNA: question on margin setting when using plotNetworkHeatmap
1
0
Entering edit mode
boyashuang • 0
@boyashuang-11654
Last seen 7.5 years ago

Dear Dr Peter and WGCNA collegues,

Thanks collegues in genetics.ucla.edu for sharing WGCNA package for co-exp analysis.

But we are confused about the page margin setting, sth like shuffling the rows and columns, mentioned in Figure2 of "Can I use the WGCNA dendrogram to display a heatmap of gene expression?" (https://support.bioconductor.org/p/67548/).

when using the function plotNetworkHeatmap, which just has several parameters (datExpr, plotGenes, useTOM, power, networkType, main) not mentioned margin setting. Thus we get the picture JUST showing the length less than 12 characters, but the other 3 more letters are outside the view. Take the gene name MSTRG.11922.5 for example, the letter "M" did not show in row label, while the last letter "5" disappear in column label in the view, all this two letters are hidden in the margins.

Regarding LOC_Os02g38440.1, "s02g38440.1" can be seen in row name list, while "LOC_Os02g384" can be seen in column name list, displaying alternative hide and show.

Despite setting par() like following, plotNetworkHeatmap output with the default parameters as it did, .

pdf(file = "signed correlations.pdf", width = 8, height = 8, paper="a4")
topList=rank(NS1$p.Weighted,ties.method="first")<=30
gene.names= names(datExpr)[topList]
op<-par(mfrow = c(1,1), mar=c(2,2,2,2), cex.axis=2)
plotNetworkHeatmap(datExpr, plotGenes = gene.names,networkType="signed", useTOM=FALSE,power=1, main="signed correlations")
par(op) 
dev.off()

We also try par(mfrow = c(1,1), mar=c(8,10,6,2), cex.axis=2) before or after plotNetworkHeatmap, but failed in the end, and the long gene names mentioned above displaying alternative hide and show. Nor layout(matrix(c(1,1,0,2), 2, 2, byrow = TRUE)) did succeed.

Thus we are wondering that the proper preset plotNetworkHeatmaphas has nothing to do with par() or layout().

Since we are not sure which .r file in the subdir R of WGCNA1.49 is closely related to plotNetworkHeatmap, we are wondering that the proper preset of plotNetworkHeatmap.

Therefore, we wish we can solve the problem of margin setting by deeply understanding the related settings for using plotNetworkHeatmap smoothly.

Thanks again.

WGCNA plotNetworkHeatmap par • 1.1k views
ADD COMMENT
1
Entering edit mode
@peter-langfelder-4469
Last seen 29 days ago
United States

The function plotNetworkHeatmap is a simple wrapper for heatmap and does not include arguments to set the margins. You can take the code and modify it (the function is defined in Functions.R).

Sorry I can't help you more.
 

Peter

ADD COMMENT

Login before adding your answer.

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