AnnotationGx provides utilities for mapping pharmacogenomic sample and
treatment identifiers to public annotation resources. The package focuses on
the practical annotation tasks that recur when harmonizing drug response
studies: mapping cell line names to Cellosaurus accessions, mapping treatment
names to PubChem compound identifiers, collecting selected ChEMBL/UniChem
annotations, and querying cancer type vocabularies such as OncoTree.
The package belongs in Bioconductor because it supports reproducible
annotation of pharmacogenomic data objects and complements packages such as
PharmacoGx, which store and analyze pharmacogenomic experiments. AnnotationGx
is intended to sit near the data preparation boundary: it helps normalize
external identifiers before downstream analyses are performed.
Install the package from Bioconductor with:
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install("AnnotationGx")
During development, install the current source checkout from a terminal with
R CMD INSTALL ..
Load the package and inspect the small example metadata tables:
library("AnnotationGx")
data(CCLE_sampleMetadata)
data(CCLE_treatmentMetadata)
head(CCLE_sampleMetadata)
#> CCLE_ID depMapID Name CCLE_ID_parsed
#> <char> <char> <char> <char>
#> 1: DMS53_LUNG ACH-000698 DMS 53 DMS53
#> 2: SW1116_LARGE_INTESTINE ACH-000489 SW1116 SW1116
#> 3: NCIH1694_LUNG ACH-000431 NCI-H1694 NCIH1694
#> 4: P3HR1_HAEMATOPOIETIC_AND_LYMPHOID_TISSUE ACH-000707 P3HR-1 P3HR1
#> 5: HUT78_HAEMATOPOIETIC_AND_LYMPHOID_TISSUE ACH-000509 HuT 78 HUT78
#> 6: UMUC3_URINARY_TRACT ACH-000522 UM-UC-3 UMUC3
head(CCLE_treatmentMetadata)
#> CCLE.treatmentid
#> <char>
#> 1: Erlotinib
#> 2: Lapatinib
#> 3: PHA-665752
#> 4: PF-2341066
#> 5: TAE684
#> 6: Vandetanib
Build Cellosaurus queries for cell line identifiers:
mapCell2Accession(c("A549", "BT474"), query_only = TRUE)
#> [00:34:32][INFO][AnnotationGx::mapCell2Accession] Creating Cellosaurus queries
#> [00:34:32][INFO][AnnotationGx::mapCell2Accession] Building Cellosaurus requests
#> $A549
#> [1] "https://api.cellosaurus.org/search/cell-line?q=idsy%3AA549&sort=ac%20asc&fields=ac%2Cid%2Csy%2Cmisspelling%2Cdr%2Ccc%2Cca%2Cdi%2Cag%2Csx%2Chi&format=txt&rows=10000"
#>
#> $BT474
#> [1] "https://api.cellosaurus.org/search/cell-line?q=idsy%3ABT474&sort=ac%20asc&fields=ac%2Cid%2Csy%2Cmisspelling%2Cdr%2Ccc%2Cca%2Cdi%2Cag%2Csx%2Chi&format=txt&rows=10000"
Run the query when an internet connection is available:
mapCell2Accession(c("A549", "BT474"))
#> [00:34:32][INFO][AnnotationGx::mapCell2Accession] Creating Cellosaurus queries
#> [00:34:32][INFO][AnnotationGx::mapCell2Accession] Building Cellosaurus requests
#> [00:34:32][INFO][AnnotationGx::mapCell2Accession] Performing Cellosaurus queries
#> [00:34:35][INFO][AnnotationGx::mapCell2Accession] Parsing Cellosaurus responses
#> cellLineName accession query
#> <char> <char> <char>
#> 1: A-549 CVCL_0023 A549
#> 2: BT-474 CVCL_0179 BT474
Build PubChem PUG-REST queries for treatment names:
mapCompound2CID(c("erlotinib", "paclitaxel"), query_only = TRUE)
#> [00:34:41][INFO][AnnotationGx::getPubchemCompound] Building PubChem REST queries...
#> [[1]]
#> [1] "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/erlotinib/cids/JSON"
#>
#> [[2]]
#> [1] "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/paclitaxel/cids/JSON"
Run the PubChem query when an internet connection is available:
mapCompound2CID(c("erlotinib", "paclitaxel"), first = TRUE)
#> [00:34:41][INFO][AnnotationGx::getPubchemCompound] Building PubChem REST queries...
#> [00:34:41][INFO][AnnotationGx::getPubchemCompound] Retrieving compound information...
#> [00:34:41][INFO][AnnotationGx::getPubchemCompound] Parsing PubChem REST responses...
#> name cids
#> <char> <int>
#> 1: erlotinib 176870
#> 2: paclitaxel 36314
Map a PubChem CID to selected computed properties:
mapCID2Properties(
ids = c(176870, 36314),
properties = c("Title", "MolecularFormula", "InChIKey")
)
#> [00:34:41][INFO][AnnotationGx::getPubchemCompound] Building PubChem REST queries...
#> [00:34:41][INFO][AnnotationGx::getPubchemCompound] Retrieving compound information...
#> [00:34:42][INFO][AnnotationGx::getPubchemCompound] Parsing PubChem REST responses...
#> CID MolecularFormula InChIKey Title
#> <int> <char> <char> <char>
#> 1: 176870 C22H23N3O4 AAKJLRGGTJKAMG-UHFFFAOYSA-N Erlotinib
#> 2: 36314 C47H51NO14 RCINICONZNJXQF-MZXODVADSA-N Paclitaxel
Inspect available Cellosaurus fields used by the cell line annotation helpers:
head(cellosaurus_fields())
#> [1] "id" "sy" "idsy" "ac" "acas" "dr"
The example data objects are derived from public pharmacogenomic resources and
are documented individually in their help pages. The source package also
includes inst/extdata/LICENSES.md, which records provenance, source links,
and redistribution notes for bundled data.
GDSC metadata must be obtained separately from the official Sanger cell line download and compound download. These files are subject to the upstream GDSC usage policy.
system.file("extdata", "LICENSES.md", package = "AnnotationGx")
#> [1] "/tmp/RtmpcnASrJ/Rinst1e79c54b25cf21/AnnotationGx/extdata/LICENSES.md"
citation("AnnotationGx")
#> To cite package 'AnnotationGx' in publications use:
#>
#> Tran M, Joseph J, Eeles C, Haibe-Kains B (2026). _AnnotationGx:
#> AnnotationGx: A package for building, updating and querying an
#> annotation database for pharmaco-genomic data_.
#> doi:10.18129/B9.bioc.AnnotationGx
#> <https://doi.org/10.18129/B9.bioc.AnnotationGx>. R package version
#> 1.0.0, <https://bioconductor.org/packages/AnnotationGx>.
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Manual{,
#> title = {AnnotationGx: AnnotationGx: A package for building, updating and querying an
#> annotation database for pharmaco-genomic data},
#> author = {Michael Tran and Jermiah Joseph and Christopher Eeles and Benjamin Haibe-Kains},
#> year = {2026},
#> note = {R package version 1.0.0},
#> url = {https://bioconductor.org/packages/AnnotationGx},
#> doi = {10.18129/B9.bioc.AnnotationGx},
#> }
sessionInfo()
#> R version 4.6.1 (2026-06-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.5 LTS
#>
#> Matrix products: default
#> BLAS: /home/biocbuild/bbs-3.24-bioc/R/lib/libRblas.so
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0 LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_GB LC_COLLATE=C
#> [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: America/New_York
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] data.table_1.18.6.1 AnnotationGx_1.0.0 BiocStyle_2.42.0
#>
#> loaded via a namespace (and not attached):
#> [1] bit_4.6.0 jsonlite_2.0.0 crayon_1.5.3
#> [4] dplyr_1.2.1 compiler_4.6.1 BiocManager_1.30.27
#> [7] filelock_1.0.3 tidyselect_1.2.1 blob_1.3.0
#> [10] parallel_4.6.1 jquerylib_0.1.4 yaml_2.3.12
#> [13] fastmap_1.2.0 R6_2.6.1 generics_0.1.4
#> [16] curl_8.2.0 httr2_1.3.0 knitr_1.52
#> [19] backports_1.5.1 checkmate_2.3.4 tibble_3.3.1
#> [22] bookdown_0.48 DBI_1.3.0 bslib_0.12.0
#> [25] pillar_1.11.1 rlang_1.3.0 cachem_1.1.0
#> [28] xfun_0.62 sass_0.5.0 bit64_4.8.6
#> [31] otel_0.3.0 RSQLite_3.53.3 memoise_2.0.1
#> [34] cli_3.6.6 withr_3.0.3 magrittr_2.0.5
#> [37] digest_0.6.39 dbplyr_2.6.0 lifecycle_1.0.5
#> [40] BiocFileCache_3.4.0 vctrs_0.7.3 evaluate_1.0.5
#> [43] glue_1.8.1 purrr_1.2.2 rmarkdown_2.32
#> [46] tools_4.6.1 pkgconfig_2.0.3 htmltools_0.5.9