knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)



Installation

if (!("remotes" %in% installed.packages())) {
  install.packages("remotes")
}

remotes::install_github('sigven/pharmOncoX')

library(pharmOncoX)
cache_dir <- tempdir()



Cancer drug classifications

Targeted agents

Plotted below are key statistics with respect to drug classification numbers for targeted and chemotherapy agents found in pharmOncoX. Existing drug classifications have been retrieved from ATC, and these have been extended with manual addition/curation, and also through the establishment of multiple novel levels in the ATC tree, particularly for targeted therapies. Note that only drugs that are indicated for cancer conditions (as harvested from the Open Targets platform) are considered in the numbers plotted below.


drugs <- get_drugs(
  cache_dir = cache_dir,
  treatment_category =  c("targeted_therapy_classified",
                          "hormone_therapy_classified"),
  output_resolution = "drug",
    drug_action_inhibition = T, drug_source_opentargets = T)

drug_classifications <- 
  drugs$records |>
  dplyr::select(drug_name, atc_level3) |>
  dplyr::mutate(
    atc_level3 = stringr::str_replace_all(
      atc_level3, 
      "\\|(Antineovascularisation agents|Selective immunosuppressants)",
      ""
    )
  ) |>
  dplyr::group_by(atc_level3) |>
  dplyr::summarise(n = dplyr::n()) |>
  dplyr::mutate(pct = round(n/sum(n) * 100, digits = 2)) |>
  dplyr::arrange(dplyr::desc(pct)) |>
  dplyr::filter(n >= 2)

p_targeted_classifications <- ggplot2::ggplot(
  data = drug_classifications, ggplot2::aes(x = reorder(atc_level3, pct), y = pct)) + 
  ggplot2::geom_bar(stat = "identity",fill="steelblue") +
  ggplot2::theme_classic() + 
  ggplot2::coord_flip() + 
  ggplot2::ylab("Percent of targeted agents") + 
  ggplot2::xlab("") +
  ggplot2::scale_y_continuous(breaks=seq(0,12,2)) +
  ggplot2::geom_text(
    ggplot2::aes(label=n), hjust=1.4, vjust=0.50, color="white", size=4) +
  ggplot2::theme(
    legend.title = ggplot2::element_blank(),
    axis.text.x = ggplot2::element_text(size = 14, vjust = 0.5),
    legend.text = ggplot2::element_text(family = "Helvetica", size = 14),
    axis.text.y = ggplot2::element_text(family = "Helvetica", size = 13),
    axis.title.x = ggplot2::element_text(family = "Helvetica", size = 14),
    axis.title.y = ggplot2::element_text(family = "Helvetica", size = 14)
  )
p_targeted_classifications

Chemotherapy agents

drugs <- get_drugs(
  cache_dir = cache_dir,
  treatment_category =  c("chemo_therapy_classified"),
  output_resolution = "drug",drug_classified_cancer = T,
    drug_source_opentargets = T)

drug_classifications_chemo <- 
  drugs$records |>
  dplyr::select(drug_name, atc_level3) |>
  dplyr::group_by(atc_level3) |>
  dplyr::summarise(n = dplyr::n()) |>
  dplyr::mutate(pct = round(n/sum(n) * 100, digits = 2)) |>
  dplyr::arrange(dplyr::desc(pct))

p_chemo_classifications <- ggplot2::ggplot(
  data = drug_classifications_chemo, ggplot2::aes(
    x = reorder(atc_level3, pct), y = pct)) + 
  ggplot2::geom_bar(stat = "identity",fill="#E69F00") +
  ggplot2::theme_classic() + 
  ggplot2::coord_flip() + 
  ggplot2::ylab("Percent of chemotherapy agents") + 
  ggplot2::xlab("") +
  ggplot2::scale_y_continuous(breaks=seq(0,30,5)) +
  ggplot2::geom_text(ggplot2::aes(label=n), 
                     hjust=1.4, vjust=0.50, color="white", size=4) +
  ggplot2::theme(
    legend.title = ggplot2::element_blank(),
    axis.text.x = ggplot2::element_text(size = 14, vjust = 0.5),
    legend.text = ggplot2::element_text(family = "Helvetica", size = 14),
    axis.text.y = ggplot2::element_text(family = "Helvetica", size = 13),
    axis.title.x = ggplot2::element_text(family = "Helvetica", size = 14),
    axis.title.y = ggplot2::element_text(family = "Helvetica", size = 14)
  )
p_chemo_classifications

Retrieval of drugs - examples

Get BRAF-targeted drugs, list records per indication

drugs <- get_drugs(
  cache_dir = cache_dir,
  treatment_category =  c("targeted_therapy_classified",
                          "targeted_therapy_unclassified"),
    drug_target = c('BRAF'))

## Number of drug records
nrow(drugs$records)

## Column names of drug records
colnames(drugs$records)



Get RAS-targeted drugs, list per drug target

