The ChIPDBData package provides curated ChIP-seq
transcription factor target databases designed for use with TFEA.ChIP.
Each dataset contains a collection of ChIP-seq experiments (e.g.,
from ENCODE) along with their associated gene targets. These datasets
are structured as ChIPDB list objects, and
can be accessed either manually or via the getChIPDB()
function.
Important: When loading any dataset, make sure it is
assigned to an object named ChIPDB. This is crucial, as
TFEA.ChIP looks for a globally defined object called
ChIPDB and will not recognize it under any
other name.
To install the package, start R and enter:
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("ChIPDBData")Once ChIPDBData is installed, it can be loaded with the
following command:
The following datasets are currently available in the
ChIPDBData package:
These can be accessed via the ExperimentHub interface:
library(ExperimentHub)
#> Loading required package: BiocGenerics
#> Loading required package: generics
#>
#> Attaching package: 'generics'
#> The following objects are masked from 'package:base':
#>
#> as.difftime, as.factor, as.ordered, intersect, is.element, setdiff,
#> setequal, union
#>
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:stats':
#>
#> IQR, mad, sd, var, xtabs
#> The following object is masked from 'package:utils':
#>
#> data
#> The following objects are masked from 'package:base':
#>
#> anyDuplicated, aperm, append, as.data.frame, basename, cbind,
#> colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
#> get, grep, grepl, is.unsorted, lapply, Map, mapply, match, mget,
#> order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
#> rbind, Reduce, rownames, sapply, saveRDS, scale, sequence, table,
#> tapply, transform, unique, unsplit, which.max, which.min
#> Loading required package: AnnotationHub
#> Loading required package: BiocFileCache
#> Loading required package: dbplyr
eh <- ExperimentHub()
dbs <- query(eh, "ChIPDBData")
dbs
#> ExperimentHub with 364 records
#> # snapshotDate(): 2026-10-07
#> # $dataprovider: ENCODE, GeneHancer, CREDB
#> # $species: Homo sapiens
#> # $rdataclass: list
#> # additional mcols(): taxonomyid, genome, description,
#> # coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
#> # rdatapath, sourceurl, sourcetype
#> # retrieve records with, e.g., 'object[["EH9847"]]'
#>
#> title
#> EH9847 | ENCODE rE2G complete
#> EH9848 | ENCODE rE2G greater than 0.25 score
#> EH9849 | ENCODE rE2G greater than 0.5 score
#> EH9850 | ENCODE rE2G greater than 0.75 score
#> EH9851 | ENCODE rE2G greater than 50 depth
#> ... ...
#> EH10256 | ENCODE rE2G RPMI8226_ENCFF293NMV
#> EH10257 | ENCODE rE2G SK_N_DZ_ENCFF443WQN
#> EH10258 | ENCODE rE2G cardiac_muscle_cell_ENCFF091ENQ
#> EH10259 | ENCODE rE2G SJCRH30_ENCFF084UAC
#> EH10260 | ENCODE rE2G cerebellum_ENCFF121MBK
# Example: Load ENCODE rE2G300d
ChIPDB <- dbs[["EH9854"]] # IMPORTANT: Assign to 'ChIPDB'
#> see ?ChIPDBData and browseVignettes('ChIPDBData') for documentation
#> downloading 1 resources
#> retrieving 1 resource
#> loading from cacheAlternatively, you can retrieve datasets programmatically using
getChIPDB() with any of the following identifiers:
“ENCODE_rE2G”, “ENCODE_rE2G_25score”, “ENCODE_rE2G_50score”,
“ENCODE_rE2G_75score”, “ENCODE_rE2G_50depth”, “ENCODE_rE2G_100depth”,
“ENCODE_rE2G_200depth”, “ENCODE_rE2G_300depth”, “CREdb” or
“GeneHancer”.
For example:
# Load the ENCODE dataset filtered by depth >= 300
ChIPDB <- getChIPDB("ENCODE_rE2G_300depth")
#> see ?ChIPDBData and browseVignettes('ChIPDBData') for documentation
#> loading from cacheA ChIPDB object is a named list with two main
components:
Exploring the structure:
# List names of the top-level elements
names(ChIPDB)
#> [1] "Gene Keys" "ChIP Targets"
# Preview the first few Entrez IDs
ChIPDB[[1]][1:5]
#> [1] "1" "10" "100" "1000" "10000"
# View names of ChIP-seq experiments
names(ChIPDB[[2]])[1:3]
#> [1] "ENCSR000AHD.CTCF.MCF-7" "ENCSR000AHF.TAF1.MCF-7"
#> [3] "ENCSR000AKB.CTCF.GM12878"
# Show gene indices for the first experiment
ChIPDB[[2]][[1]][1:5]
#> [1] 4 9 90 94 97
# Get actual gene IDs from those indices
ChIPDB[[1]][ ChIPDB[[2]][[1]][1:5] ]
#> [1] "1000" "100009676" "100036567" "100048912" "100049716"TFEA.ChIPTo perform transcription factor enrichment analysis, start by loading
your differential expression data and defining the regulated and control
gene sets. Ensure that your ChIP-seq database is loaded and assigned to
ChIPDB. The TFEA.ChIP functions will
automatically use this object for analysis.
Important: Make sure to load ChIPDB
after running library(TFEA.CHIP). Otherwise, the package’s
default database (a limited subset from GeneHancer) will overwrite
it.
# Load and preprocess differential expression table
data('hypoxia_DESeq')
hypoxia_table <- preprocessInputData(hypoxia_DESeq)
#> Loading required namespace: DESeq2
#> Warning: Some genes returned 1:many mapping to ENTREZ ID.
# Define gene sets
Genes.Upreg <- Select_genes(hypoxia_table, min_LFC = 1)
Genes.Control <- Select_genes(hypoxia_table,
min_pval = 0.5, max_pval = 1,
min_LFC = -0.25, max_LFC = 0.25
)
# Run TF enrichment
CM_list <- contingency_matrix(Genes.Upreg, Genes.Control)
results <- getCMstats(CM_list)
# Display results
head(results)
#> Accession Cell Treatment TF p.value OR
#> 7559 GSE89836.EPAS1.HUVEC-C HUVEC-C EPAS1 2.886561e-06 63.185128
#> 852 ENCSR079WHK.MCM5.K-562 K-562 MCM5 8.804850e-02 Inf
#> 1443 ENCSR542WJU.MCM7.K-562 K-562 MCM7 8.804850e-02 Inf
#> 2614 GSE105081.GATA3.WA09 WA09 GATA3 8.804850e-02 Inf
#> 6794 GSE75297.SMAD3.hESC hESC SMAD3 8.804850e-02 Inf
#> 5971 GSE48516.JARID2.UTEIPS6 UTEIPS6 JARID2 1.020708e-42 6.071447
#> OR.SE log2.OR adj.p.value log10.adj.pVal distance
#> 7559 68.3547396 5.981513 1.069155e-05 4.9709591 62.38350
#> 852 Inf NA 1.521817e-01 0.8176377 62.19050
#> 1443 Inf NA 1.521817e-01 0.8176377 62.19050
#> 2614 Inf NA 1.521817e-01 0.8176377 62.19050
#> 6794 Inf NA 1.521817e-01 0.8176377 62.19050
#> 5971 0.7667673 2.602040 6.852352e-40 39.1641604 39.49115sessionInfo()
#> R version 4.6.1 (2026-06-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 26.04.1 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] ExperimentHub_3.3.2 AnnotationHub_4.3.2 BiocFileCache_3.3.0
#> [4] dbplyr_2.6.0 BiocGenerics_0.59.12 generics_0.1.4
#> [7] ChIPDBData_1.3.0 TFEA.ChIP_1.33.3 BiocStyle_2.41.0
#>
#> loaded via a namespace (and not attached):
#> [1] DBI_1.3.0 bitops_1.1-0
#> [3] httr2_1.3.0 biomaRt_2.69.4
#> [5] rlang_1.3.0 magrittr_2.0.5
#> [7] otel_0.2.0 matrixStats_1.5.0
#> [9] compiler_4.6.1 RSQLite_3.53.3
#> [11] GenomicFeatures_1.65.0 png_0.1-9
#> [13] vctrs_0.7.3 stringr_1.6.0
#> [15] pkgconfig_2.0.3 crayon_1.5.3
#> [17] fastmap_1.2.0 XVector_0.53.0
#> [19] Rsamtools_2.29.0 rmarkdown_2.32
#> [21] purrr_1.2.2 bit_4.6.0
#> [23] xfun_0.61 cachem_1.1.0
#> [25] cigarillo_1.3.1 jsonlite_2.0.0
#> [27] progress_1.2.3 blob_1.3.0
#> [29] DelayedArray_0.39.8 BiocParallel_1.47.0
#> [31] parallel_4.6.1 prettyunits_1.2.0
#> [33] R6_2.6.1 bslib_0.12.0
#> [35] stringi_1.8.9 RColorBrewer_1.1-3
#> [37] rtracklayer_1.73.0 GenomicRanges_1.65.4
#> [39] jquerylib_0.1.4 Rcpp_1.1.2
#> [41] Seqinfo_1.3.2 SummarizedExperiment_1.43.0
#> [43] knitr_1.52 org.Mm.eg.db_3.23.0
#> [45] R.utils_2.13.0 IRanges_2.47.5
#> [47] BiocBaseUtils_1.15.1 Matrix_1.7-6
#> [49] tidyselect_1.2.1 abind_1.4-8
#> [51] yaml_2.3.12 codetools_0.2-20
#> [53] curl_8.0.0 lattice_0.23-1
#> [55] tibble_3.3.1 Biobase_2.73.2
#> [57] withr_3.0.3 KEGGREST_1.53.6
#> [59] S7_0.2.2 evaluate_1.0.5
#> [61] Biostrings_2.81.9 pillar_1.11.1
#> [63] BiocManager_1.30.27 filelock_1.0.3
#> [65] MatrixGenerics_1.25.0 stats4_4.6.1
#> [67] RCurl_1.98-1.20 BiocVersion_3.24.0
#> [69] S4Vectors_0.51.10 hms_1.1.4
#> [71] ggplot2_4.0.3 scales_1.4.0
#> [73] glue_1.8.1 maketools_1.3.2
#> [75] tools_4.6.1 BiocIO_1.23.3
#> [77] sys_3.4.3 locfit_1.5-9.12
#> [79] GenomicAlignments_1.49.2 buildtools_1.0.0
#> [81] XML_3.99-0.25 grid_4.6.1
#> [83] AnnotationDbi_1.75.2 restfulr_0.0.17
#> [85] cli_3.6.6 rappdirs_0.3.4
#> [87] S4Arrays_1.13.2 dplyr_1.2.1
#> [89] gtable_0.3.6 R.methodsS3_1.8.2
#> [91] DESeq2_1.53.6 sass_0.4.10
#> [93] digest_0.6.39 SparseArray_1.13.4
#> [95] org.Hs.eg.db_3.23.1 rjson_0.2.23
#> [97] farver_2.1.2 memoise_2.0.1
#> [99] htmltools_0.5.9 R.oo_1.27.1
#> [101] lifecycle_1.0.5 httr_1.4.9
#> [103] bit64_4.8.6