Enhanced volcano: how to control the size, and to plot multiple volcanos to one PDF page?
1
0
Entering edit mode
5.2 years ago
micecanfly ▴ 10

I am trying to plot multiple volcano plots to the same PDF page with the following code. However, instead I get a PDF file with multiple pages, one plot on each. Also pdf('volcanos.pdf', width = 10, height = 10) controls for the size of each page but not the plot itself. How to control for the size of each volcano plot, and to plot many of them on the same page? data = my dataframe with datasets from volcano plots

for(i in 1:(ncol(data)/2)) {
  pdf(paste0('./volcano_', gsub('log2FC', '', colnames(data)[2*i-1]), '.pdf'))
  volcano <- EnhancedVolcano(data,
                  lab = rownames(data),
                  title = gsub('log2FC_', '', colnames(data)[2*i-1]),
                  x = colnames(data)[2*i-1],
                  y = colnames(data)[2*i],
                  ylab = bquote(~-Log[10]~adjusted~italic(P))
                  xlim = c(-2, 2),
                  pCutoff = 0.05,
                  FCcutoff = 0.5,
                  transcriptLabSize = 5,
                  drawConnectors = TRUE,
                  widthConnectors = 0.2,
                  legendPosition = 'right')
  print(volcano)
  dev.off()
  }
r plotting • 5.7k views
ADD COMMENT
0
Entering edit mode
5.2 years ago

Hey, there is an example in the vignette: 4.10 Over-ride colouring scheme with custom key-value pairs.

download

Kevin

ADD COMMENT

Login before adding your answer.

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