drugs <- get_drugs(
  cache_dir = cache_dir, 
  treatment_category =  c("targeted_therapy_classified"),
  drug_action_inhibition = T,
  output_resolution = "drug2target")$records |>
  dplyr::filter(atc_level3 == "RAS inhibitors")

drugs <- drugs |>
  dplyr::select(
    -c("drug_alias",
       "disease_main_group",
       "drug_clinical_id")) |>
  dplyr::mutate(
    disease_indication = stringr::str_replace_all(
      disease_indication, "\\|",", ")
    ) |>
  dplyr::select(
    drug_id, drug_name, drug_type, molecule_chembl_id,
    drug_action_type, target_symbol, dplyr::everything()
  )

dt_drugtable_ras_inhibitors <- DT::datatable(
  drugs,
  escape = FALSE,
  extensions = c("Buttons", "Responsive"), 
  width = "100%",
  options = list(
    buttons = c("csv", "excel"), 
    dom = "Bfrtip")
)


dt_drugtable_ras_inhibitors



Get MEK inhibitors, list per drug only

drugs <- get_drugs(
  cache_dir = cache_dir, 
  treatment_category =  c("targeted_therapy_classified"),
  drug_action_inhibition = T,
  drug_source_opentargets = T, 
  output_resolution = "drug" )$records |>
  dplyr::filter(atc_level3 == "MEK inhibitors")

drugs <- drugs |>
  dplyr::select(
    -c("drug_alias",
       "disease_main_group",
       "drug_clinical_id")) |>
  dplyr::mutate(
    disease_indication = stringr::str_replace_all(
      disease_indication, "\\|",", ")
    )

dt_drugtable_mek_inhibitors <- DT::datatable(
  drugs,
  escape = FALSE,
  extensions = c("Buttons", "Responsive"), 
  width = "100%",
  options = list(
    buttons = c("csv", "excel"), 
    dom = "Bfrtip")
)


dt_drugtable_mek_inhibitors



Get immune checkpoint inhibitors, list per drug target

drugs <- get_drugs(
  cache_dir = cache_dir, 
  treatment_category =  c("targeted_therapy_classified"),
  drug_source_opentargets = F,
  drug_classified_cancer = T,
   output_resolution = "drug2target")

drugs$records <- drugs$records |>
  dplyr::filter(
    (!is.na(atc_level3) & 
       (atc_level3 == "PD-1/PDL-1 inhibitors" |
         atc_level3 == "Other ICIs - LAG3 inhibitors" | 
         atc_level3 == "Other ICIs - TIGIT inhibitors" | 
         atc_level3 == "Other ICIs - CTLA4 inhibitors" |
     atc_level3 == "Other ICIs")
  )) |>
  dplyr::select(
    -c("drug_alias",
       "disease_main_group",
       "drug_clinical_id")) |>
  dplyr::mutate(
    disease_indication = stringr::str_replace_all(
      disease_indication, "\\|",", ")
    ) |>
  dplyr::select(
    drug_id,
    drug_name,
    drug_type,
    target_symbol,
    target_genename,
    dplyr::everything()
  )

dt_drugtable_ici <- DT::datatable(
  drugs$records,
  escape = FALSE,
  extensions = c("Buttons", "Responsive"), 
  width = "100%",
  options = list(
    buttons = c("csv", "excel"), 
    dom = "Bfrtip")
)


dt_drugtable_ici



Get immune checkpoint inhibitors indicated for lung cancer conditions, list per drug-target entry

drugs <- get_drugs(
  cache_dir = cache_dir, 
  output_resolution = "drug2target", 
  treatment_category = c("targeted_therapy_classified"),
  drug_source_opentargets = T,
  drug_indication_main = "Lung")

drugs$records <- drugs$records |>
  dplyr::filter(
    (!is.na(atc_level3) & 
      (atc_level3 == "PD-1/PDL-1 inhibitors" |
         atc_level3 == "Other ICIs - LAG3 inhibitors" | 
         atc_level3 == "Other ICIs - TIGIT inhibitors" | 
         atc_level3 == "Other ICIs - CTLA4 inhibitors" |
     atc_level3 == "Other ICIs")
  )) |>
  dplyr::select(
    -c("drug_alias",
       "disease_main_group",
       "drug_clinical_id")) |>
  dplyr::mutate(
    disease_indication = stringr::str_replace_all(
      disease_indication, "\\|",", ")
    ) |>
  dplyr::select(
    drug_id,
    drug_name,
    drug_type,
    target_symbol,
    target_genename,
    dplyr::everything()
  )

dt_drugtable_ici_lung <- DT::datatable(
  drugs$records,
  escape = FALSE,
  extensions = c("Buttons", "Responsive"), 
  width = "100%",
  options = list(
    buttons = c("csv", "excel"), 
    dom = "Bfrtip")
)


dt_drugtable_ici_lung



Get antimetabolite drugs

drugs <- get_drugs(
  cache_dir = cache_dir, 
  treatment_category = c("chemo_therapy_classified"),
  output_resolution = "drug")

