0

I am trying to create a Venn diagram for common differentially expressed genes across 3 data sets. I created a list that contains the differentially expressed genes, then I used the venn.diagram() function with the following arguments: x (which is my list of gene names in the three data sets) , filename,category.names and output. However, the Venn diagram is turning out completely blank, no category names nor numbers inside intersections. My code looks like this:

venn.diagram(up, filename = 'venn_up.png', category.names = c('up_PC3', 'up_LAPC4', 'up_22Rv1'), output = TRUE)

Has anyone faced a similar problem? Thanks all!

Rui Barradas
  • 70,273
  • 8
  • 34
  • 66
  • 2
    It's easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick May 03 '22 at 17:55

1 Answers1

0

Without reproducible dataset it is hard, so I created one:

genes <- paste("gene",1:1000,sep="")
x <- list(
  up_PC3 = sample(genes,300), 
  up_LAPC4 = sample(genes,525), 
  up_22Rv1 = sample(genes,440)
)

You can use the following code to run a Venn diagram:

library(VennDiagram)
venn.diagram(x, filename = "venn_up.png", category.names = c('up_PC3', 'up_LAPC4', 'up_22Rv1'))

Than check at the right folder of your working directory for the output:

enter image description here

Quinten
  • 35,235
  • 5
  • 20
  • 53