Skip to content

Commit

Permalink
fix alias type for cna/exp
Browse files Browse the repository at this point in the history
  • Loading branch information
sigven committed Jan 29, 2024
1 parent d5050d5 commit a647f50
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Version 1.5.2 (January 28th 2024)
# Version 1.5.3 (January 29th 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

# Version 1.5.0 (January 25th 2024)

Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
42 changes: 28 additions & 14 deletions data-raw/biomarker_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,12 @@ load_civic_biomarkers <- function(
relationship = "many-to-many"
) |>
dplyr::distinct()
)
) |>
dplyr::mutate(alias_type = dplyr::if_else(
alias_type == "other",
"other_gene",
as.character(alias_type)
))

return(biomarker_items)

Expand Down Expand Up @@ -1598,7 +1603,8 @@ load_cgi_biomarkers <- function(compound_synonyms = NULL,
)) |>
tidyr::separate(gene, c("gene1","gene2"), sep = ";") |>
dplyr::mutate(gene = dplyr::if_else(
!is.na(gene1) & !is.na(gene2) & startsWith(molecular_profile, gene2),
!is.na(gene1) & !is.na(gene2) &
startsWith(molecular_profile, gene2),
as.character(gene2),
as.character(gene1)
)) |>
Expand Down Expand Up @@ -1868,20 +1874,20 @@ load_cgi_biomarkers <- function(compound_synonyms = NULL,
## get variant id's per molecular profile
dplyr::inner_join(
dplyr::select(
cgi_variants, entrezgene, variant_id,
variant_consequence, variant_alias,
alteration_type),
multiple = "all", relationship = "many-to-many"
cgi_variants, variant_id,
gene, alias_type, variant_alias),
by = c("gene", "variant_alias"),
relationship = "many-to-many"
) |>

## add all variant aliases
dplyr::select(-variant_alias) |>
dplyr::distinct() |>
dplyr::left_join(
dplyr::select(cgi_variants, entrezgene, variant_id,
variant_consequence, variant_alias, alias_type,
alteration_type),
multiple = "all", relationship = "many-to-many") |>
# dplyr::select(-variant_alias) |>
# dplyr::distinct() |>
# dplyr::left_join(
# dplyr::select(cgi_variants, entrezgene, variant_id,
# variant_consequence, variant_alias, alias_type,
# alteration_type),
# relationship = "many-to-many") |>
dplyr::select(-c(entrezgene, variant_consequence, variant_alias,
alias_type, gene, symbol, alteration_type,
alteration)) |>
Expand Down Expand Up @@ -1987,9 +1993,17 @@ load_cgi_biomarkers <- function(compound_synonyms = NULL,
dplyr::select(
biomarker_items$clinical,
variant_id
), relationship = "many-to-many"
), by = "variant_id",
relationship = "many-to-many"
) |>
dplyr::distinct()
) |>
dplyr::mutate(
alias_type = dplyr::case_when(
stringr::str_detect(alteration_type,"^EXP") |
alias_type == "other" ~ "other_gene",
TRUE ~ as.character(alias_type)
)
)

return(biomarker_items)
Expand Down

0 comments on commit a647f50

Please sign in to comment.