Introduction to AnnotationGx

Introduction

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.

Installation

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 ..

Core Functionality

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)
#> [01:17:15][INFO][AnnotationGx::mapCell2Accession] Creating Cellosaurus queries
#> [01:17:15][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"))
#> [01:17:15][INFO][AnnotationGx::mapCell2Accession] Creating Cellosaurus queries
#> [01:17:15][INFO][AnnotationGx::mapCell2Accession] Building Cellosaurus requests
#> [01:17:15][INFO][AnnotationGx::mapCell2Accession] Performing Cellosaurus queries
#> Querying Cellosaurus... ■■■■■■■■■■■■■■■■                  50% | ETA:  1s
#> Querying Cellosaurus... ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  100% | ETA:  0s
#> [01:17:17][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)
#> [01:17:20][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)
#> [01:17:20][INFO][AnnotationGx::getPubchemCompound] Building PubChem REST queries...
#> [01:17:20][INFO][AnnotationGx::getPubchemCompound] Retrieving compound information...
#> [01:17:21][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")
)
#> [01:17:21][INFO][AnnotationGx::getPubchemCompound] Building PubChem REST queries...
#> [01:17:21][INFO][AnnotationGx::getPubchemCompound] Retrieving compound information...
#> [01:17:21][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"

Data Provenance

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/Rtmp1BjnFj/Rinstf2016438789/AnnotationGx/extdata/LICENSES.md"

Citing AnnotationGx

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_. R package version
#>   0.99.15, <https://bhklab.github.io/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 0.99.15},
#>     url = {https://bhklab.github.io/AnnotationGx/},
#>   }

Session Info

sessionInfo()
#> R version 4.6.2 (2026-10-29)
#> 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] data.table_1.18.6.1  AnnotationGx_0.99.15 BiocStyle_2.41.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.2      BiocManager_1.30.27
#>  [7] filelock_1.0.3      tidyselect_1.2.1    blob_1.3.0         
#> [10] parallel_4.6.2      jquerylib_0.1.4     yaml_2.3.12        
#> [13] fastmap_1.2.0       R6_2.6.1            generics_0.1.4     
#> [16] curl_8.1.0          httr2_1.3.0         knitr_1.52         
#> [19] backports_1.5.1     checkmate_2.3.4     tibble_3.3.1       
#> [22] maketools_1.3.2     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          sys_3.4.3          
#> [31] bit64_4.8.6         otel_0.3.0          RSQLite_3.53.3     
#> [34] memoise_2.0.1       cli_3.6.6           withr_3.0.3        
#> [37] magrittr_2.0.5      digest_0.6.39       dbplyr_2.6.0       
#> [40] lifecycle_1.0.5     BiocFileCache_3.3.3 vctrs_0.7.3        
#> [43] evaluate_1.0.5      glue_1.8.1          buildtools_1.0.0   
#> [46] purrr_1.2.2         rmarkdown_2.32      tools_4.6.2        
#> [49] pkgconfig_2.0.3     htmltools_0.5.9