Skip to content

Commit

Permalink
more refined classification
Browse files Browse the repository at this point in the history
  • Loading branch information
sigven committed Jan 28, 2024
1 parent 57ba803 commit 4dcc00c
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 48 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: pharmOncoX
Type: Package
Title: Molecularly targeted cancer drugs and biomarkers
Version: 1.5.0
Date: 2024-01-25
Date: 2024-01-28
Authors@R:
c(person(given = "Sigve",
family = "Nakken",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 1.5.1 (January 28th 2024)

* Refine possible values in `treatment_category` argument to `get_drugs()` function

# Version 1.5.0 (January 25th 2024)

* Considerable improvement of drug classifications (output column `atc_level3`),
Expand Down
4 changes: 3 additions & 1 deletion R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ get_targeted_drugs <- function(cache_dir = NA) {


onco_drugs <-
get_drugs(treatment_category = c("targeted_therapy"),
get_drugs(treatment_category = c("targeted_therapy_classified",
"targeted_therapy_unclassified",
"hormone_therapy_classified"),
cache_dir = cache_dir,
drug_classified_cancer = TRUE,
drug_cancer_indication = TRUE,
Expand Down
66 changes: 36 additions & 30 deletions R/pharm_oncox.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
#' data exists in cache
#' @param exclude_salt_forms exclude salt forms of drugs
#' @param exclude_adc exclude antibody-drug conjugates (ADCs)
#' @param treatment_category treatment category ('targeted_therapy','chemo_therapy','hormone_therapy')
#' @param treatment_category main treatment category, classified according to
#' ATC or not ('targeted_therapy_classified',
#' 'targeted_therapy_unclassified','chemo_therapy_classified','hormone_therapy_classified',
#' 'immuno_suppressants_classified','other')
#' @param drug_is_approved logical indicating if resulting drug records
#' should contain approved drugs only
#' @param drug_target character vector with drug targets (gene symbols)
Expand Down Expand Up @@ -125,7 +128,12 @@ get_drugs <- function(
exclude_salt_forms = TRUE,
exclude_adc = FALSE,
treatment_category =
c("targeted_therapy","chemo_therapy","hormone_therapy"),
c("targeted_therapy_classified",
"targeted_therapy_unclassified",
"chemo_therapy_classified",
"hormone_therapy_classified",
"immuno_suppressants_classified",
"other"),
drug_is_approved = FALSE,
drug_target = NULL,
drug_action_type = NULL,
Expand All @@ -149,9 +157,12 @@ get_drugs <- function(
"drug2target2indication")

valid_treatment_categories <-
c("hormone_therapy",
"targeted_therapy",
"chemo_therapy")
c("hormone_therapy_classified",
"targeted_therapy_classified",
"targeted_therapy_unclassified",
"chemo_therapy_classified",
"immuno_suppressants_classified",
"other")

is_valid_treatment_category <-
unique(treatment_category %in% valid_treatment_categories)
Expand Down Expand Up @@ -337,39 +348,34 @@ get_drugs <- function(


## targeted + chemo + hormone
treatment_category_regex <- "(_targeted|hormone|chemo)_therapy$"
treatment_category_regex <- ""
atc_treatment_strings <- c()

if("hormone_therapy" %in% treatment_category &
!("chemo_therapy" %in% treatment_category) &
!("targeted_therapy" %in% treatment_category)){
treatment_category_regex <- "_hormone_therapy$"
if("hormone_therapy_classified" %in% treatment_category){
atc_treatment_strings <- c(atc_treatment_strings, "cancer_hormone_therapy")
}
if("hormone_therapy" %in% treatment_category &
"chemo_therapy" %in% treatment_category &
!("targeted_therapy" %in% treatment_category)){
treatment_category_regex <- "_(hormone|chemo)_therapy$"
if("chemo_therapy_classified" %in% treatment_category){
atc_treatment_strings <- c(atc_treatment_strings, "cancer_chemo_therapy")
}
if("targeted_therapy" %in% treatment_category &
!("chemo_therapy" %in% treatment_category) &
!("hormone_therapy" %in% treatment_category)){
treatment_category_regex <- "_targeted_therapy$"
if("targeted_therapy_classified" %in% treatment_category){
atc_treatment_strings <- c(atc_treatment_strings, "cancer(_adc)?_targeted_therapy")
}
if("chemo_therapy" %in% treatment_category &
!("targeted_therapy" %in% treatment_category) &
!("hormone_therapy" %in% treatment_category)){
treatment_category_regex <- "_chemo_therapy$"
if("targeted_therapy_unclassified" %in% treatment_category){
atc_treatment_strings <- c(atc_treatment_strings, "cancer_unclassified")
}
if("targeted_therapy" %in% treatment_category &
"chemo_therapy" %in% treatment_category &
!("hormone_therapy" %in% treatment_category)){
treatment_category_regex <- "_(targeted|chemo)_therapy$"
if("immuno_suppressants_classified" %in% treatment_category){
atc_treatment_strings <- c(atc_treatment_strings, "cancer_immuno_suppressants")
}
if("targeted_therapy" %in% treatment_category &
"hormone_therapy" %in% treatment_category &
!("chemo_therapy" %in% treatment_category)){
treatment_category_regex <- "_(targeted|hormone)_therapy$"
if("other" %in% treatment_category){
atc_treatment_strings <- c(atc_treatment_strings, "(other_targeted_therapy|unknown)")
}

treatment_category_regex <- paste0(
"^(", paste(atc_treatment_strings, collapse="|"), ")$")

#cat(paste0('Treatment category regex: ', treatment_category_regex))
#cat('\n')

drug_records <- drug_records |>
dplyr::filter(
!is.na(.data$atc_treatment_category) &
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
4 changes: 3 additions & 1 deletion data-raw/biomarker_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ expand_hgvs_terms <- function(var, aa_dict, add_codon_markers = FALSE) {
}

load_civic_biomarkers <- function(
datestamp = '20230518',
datestamp = '20240114',
compound_synonyms = NULL,
hg38_fasta =
"/Users/sigven/research/DB/hg38/hg38.fa",
Expand Down Expand Up @@ -2059,6 +2059,8 @@ map_biomarker_phenotypes <- function(biomarkers_clinical = NULL,
is.na(primary_site) & stringr::str_detect(do_name,"prostate") ~ "Prostate",
is.na(primary_site) & stringr::str_detect(do_name,"pancrea") ~ "Pancreas",
is.na(primary_site) & stringr::str_detect(do_name,"lung") ~ "Lung",
is.na(primary_site) & stringr::str_detect(do_name,"myeloid") ~ "Myeloid",
is.na(primary_site) & stringr::str_detect(do_name,"lymphoma") ~ "Lymphoid",
is.na(primary_site) & stringr::str_detect(do_name,"ovary|ovarian") ~ "Ovary",
TRUE ~ as.character(primary_site)
))
Expand Down
9 changes: 9 additions & 0 deletions data-raw/drug_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,15 @@ assign_drug_category <- function(drug_df = NULL,
stringr::str_detect(
atc_code_level3, "(\\|L01XX[A-J])|(^L01XX[A-J])"
) ~ "cancer_targeted_therapy",
!is.na(target_symbol) &
!is.na(atc_code_level3) &
stringr::str_detect(
atc_code_level3, "(\\|L04)|(^L04)"
) ~ "cancer_immuno_suppressants",
!is.na(target_symbol) &
stringr::str_detect(drug_cancer_relevance,"^by_cancer") &
(is.na(atc_code_level3) | atc_code_level3 == "NA")
~ "cancer_unclassified",
!is.na(target_symbol) &
!is.na(atc_code_level3) &
stringr::str_detect(
Expand Down
9 changes: 7 additions & 2 deletions man/get_drugs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkgdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ The data is largely based on drug-target-indication associations provided by the

Drug-target associations from the Open Targets Platform have furthermore been integrated and appended with drug information from [NCI Thesaurus](https://ncithesaurus.nci.nih.gov/ncitbrowser/), showing also non-targeted cancer drugs (chemotherapeutic agents etc.), and various drug regimens.

We provide anti-cancer drugs in **pharmOncoX** with drug class labeling from [Anatomical Therapeutic Chemical (ATC) Classification System](https://www.whocc.no/atc_ddd_index/), enabling a filtering of drugs according to their main mechanisms of action.
_pharmOncoX_ provides anti-cancer drug classification through existing entries in the [Anatomical Therapeutic Chemical (ATC) Classification System](https://www.whocc.no/atc_ddd_index/), and these have been extended significantly with manual curation, also by establishing novel drug categories that are presently missing in the ATC classificiation tree (examples include _AURK inhibitors_, _MET inhibitors_, _BET inhibitors_, _AKT inhibitors_, _PLK inhibitors_, _IAP inhibitors_ etc.) enabling a filtering of drugs according to their main mechanisms of action.

Currently (as of late October 2023), `pharmOncoX` is built upon the following
Currently (as of late Janurary 2024), `pharmOncoX` is built upon the following
releases of external databases:

- Open Targets Platform (2023.09)
- Open Targets Platform (2023.12)
- ChEMBL (v33)
- NCI Thesaurus (23.09d)
- NCI Thesaurus (23.12d)

### Getting started

Expand Down
22 changes: 13 additions & 9 deletions vignettes/pharmOncoX.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ cache_dir <- tempdir()
## Targeted agents

* Plotted below are key statistics with respect to drug classification
numbers for targeted and chemotherapy agents found in _pharmOncoX_. Existing classifications have been retrieved from [ATC](https://www.whocc.no/), and these have been extended with manual addition/curation, and also establishing new levels in the ATC tree. Note that only drugs that are indicated for cancer conditions (as harvested from the Open Targets platform) are considered in the numbers plotted below.
numbers for targeted and chemotherapy agents found in _pharmOncoX_. Existing drug classifications have been retrieved from [ATC](https://www.whocc.no/), 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.

```{r targeted_agents, echo = F, eval = T, results="hide"}
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = c("targeted_therapy"),
treatment_category = c("targeted_therapy_classified"),
output_resolution = "drug",
drug_action_inhibition = T, drug_source_opentargets = T)
Expand Down Expand Up @@ -101,7 +101,7 @@ p_targeted_classifications
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = c("chemo_therapy"),
treatment_category = c("chemo_therapy_classified"),
output_resolution = "drug",
drug_source_opentargets = T)
Expand Down Expand Up @@ -157,7 +157,8 @@ p_chemo_classifications
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = c("targeted_therapy"),
treatment_category = c("targeted_therapy_classified",
"targeted_therapy_unclassified"),
drug_target = c('BRAF'))
## Number of drug records
Expand All @@ -177,7 +178,7 @@ colnames(drugs$records)
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = c("targeted_therapy"),
treatment_category = c("targeted_therapy_classified"),
drug_action_inhibition = T,
output_resolution = "drug2target")$records |>
dplyr::filter(atc_level3 == "RAS inhibitors")
Expand Down Expand Up @@ -218,7 +219,7 @@ dt_drugtable_ras_inhibitors
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = c("targeted_therapy"),
treatment_category = c("targeted_therapy_classified"),
drug_action_inhibition = T,
drug_source_opentargets = T,
output_resolution = "drug" )$records |>
Expand Down Expand Up @@ -260,7 +261,7 @@ dt_drugtable_mek_inhibitors
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = c("targeted_therapy"),
treatment_category = c("targeted_therapy_classified"),
drug_source_opentargets = F,
drug_classified_cancer = T,
output_resolution = "drug2target")
Expand Down Expand Up @@ -314,6 +315,7 @@ dt_drugtable_ici
drugs <- get_drugs(
cache_dir = cache_dir,
output_resolution = "drug2target",
treatment_category = c("targeted_therapy_classified"),
drug_source_opentargets = T,
drug_indication_main = "Lung")
Expand Down Expand Up @@ -366,7 +368,7 @@ dt_drugtable_ici_lung
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = c("chemo_therapy"),
treatment_category = c("chemo_therapy_classified"),
output_resolution = "drug")
drugs$records <- drugs$records |>
Expand Down Expand Up @@ -411,6 +413,7 @@ dt_drugtable_metabolites
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = "chemo_therapy_classified",
output_resolution = "drug")
drugs$records <- drugs$records |>
Expand Down Expand Up @@ -454,6 +457,7 @@ dt_drugtable_taxanes
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = "chemo_therapy_classified",
output_resolution = "drug")
drugs$records <- drugs$records |>
Expand Down Expand Up @@ -495,7 +499,7 @@ dt_drugtable_platins

## Reported associations between BRCA1/2 alterations and drug sensitivity

Get evidence from [CIViC](https://civicdb.org) and [CGI](https://www.cancergenomeinterpreter.org/biomarkers) for cancer drug sensitivity of BRCA1/2 alterations (somatically (tumor) or inherited/germline)
* Get evidence from [CIViC](https://civicdb.org) and [CGI](https://www.cancergenomeinterpreter.org/biomarkers) for cancer drug sensitivity of BRCA1/2 alterations (somatically (tumor) or inherited/germline)

```{r biomarkers, echo = T}
Expand Down

0 comments on commit 4dcc00c

Please sign in to comment.