Skip to content

Commit

Permalink
more curation
Browse files Browse the repository at this point in the history
  • Loading branch information
sigven committed Jan 30, 2024
1 parent f49baa0 commit 36eccb3
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 27 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.4
Date: 2024-01-28
Date: 2024-01-30
Authors@R:
c(person(given = "Sigve",
family = "Nakken",
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Version 1.5.4 (January 29th 2024)
# Version 1.5.5 (January 30th 2024)

* Refine possible values in `treatment_category` argument to `get_drugs()` function
* Fix anti-androgen classification
* Fixed bug in alias type notation for copy numbers and expression biomarkers
* Filter noise in output from `get_targeted_agents`
* Filter noise and rank output in helper function `get_targeted_drugs`

# Version 1.5.0 (January 25th 2024)

Expand Down
16 changes: 12 additions & 4 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ get_targeted_drugs <- function(cache_dir = NA) {
"drug_approved_indication",
"drug_cancer_relevance",
"drug_frac_cancer_indications",
"drug_year_first_approval",
"drug_clinical_id",
"disease_efo_id",
"disease_efo_label",
Expand Down Expand Up @@ -71,6 +72,7 @@ get_targeted_drugs <- function(cache_dir = NA) {
.data$atc_treatment_category,
.data$drug_cancer_relevance,
.data$drug_frac_cancer_indications,
.data$drug_year_first_approval,
.data$nci_concept_definition) |>
dplyr::summarise(
drug_clinical_id =
Expand Down Expand Up @@ -138,6 +140,7 @@ get_targeted_drugs <- function(cache_dir = NA) {
"max_all_phase",
"drug_frac_cancer_indications",
"drug_cancer_relevance",
"drug_year_first_approval",
"approved_indication",
"drug_indication_label")) |>
dplyr::rename(drug_primary_site = primary_site,
Expand Down Expand Up @@ -170,6 +173,7 @@ get_targeted_drugs <- function(cache_dir = NA) {
.data$drug_max_phase_indication > 2) |>
dplyr::distinct() |>
dplyr::arrange(dplyr::desc(.data$drug_max_phase_indication),
dplyr::desc(.data$drug_year_first_approval),
.data$atc_treatment_category,
dplyr::desc(.data$drug_frac_cancer_indications),
.data$symbol) |>
Expand All @@ -182,6 +186,7 @@ get_targeted_drugs <- function(cache_dir = NA) {
.data$drug_max_phase_indication <= 2) |>
dplyr::distinct() |>
dplyr::arrange(dplyr::desc(.data$drug_max_phase_indication),
dplyr::desc(.data$drug_year_first_approval),
.data$atc_treatment_category,
dplyr::desc(.data$drug_frac_cancer_indications),
.data$symbol) |>
Expand All @@ -202,6 +207,7 @@ get_targeted_drugs <- function(cache_dir = NA) {
by = c("molecule_chembl_id","drug_name","symbol")) |>
dplyr::distinct() |>
dplyr::arrange(dplyr::desc(.data$drug_max_phase_indication),
dplyr::desc(.data$drug_year_first_approval),
.data$atc_treatment_category,
dplyr::desc(.data$drug_frac_cancer_indications),
.data$symbol) |>
Expand All @@ -222,6 +228,7 @@ get_targeted_drugs <- function(cache_dir = NA) {

targeted_drugs_per_site[[t]][['other_any_phase']] <- other_any_phase |>
dplyr::arrange(dplyr::desc(.data$drug_max_phase_indication),
dplyr::desc(.data$drug_year_first_approval),
.data$atc_treatment_category,
dplyr::desc(.data$drug_frac_cancer_indications),
.data$symbol) |>
Expand Down Expand Up @@ -292,10 +299,11 @@ get_targeted_drugs <- function(cache_dir = NA) {
}

all_tt_records <- all_tt_records |>
dplyr::filter(!(atc_treatment_category == "cancer_unclassified" &
drug_cancer_relevance == "by_cancer_condition_otp" &
drug_frac_cancer_indications < 0.7 &
approved_indication == F))
dplyr::filter(!(.data$atc_treatment_category == "cancer_unclassified" &
.data$drug_cancer_relevance == "by_cancer_condition_otp" &
.data$drug_frac_cancer_indications < 0.7 &
.data$approved_indication == F)) |>
dplyr::filter(!stringr::str_detect(.data$symbol,"^RRM"))

return(list('records' = all_tt_records,
'metadata' = metadata))
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
&nbsp;

# pharmOncoX <a href="https://sigven.github.io/pharmOncoX/"><img src="man/figures/logo.png" align="right" height="130" width="113"/></a>
# pharmOncoX <a href="https://sigven.github.io/pharmOncoX/"><img src="man/figures/logo.png" align="right" height="104" width="90"/></a>

**pharmOncoX** is an R package that provides access to targeted and non-targeted cancer drugs, and genomic cancer biomarkers. Cancer drugs include comprehensive annotations per target, drug mechanism-of-action, approval dates, clinical trial phases for various indications etc. Drugs are further classified according to the [Anatomical Therapeutic Chemical (ATC) Classification System](https://www.whocc.no/atc_ddd_index/), enabling a filtering of cancer drugs according to their main types of action.

Expand Down
15 changes: 9 additions & 6 deletions data-raw/data-raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,15 @@ raw_biomarkers[['civic']] <-
compound_synonyms = compound_synonyms,
datestamp = package_datestamp,
cache_dir = file.path(path_data_raw, "biomarkers"))
raw_biomarkers[['cgi']] <- load_cgi_biomarkers(
compound_synonyms = compound_synonyms,
cache_dir = file.path(path_data_raw, "biomarkers"))
raw_biomarkers[['mitelmandb']] <- load_mitelman_db(
cache_dir = file.path(path_data_raw, "biomarkers"))
raw_biomarkers[['custom_fusions']] <- load_custom_fusion_db()
raw_biomarkers[['cgi']] <-
load_cgi_biomarkers(
compound_synonyms = compound_synonyms,
cache_dir = file.path(path_data_raw, "biomarkers"))
raw_biomarkers[['mitelmandb']] <-
load_mitelman_db(
cache_dir = file.path(path_data_raw, "biomarkers"))
raw_biomarkers[['custom_fusions']] <-
load_custom_fusion_db()

raw_biomarkers[['custom_fusions']]$variant <-
raw_biomarkers[['custom_fusions']]$variant |>
Expand Down
38 changes: 26 additions & 12 deletions data-raw/drug_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -2449,11 +2449,11 @@ assign_drug_category <- function(drug_df = NULL,
"FORETINIB|FAMITINIB|MOTESANIB|",
"LESTAURTINIB|OSI-930|PACRITINIB|KW-2449|",
"CABOZANTINIB|BMS-817378|BMS-794833|",
"GOLVATINIB|TAK-593|XL-820|TANDUTINIB|",
"GOLVATINIB|TAK-593|XL-820|TANDUTINIB|IMATINIB|",
"CERDULATINIB|CEP-2563|FEDRATINIB|IBCASERTIB|",
"VANDETANIB|TESEVATINIB|TARLOXOTINIB|",
"TAK-285|SKLB1028|PUQUITINIB|KBP5209|REPOTRECTINIB|",
"VATALANIB|QUIZARTINIB|BMS-690514|IMATINIB|",
"VATALANIB|QUIZARTINIB|BMS-690514|IMATINIB|DASATINIB|",
"CANERTINIB|CEP-32496|REGORAFENIB|GUSACITINIB|",
"SU-014813|X-82|XL-999|LINIFANIB|NINGETINIB|",
"PEXIDARTINIB|RG-1530|SITRAVATINIB|SORAFENIB|SUNITINIB|",
Expand Down Expand Up @@ -2508,31 +2508,45 @@ assign_drug_category <- function(drug_df = NULL,
dplyr::bind_rows(
dplyr::filter(drugs_non_classified, is.na(target_symbol))) |>
dplyr::mutate(atc_code_level3 = dplyr::case_when(
is.na(atc_code_level3) &
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
(!is.na(nci_concept_definition) &
stringr::str_detect(
tolower(nci_concept_definition),
"anthracycline|anthracenedione")) ~ "L01DB",
is.na(atc_code_level3) & !stringr::str_detect(drug_entry,"/") &
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
stringr::str_detect(tolower(drug_entry),"hydroxyurea|eniluracil") ~ "L01BA",
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
stringr::str_detect(tolower(drug_entry),"arsenic trioxide") ~ "L01BA",
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
stringr::str_detect(tolower(drug_entry),
"thioguanine|aspacytarabine|aspacytarabine|troxacitabine") ~ "L01BB",
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
!stringr::str_detect(drug_entry,"/| ") &
stringr::str_detect(drug_entry, "xel$") ~ "L01CD",
is.na(atc_code_level3) & !stringr::str_detect(drug_entry,"/") &
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
!stringr::str_detect(drug_entry,"/| ") &
stringr::str_detect(drug_entry, "platin$") ~ "L01XA",
is.na(atc_code_level3) & !is.na(nci_concept_definition) &
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
!is.na(nci_concept_definition) &
stringr::str_detect(tolower(nci_concept_definition), "anti-estrogen") ~ "L02BA",
is.na(atc_code_level3) & !is.na(nci_concept_definition) &
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
!is.na(nci_concept_definition) &
stringr::str_detect(tolower(nci_concept_definition), "aromatase inhibitor") ~ "L02BG",
is.na(atc_code_level3) & !is.na(nci_concept_definition) &
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
!is.na(nci_concept_definition) &
stringr::str_detect(tolower(nci_concept_definition), "nitrogen mustard") ~ "L01AA",
is.na(atc_code_level3) & stringr::str_detect(
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
stringr::str_detect(
tolower(nci_concept_definition), "purine( nucleoside)? analog") ~ "L01BB",
is.na(atc_code_level3) & stringr::str_detect(
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
stringr::str_detect(
tolower(nci_concept_definition), "pyrimidine( nucleoside)? analog") ~ "L01BC",
is.na(atc_code_level3) &
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
!is.na(drug_entry) &
!stringr::str_detect(drug_entry, "/") &
stringr::str_detect(
tolower(nci_concept_definition), "vinca alkaloid") ~ "L01CA",
is.na(atc_code_level3) &
(is.na(atc_code_level3) | atc_code_level3 == "NA") &
((!is.na(nci_concept_definition) &
stringr::str_detect(
tolower(nci_concept_definition),
Expand Down
2 changes: 2 additions & 0 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ template:
gtag('js', new Date());
gtag('config', 'G-K1KDXWGEWK');
</script>
bslib:
primary: "#BD3039"
authors:
Sigve Nakken:
href: "https://github.com/sigven"
Expand Down
2 changes: 1 addition & 1 deletion pkgdown/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
&nbsp;

# pharmOncoX <a href="https://sigven.github.io/pharmOncoX/"><img src="man/figures/logo.png" align="right" height="130" width="113"/></a>
# pharmOncoX <a href="https://sigven.github.io/pharmOncoX/"><img src="man/figures/logo.png" align="right" height="104" width="90"/></a>

**pharmOncoX** provides access to targeted and non-targeted cancer drugs, including comprehensive annotations per target, drug mechanism-of-action, approval dates, clinical trial phases for various indications etc.

Expand Down

0 comments on commit 36eccb3

Please sign in to comment.