README (original) (raw)

We extend existing gene enrichment tests to perform adverse event enrichment analysis. Unlike the continuous gene expression data, adverse event data are counts. Therefore, adverse event data has many zeros and ties. We propose two enrichment tests. One is a modified Fisher’s exact test based on pre-selected significant adverse events, while the other is based on a modified Kolmogorov-Smirnov statistic. We add covariate adjustment to improve the analysis.

install.packages("AEenrich")
install.packages('devtools')
# install AEenrich from Github:
devtools::install_github('umich-biostatistics/AEenrich') 
library(AEenrich)
?AEenrich
?enrich
?count_cases
# AEKS
## Type I data: data on report level
enrich(data = covid1, covar = c("SEX", "AGE"), p = 0, method = "aeks",
       n_perms = 1000, drug.case = "COVID19", dd.group = group_info,
       drug.control = "OTHER", min_size = 5, min_AE = 10, zero = FALSE)
## Type II data: aggregated data
enrich(data = covid2, covar = c("SEX", "AGE"), p = 0, method = "aeks",
       n_perms = 1000, drug.case = "DrugYes", dd.group = group_info,
       drug.control = "DrugNo", min_size = 5, min_AE = 10)
# AEFISHER
## Type I data: data on report level
enrich(data = covid1, covar = c("SEX", "AGE"), p = 0, method = "aefisher",
       n_perms = 1000, drug.case = "COVID19", dd.group = group_info,
       drug.control = "OTHER", min_size = 5, min_AE = 10, q.cut = 0.05, 
       or.cut = 1.5, cores = 8)
## Type II data: aggregated data
enrich(data = covid2, covar = c("SEX", "AGE"), p = 0, method = "aefisher",
       n_perms = 1000, drug.case = "DrugYes", dd.group = group_info,
       drug.control = "DrugNo", min_size = 5, min_AE = 10)

## Convert type I data to type II data
count_cases (data = covid1, drug.case = "COVID19", drug.control = "OTHER",
             covar_cont = c("AGE"), covar_disc = c("SEX"),
             breaks = list(c(16,30,50,65,120)))