In WGCNA, I got several TOM and dendroandcolor plots via the TOMplot() and plotDendroAndColors(). I want to arrange them in one page in a pdf file which gets the sagitta vector graph.
p1 = TOMplot(plotDisscons, selectdissTreecons,selectdissColorscons)
p2 = plotDendroAndColors(net$dendrograms[[1]], mergedColors[net$blockGenes[[1]]], "Module colors", setLayout = T, dendroLabels = FALSE, hang = 0.03, addGuide = TRUE, guideHang = 0.05)
layoutMatrix = matrix(c(1,2),byrow = FALSE)
multiplot(p1, p2, layout = layoutMatrix)
Then the returned result is not a combined figure, but the value of p1 and p2. p1 and p2 are not figures either, but the lists, list of 4, or list of 1...
I found WGCNA functions TOMplot() and plotDendroAndColors() could not be used in the same way as ggplot2 functions, such as p1 = ggplot(), p2 = barchart()...... because class() p1 or p2 here you got the type 'gg' 'ggplot'.
Then, could you please tell me how to combine the figures, which are results of TOMplot() and plotDendroAndColors(), into one page of pdf. Thanks!
I am not sure, but take a look at the
setLayout
parameter that can be passed to bothTOMplot()
andplotDendroAndColors()
. If all else fails, just save them to disk as PDFs and then bind them together via, e.g., PDF-Shuffler or Adobe, or something else.