Fishers exact test on a datframe

contrasts_fisher_exact(
  xb,
  observedA = "observedA",
  observedB = "observedB",
  samplesA = "samplesA",
  samplesB = "samplesB"
)

Examples

Nprot <- 1000
condA <- 8
condB <- 8
observedA <- sample(0:8, Nprot, replace = TRUE)
observedB <- sample(0:8, Nprot, replace = TRUE)
xb <- data.frame(observedA = observedA, observedB = observedB)

xb$samplesA <- condA
xb$samplesB <- condB
proteinID <- unique(stringi::stri_rand_strings(Nprot + 20,5))[1:Nprot]
xb$proteinID <- proteinID
xlater <- xb
res <- contrasts_fisher_exact(xlater)