Skip to content

Commit

Permalink
fix anti-androgen classification
Browse files Browse the repository at this point in the history
  • Loading branch information
sigven committed Jan 28, 2024
1 parent e28d505 commit e3f2c18
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 18 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Version 1.5.1 (January 28th 2024)
# Version 1.5.2 (January 28th 2024)

* Refine possible values in `treatment_category` argument to `get_drugs()` function
* Fix anti-androgen classification

# Version 1.5.0 (January 25th 2024)

Expand Down
3 changes: 3 additions & 0 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ get_targeted_drugs <- function(cache_dir = NA) {
"disease_efo_id",
"disease_efo_label",
"primary_site",
"drug_type",
"drug_action_type",
"nci_concept_definition",
"drug_name",
Expand All @@ -61,6 +62,7 @@ get_targeted_drugs <- function(cache_dir = NA) {
.data$molecule_chembl_id,
.data$drug_name,
.data$drug_action_type,
.data$drug_type,
.data$primary_site,
.data$drug_link,
.data$atc_level3,
Expand Down Expand Up @@ -123,6 +125,7 @@ get_targeted_drugs <- function(cache_dir = NA) {
"molecule_chembl_id",
"symbol",
"drug_name",
"drug_type",
"drug_action_type",
"drug_link",
"atc_level3",
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
24 changes: 21 additions & 3 deletions data-raw/drug_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,12 @@ get_atc_drug_classification <- function(
atc_code_level3 == "L01CD" ~ "Taxanes",
atc_code_level3 == "L04AX" ~ "Other immunosuppressants",
atc_code_level3 == "L04AB" ~ "TNF-alpha inhibitors",
atc_code_level3 == "L02BX" ~ "Other hormone antagonists and related agents",
atc_code_level3 == "L02AE" ~ "GnRH analogs, endocrine therapy drugs",
atc_code_level3 == "L02BX" ~ "Other hormone antagonists",
atc_code_level3 == "L02AE" ~ "GnRH analogs",
atc_code_level3 == "L01XK" ~ "PARP inhibitors",
atc_code_level3 == "L01XX" ~ "Other antineoplastic agents",
atc_code_level3 == "L02AX" ~ "Other hormones for endocrine therapy",
atc_code_level3 == "L02BB" ~ "Anti-androgens",
atc_code_level3 == "L01XH" ~ "HDAC inhibitors",
atc_code_level3 == "L01XG" ~ "Proteasome inhibitors",
atc_code_level3 == "L01XA" ~ "Platinum compounds",
Expand Down Expand Up @@ -2335,6 +2336,13 @@ assign_drug_category <- function(drug_df = NULL,
target_symbol == "EGFR" &
!is.na(drug_name) &
stringr::str_detect(drug_name, "MAB") ~ "L01FE",
target_symbol == "ERBB2" &
!is.na(drug_name) &
stringr::str_detect(drug_name, "MAB") ~ "L01FD",
target_symbol == "ERBB2" &
(is.na(drug_name) |
(!is.na(drug_name) &
!stringr::str_detect(drug_name, "MAB"))) ~ "L01EH",
!is.na(drug_name) &
drug_name == "SIROLIMUS" ~ "L01EG",
target_symbol == "EGFR" &
Expand Down Expand Up @@ -2425,7 +2433,7 @@ assign_drug_category <- function(drug_df = NULL,
stringr::str_detect(target_symbol, "^AR$") &
(!is.na(nci_concept_definition) &
stringr::str_detect(
nci_concept_definition, "androgen receptor")) ~ "L01XXH",
nci_concept_definition, "androgen receptor")) ~ "L02BB",
(target_symbol == "PDCD1" |
target_symbol == "CD274") ~ "L01FF",
TRUE ~ as.character(NA)
Expand Down Expand Up @@ -2744,6 +2752,16 @@ clean_final_drug_list <- function(drug_df = NULL){
tolower(nci_concept_definition),
"a( (synthetic|diagnostic|targeted))?( radio(immuno)conjugate)")
) |>
dplyr::filter(
is.na(drug_action_type) |
!stringr::str_detect(tolower(drug_action_type),"vaccine")
) |>
dplyr::filter(
is.na(nci_concept_definition) |
!stringr::str_detect(
tolower(nci_concept_definition),
"(^(a|any)|cancer|tumor|dna|autologous|cell-based|synthetic|cell|peptide|valent)( cell)? vaccine")
) |>
dplyr::filter(
is.na(nci_cd_name) |
!stringr::str_detect(
Expand Down
27 changes: 13 additions & 14 deletions vignettes/pharmOncoX.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ cache_dir <- tempdir()

## Targeted agents

* Plotted below are key statistics with respect to drug classification
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](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.

<br>

```{r targeted_agents, echo = F, eval = T, results="hide"}
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = c("targeted_therapy_classified"),
treatment_category = c("targeted_therapy_classified",
"hormone_therapy_classified"),
output_resolution = "drug",
drug_action_inhibition = T, drug_source_opentargets = T)
Expand All @@ -68,7 +71,8 @@ drug_classifications <-
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::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)) +
Expand All @@ -78,7 +82,8 @@ p_targeted_classifications <- ggplot2::ggplot(
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::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),
Expand All @@ -102,19 +107,12 @@ p_targeted_classifications
drugs <- get_drugs(
cache_dir = cache_dir,
treatment_category = c("chemo_therapy_classified"),
output_resolution = "drug",
output_resolution = "drug",drug_classified_cancer = T,
drug_source_opentargets = T)
drug_classifications_chemo <-
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)) |>
Expand All @@ -128,8 +126,9 @@ p_chemo_classifications <- ggplot2::ggplot(
ggplot2::coord_flip() +
ggplot2::ylab("Percent of chemotherapy agents") +
ggplot2::xlab("") +
ggplot2::scale_y_continuous(breaks=seq(0,20,2)) +
ggplot2::geom_text(ggplot2::aes(label=n), hjust=1.4, vjust=0.50, color="white", size=4) +
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),
Expand Down

0 comments on commit e3f2c18

Please sign in to comment.