diff --git a/R/sysdata.rda b/R/sysdata.rda index fd11aeb..e7ca955 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/data-raw/data-raw.R b/data-raw/data-raw.R index b95d8e4..3836492 100644 --- a/data-raw/data-raw.R +++ b/data-raw/data-raw.R @@ -21,7 +21,7 @@ lgr::lgr$appenders$console$set_layout( ) ## Get UMLS / DiseaseOntology / EFO mappings umls_map <- map_umls( - update = T, + update = F, basedir = here::here()) icd10_map <- map_icd10( @@ -40,7 +40,7 @@ efo_map <- map_efo( umls_map = umls_map, efo_release = metadata$phen_oncox[ metadata$phen_oncox$source == "Experimental Factor Ontology",]$version, - update = T, + update = F, basedir = here::here()) ## Use OncoTree as starting point for phenotype cross-map @@ -73,7 +73,7 @@ db[['oncotree_core']] <- oncotree_core db[['oncotree_expanded']] <- oncotree_expanded db[['auxiliary_maps']] <- auxiliary_maps -version_bumped <- "0.5.9" +version_bumped <- "0.6.0" gd_records <- list() db_id_ref <- data.frame() diff --git a/data-raw/phen_oncox_utilities.R b/data-raw/phen_oncox_utilities.R index ced2d99..aeeeeed 100644 --- a/data-raw/phen_oncox_utilities.R +++ b/data-raw/phen_oncox_utilities.R @@ -799,33 +799,6 @@ map_disease_ontology <- function( i <- i + 1 } - do_map_cui_name_matched <- do_map |> - dplyr::select(do_id, do_name) |> - dplyr::left_join( - umls_map_lower, - by = c("do_name" = "cui_name_lc"), - multiple = "all", relationship = "many-to-many") |> - dplyr::filter(!is.na(cui)) |> - dplyr::select(do_id, cui) |> - dplyr::distinct() - - #do_map <- dplyr::left_join(do_map, do_map_cui_name_matched) - - if (skip_non_cui_mapped == T) { - do_map1 <- do_map |> - dplyr::filter(!is.na(cui)) |> - dplyr::distinct() - do_map2 <- do_map |> - dplyr::filter(is.na(cui)) |> - dplyr::select(-c(cui)) |> - dplyr::inner_join( - do_map_cui_name_matched, - by = c("do_id"), - multiple = "all", relationship = "many-to-many") - - do_map <- dplyr::bind_rows(do_map1, do_map2) - } - ## manual correction of erroneous or missing UMLS cross-references do_map <- do_map |> # dplyr::mutate(do_name = @@ -887,6 +860,24 @@ map_disease_ontology <- function( ## HER2-receptor negative breast cancer dplyr::mutate(cui = dplyr::if_else(do_id == "DOID:0060080", "C5238910", as.character(cui))) |> + ## Diffuse Midline Glioma, H3 K27M-mutant + dplyr::mutate(cui = dplyr::if_else(do_id == "DOID:0080684", + "C4289688", as.character(cui))) |> + ## Diffuse large B-cell lymphoma activated B-cell type + dplyr::mutate(cui = dplyr::if_else(do_id == "DOID:0080996", + "C1333296", as.character(cui))) |> + ## Oligodendroglioma + dplyr::mutate(cui = dplyr::if_else(do_id == "DOID:3181", + "C0028945", as.character(cui))) |> + ## B-cell Acute Lymphoblastic Leukemia + dplyr::mutate(cui = dplyr::if_else(do_id == "DOID:0080638", + "C1292769", as.character(cui))) |> + ## B-cell Adult Acute Lymphocytic Leukemia + dplyr::mutate(cui = dplyr::if_else(do_id == "DOID:0060592", + "C0279593", as.character(cui))) |> + ## Diffuse Glioma, H3 G34 Mutant + dplyr::mutate(cui = dplyr::if_else(do_id == "DOID:0080880", + "C5669880", as.character(cui))) |> dplyr::bind_rows( data.frame(do_id = "DOID:1788", @@ -988,6 +979,34 @@ map_disease_ontology <- function( cui = "C0007129", do_cancer_slim = T, stringsAsFactors = F)) + + do_map_cui_name_matched <- do_map |> + dplyr::select(do_id, do_name) |> + dplyr::left_join( + umls_map_lower, + by = c("do_name" = "cui_name_lc"), + multiple = "all", relationship = "many-to-many") |> + dplyr::filter(!is.na(cui)) |> + dplyr::select(do_id, cui) |> + dplyr::distinct() + + #do_map <- dplyr::left_join(do_map, do_map_cui_name_matched) + + if (skip_non_cui_mapped == T) { + do_map1 <- do_map |> + dplyr::filter(!is.na(cui)) |> + dplyr::distinct() + do_map2 <- do_map |> + dplyr::filter(is.na(cui)) |> + dplyr::select(-c(cui)) |> + dplyr::inner_join( + do_map_cui_name_matched, + by = c("do_id"), + multiple = "all", relationship = "many-to-many") + + do_map <- dplyr::bind_rows(do_map1, do_map2) + } + return(do_map) }