drugs$records <- drugs$records |>
  dplyr::filter(
    !is.na(atc_level2) &
    stringr::str_detect(
      atc_level2, "ANTIMETABOLITES"
    )
  ) |>
  dplyr::select(
    -c("drug_alias",
       "disease_main_group",
       "drug_clinical_id")) |>
  dplyr::mutate(
    disease_indication = stringr::str_replace_all(
      disease_indication, "\\|",", ")
    )

dt_drugtable_metabolites <- DT::datatable(
  drugs$records,
  escape = FALSE,
  extensions = c("Buttons", "Responsive"), 
  width = "100%",
  options = list(
    buttons = c("csv", "excel"), 
    dom = "Bfrtip")
)


dt_drugtable_metabolites



Get taxanes

drugs <- get_drugs(
  cache_dir = cache_dir, 
  treatment_category = "chemo_therapy_classified",
  output_resolution = "drug")

drugs$records <- drugs$records |>
  dplyr::filter(
    stringr::str_detect(
      atc_level3, "Taxanes"
    )
  ) |>
  dplyr::select(
    -c("drug_alias",
       "disease_main_group",
       "drug_clinical_id")) |>
  dplyr::mutate(
    disease_indication = stringr::str_replace_all(
      disease_indication, "\\|",", ")
    )

dt_drugtable_taxanes <- DT::datatable(
  drugs$records,
  escape = FALSE,
  extensions = c("Buttons", "Responsive"), 
  width = "100%",
  options = list(
    buttons = c("csv", "excel"), 
    dom = "Bfrtip")
)


dt_drugtable_taxanes



Get platinum compounds

drugs <- get_drugs(
  cache_dir = cache_dir, 
  treatment_category = "chemo_therapy_classified",
  output_resolution = "drug")

drugs$records <- drugs$records |>
  dplyr::filter(
    stringr::str_detect(
      atc_level3, "Platinum compounds"
    )
  ) |>
  dplyr::select(
    -c("drug_alias",
       "disease_main_group",
       "drug_clinical_id")) |>
  dplyr::mutate(
    disease_indication = stringr::str_replace_all(
      disease_indication, "\\|",", ")
    ) |>
  dplyr::select(
    drug_id, drug_name, drug_type, molecule_chembl_id,
    drug_action_type, opentargets, dplyr::everything()
  )

dt_drugtable_platins <- DT::datatable(
  drugs$records,
  escape = FALSE,
  extensions = c("Buttons", "Responsive"), 
  width = "100%",
  options = list(
    buttons = c("csv", "excel"), 
    dom = "Bfrtip")
)


dt_drugtable_platins



Retrieval of biomarkers

Reported associations between BRCA1/2 alterations and drug sensitivity

biomarkers <- get_biomarkers(
  cache_dir = cache_dir)

brca1_biomarkers <- list()
for(source in c('civic','cgi')){
  brca1_biomarkers[[source]] <- 
    biomarkers$data[[source]]$variant |> 
    dplyr::filter(
      !is.na(symbol) & (symbol == "BRCA1" | symbol == "BRCA2")) |>
    dplyr::group_by(variant_id, variant_name_primary, variant_consequence) |>
    dplyr::summarise(
      variant_alias = paste(variant_alias, collapse=", "), 
      .groups = "drop") |> 
    dplyr::inner_join(
      biomarkers$data[[source]]$clinical, by = "variant_id") |>
    dplyr::select(
      variant_id, variant_name_primary, therapeutic_context,
      evidence_type, evidence_level, 
      biomarker_source, biomarker_source_datestamp,
      molecular_profile_name, evidence_id, variant_origin,
      primary_site, evidence_id, source_id,
      evidence_url, 
      evidence_description, 
      clinical_significance) |> 
    dplyr::distinct() |> 
    dplyr::rename(literature_id = source_id,
                  variant_name = variant_name_primary) |>
    dplyr::filter(evidence_type == "Predictive") |>
    dplyr::select(
      variant_name, 
      primary_site,
      therapeutic_context,
      molecular_profile_name, 
      evidence_level,
      dplyr::everything()
    )
}

brca1_biomarkers_all <- 
  dplyr::bind_rows(brca1_biomarkers[['civic']],
                   brca1_biomarkers[['cgi']]) |>
    dplyr::arrange(evidence_level)


dt_brca1_biomarkers <- DT::datatable(
  brca1_biomarkers_all,
  escape = FALSE,
  extensions = c("Buttons", "Responsive"), 
  width = "100%",
  options = list(
    buttons = c("csv", "excel"), 
    dom = "Bfrtip")
)


dt_brca1_biomarkers



Session Info

\vspace{5pt} \footnotesize

# set eval = FALSE if you don't want this info (useful for reproducibility) 
# to appear
sessionInfo()

\normalsize



References



sigven/oncoPharmaDB documentation built on Dec. 24, 2024, 9:46 p.m.