## ----install, eval=FALSE------------------------------------------------------
# if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager")
# BiocManager::install(c("knowYourCG", "SummarizedExperiment", "sesame",
#                        "gprofiler2"))

## ----seq1, fig.width=5, fig.height=5, message=FALSE, warning=FALSE------------
library(knowYourCG)

query <- system.file("extdata", "onecell.cg", package = "knowYourCG")
knowledgebase <- system.file("extdata", "chromhmm.cm", package = "knowYourCG")

res = testEnrichment(query, knowledgebase)
head(res[, c("Mask", "N_mask", "N_query", "N_overlap", "estimate", "FDR")])
KYCG_plotDot(res, short_label=TRUE)

## ----seq2, eval=FALSE---------------------------------------------------------
# ## a mm10 chr16 reference coordinate file
# ref_cr <- tempfile(fileext = ".cr")
# download.file(
#     "https://zenodo.org/records/18176270/files/mm10chr16_f7_cpg.cr",
#     destfile = ref_cr, quiet = TRUE, mode = "wb")
# 
# ## a BED of three CpGs on chr16
# bed_file <- tempfile(fileext = ".bed")
# writeLines(c("chr16\t3003648\t3003650",
#              "chr16\t3003766\t3003768",
#              "chr16\t3004036\t3004038"), bed_file)
# 
# out_file <- tempfile(fileext = ".cg")
# bedToCg(bed_file, ref_cr, out_file)

## ----session-info-------------------------------------------------------------
sessionInfo()

