I am analyzing honeybee RNA-seq data from two different studies.
Study 1 had 15,314 genes total with 118 DEGs. Study 2 had 11,825 genes total with 740 DEGs. There was an overlap of 67 between the two sets of DEGs.
I want to test whether this overlap is significant. I see one approach is to use Fisher Exact Test (https://rdrr.io/bioc/GeneOverlap/man/GeneOverlap.html). I am pretty sure I need to set up a 2*2 table but am unclear on the values. I am especially unclear on the first value Q below. I believe Q should be equal to N-(740+118-67), but am unsure of what value N should be used as there are two different total gene numbers (15,314 and 11,825).
fisher.test(matrix(c(Q, 740-67, 118-67, 67), nrow=2), alternative="greater")
What values should I used in this case? Thank you for sharing advice.