From 36eccb33fb36eb6d4a07fd2f020f9bc53d3c7540 Mon Sep 17 00:00:00 2001 From: Sigve Nakken Date: Tue, 30 Jan 2024 13:52:12 +0100 Subject: [PATCH] more curation --- DESCRIPTION | 2 +- NEWS.md | 4 ++-- R/helpers.R | 16 ++++++++++++---- R/sysdata.rda | Bin 740 -> 740 bytes README.md | 2 +- data-raw/data-raw.R | 15 +++++++++------ data-raw/drug_utilities.R | 38 ++++++++++++++++++++++++++------------ pkgdown/_pkgdown.yml | 2 ++ pkgdown/index.md | 2 +- 9 files changed, 54 insertions(+), 27 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2d64573..f0ebdd4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", diff --git a/NEWS.md b/NEWS.md index 8053ff6..3abe70e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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) diff --git a/R/helpers.R b/R/helpers.R index 20fb24a..45197f6 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -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", @@ -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 = @@ -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, @@ -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) |> @@ -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) |> @@ -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) |> @@ -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) |> @@ -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)) diff --git a/R/sysdata.rda b/R/sysdata.rda index 28b74722874d114943cec836808d138422b07a05..0bf9fcbc3254e44797e9072e2e735edf07efdf01 100644 GIT binary patch literal 740 zcmVXG8q{eG&BLA$ie}j(WXNX&;cZnYHAIVJxu@}pa9b#0iXaHXaLCI zr+Iwq*RY9TNx&Yg7hR6U*=UU*_w9=0$xPCByHW19b-<84g$d(+igiid6tI;M2NOpGT44Fe$ncrdn^0T9Us;I_qc>lUD)1j4sX z!rvC~qu{?4EQ~m@Jla?y8;TkQSYN`vd1@{_IrRt>%wt#+(vsy?Or4!uG()0#!5_qZ4n2!Tgis>}pl!;3GZz5-yXnOy?pXCfyq4j=b%PvbS-qk2Hrq| zgq(iX(XKnvtvZoJ@#>;2YXJm{hayV#>k%x>^t8J1{%0NYy=UFQ4o%Z!?d>WoLiYg%GH<=Jo+7vs3Ny)ne%1$ zv-4^T0s}g`i!v0fIx!7HM+D+vA~1mL7dtU~69@;1LIdV7akd5utpTBgvZfVgmJ7i5 WfzSCe=P?i$_`8xR!i0z8w}XJxaaaQY literal 740 zcmVAInX_B9nG=7u~0MG`EKmhdt zwE$`A5lQ-|iZ-AgPyo;X00000000RhjZaE>Cetc=Q_`9bQ_5%qN2v7=Q_?n*K=htd zKn)(Fh3W3S5n&X_lYo6#HopTKX~%IO`}`sPzLoae)cYd;O|A(9SW=qzQG0m6@TO9v zN<4nl?0LUYf;fC}moCkG*=V`uz>66O$RJE4CPj`CG>n7+@?mCV1O`YjigdKKV3-v> z5Efx!&p@h-)@R(CS3J|SvCuD0|A<`zy)g;nk{!d66-8FvJfh{HD>rMcQ#b{iGva0= znnzVuEV8}!bpVC}hy_Ip)^V}OMvs&o+JE@Qt7o}k}HR<7NXygz@ZAtt9)6jO*P zvcUpK%CKOz&>?OrRi3@DTp}z=m&&_4)+G|4NEci(EaQg5QKw1%P_fhQV{hmR3q$iI z?JkJJ1-XspEg{t|^7$sR-(ACs{*5E~?K$w)BGYUVb6yw4o+d39NxM8Gi0NVN@O7_< z)xXJBC}XHq$Yf)RBwA4oLqbYf4(El(_dJlniRGZ?d`vNO-#ClC`GwlKj!ivI#3`#1 W)88Y<-zo@z{}*yaI8c!ARFcnKfnMhT diff --git a/README.md b/README.md index 8e25aa7..ddd6fe5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@   -# pharmOncoX +# pharmOncoX **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. diff --git a/data-raw/data-raw.R b/data-raw/data-raw.R index 307061d..010b17b 100755 --- a/data-raw/data-raw.R +++ b/data-raw/data-raw.R @@ -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 |> diff --git a/data-raw/drug_utilities.R b/data-raw/drug_utilities.R index 77bd736..6a35729 100644 --- a/data-raw/drug_utilities.R +++ b/data-raw/drug_utilities.R @@ -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|", @@ -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), diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index a68fd92..2f8157c 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -13,6 +13,8 @@ template: gtag('js', new Date()); gtag('config', 'G-K1KDXWGEWK'); + bslib: + primary: "#BD3039" authors: Sigve Nakken: href: "https://github.com/sigven" diff --git a/pkgdown/index.md b/pkgdown/index.md index ece1533..3886b5d 100644 --- a/pkgdown/index.md +++ b/pkgdown/index.md @@ -1,6 +1,6 @@   -# pharmOncoX +# pharmOncoX **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.