Skip to content

Instantly share code, notes, and snippets.

@jnhutchinson
Last active July 27, 2017 18:10
Show Gist options
  • Save jnhutchinson/a9d43618e8326ace3764ad76c8e0b7e1 to your computer and use it in GitHub Desktop.
Save jnhutchinson/a9d43618e8326ace3764ad76c8e0b7e1 to your computer and use it in GitHub Desktop.
Hypergeometric overlap
#basic hypergeometic overlap
dds #DESeq2 object
totalassayed = 30000 # this is the total number of genes you assayed in common in both comparisons
totalsigA = 300 # this is the total number of genes that were significant in comparison A
totalsigB = 350 # this is the total number oF genes that were significant in comparison B
overlapAB = 100 # this is the number of genes that were significant in BOTH comparisons A and B
prob.overlap <- 1 - phyper(overlapAB - 1, totalsigA, totalassayed - totalsigA, totalsigB) # probability you would see an overlap this large at random
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment