## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  eval = FALSE
)

## ----setup--------------------------------------------------------------------
# library(EWAScaller)

## -----------------------------------------------------------------------------
# res <- query_cpg(c("cg05575921", "cg11903855", "cg00240195"), workers = 2, delay = 1)
# res
# summary(res)
# head(res$associations)
# head(res$probes)

## -----------------------------------------------------------------------------
# gene_res <- query_gene(c("AHRR", "F2RL3"))
# region_res <- query_region(chr = "5", start = 373000, end = 374000)

## -----------------------------------------------------------------------------
# regions <- data.frame(chr = c("5", "1"), start = c(373000, 1), end = c(374000, 100000))
# query_region(regions)

## -----------------------------------------------------------------------------
# data(example_cpgs)
# probes <- unique(example_cpgs$query_cpg)
# 
# enr <- ewas_enrichment(
#   probes,
#   background = "850K",
#   types = c("trait", "genomic_location", "gene_ontology", "kegg")
# )
# enr
# summary(enr)
# top_traits(enr)

## -----------------------------------------------------------------------------
# plot_wordcloud(res)
# plot_wordcloud(enr, type = "trait")
# 
# autoplot(res, type = "traits")
# autoplot(res, type = "chromosome")
# autoplot(res, type = "direction")
# autoplot(enr, type = "trait")
# autoplot(enr, type = "kegg")

