From a647f502c0d4d6527f8fe5a1904d319a7456777c Mon Sep 17 00:00:00 2001 From: Sigve Nakken Date: Mon, 29 Jan 2024 11:16:48 +0100 Subject: [PATCH] fix alias type for cna/exp --- NEWS.md | 3 ++- R/sysdata.rda | Bin 751 -> 745 bytes data-raw/biomarker_utilities.R | 42 ++++++++++++++++++++++----------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/NEWS.md b/NEWS.md index a21f58c..2b6eefd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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) diff --git a/R/sysdata.rda b/R/sysdata.rda index d07d020e84e319eadd3873bc3afe663f2a058b37..eec4a0bcfa8a75292a93bb6bae5df9f30de0ec5c 100644 GIT binary patch literal 745 zcmV8x?kLoL^wEKn>Rlr`*z*7i;RSCh!Y73k#WHjM94rLEH6VKATmM5E-`1(XcR!T zYs4(#!*X$C!`V|l8LQ14kZ8AgMZzs&hbuq76!Z=?HEFwTzXuSirDl5eCp>^6{)c#| z)t~^B8!)c(rz%KC6>Mr8qRTNFnHT_zMS!sd6Hne~V4)6H=rlXmz(Sm4bZ{PK$q6KO zJWxgr6Pc00Qy7p14BJRD%Q#j}YG0ZtI=5v~TT<4~N!g~OdrIi4crB5uGBJ94Xt~Iy znehm?{Hd^$HPsyFNwuW(Jlbnq*2LLR0)DHb3Y?{{(`%kle;n^N%xy0f+Z+)wQA~vb zx*#ZkBoi2KkYy5HGcc-7JP`2}#;w`cYl83h=df!+^$424-!B)6G3azObIId= zTO;9t^t7!`IURL)@z5j@D#lR|Y-7DxL7+SAnA4I~Brxxi$C8KwIe%wOIko83t6xA# zwbK?;Bi1+B8Hnjf?oT{8`4=(+>~6nKf$VYEI$FLPsTHT`s!nt4dmEYXW(f+SZ>Vl= zEON$aD~{0Etq_Ih7zptdJP*k(I27e;S;^|%v!`~zjV8*8IO%MBk(j-dl;7JDH!|X& zMBCf=sk^;vW3jfIU)IxKgph@MeU-YqWn-|ODf blBQy$dzoR=vUG?*Pw{soQ-ui!+YdkR5A0hx literal 751 zcmV7+FeN$IB4Wi!4iOcCT7gr}7DRPr{NH8jZ7+G+ze0i)6k zfM@_{$Y@12ff{NwYI>OUG(!{0G%y+f5s9Dx&=^T1(W-iy9+S}284VKz@}8QWlh6nO z=xQ@lOwihn4J`c!RD%ebB%A^MV5Q#XDVu6Uga3*=)l#a`_B!+(l9vKO1{2JBDAJ&= z=;nE*hmMDY-^XWVglLV|$#1_DeE(i4(OHm-Vg$lMWL9uQ(J~MRTMEM zVFeH`@2sNc^5qq(BNpbhtemo0o?jM&+1t6S3iz`M5SgQ%zJ{68Cg!0M@L|4U*ep){Ka&}Ss_{Mg1*d@ zelN976&vE?KCDlBbEtX2Wa;yvUg4(iLpb58sg^uXnOE1YX&0zHwX03aD(tX31COAF z9>r^Sij`&HduraA?Yyy1h7?jZh`Ip-j{^&VgK>dDTlGraP8zs3HzKSZsxsb(oXSE$#bs2 zjw`rv{j2YB;+JB9YD8UQ@hK}jMDDoKKD!}hC>%gZ{~sf1A=Vd0xd4Dv5x{5^AkxHj h!&jypRp6e!J4e$QLh*-@3Q%5x?ntK!5*OhdvLLdsV3_~_ diff --git a/data-raw/biomarker_utilities.R b/data-raw/biomarker_utilities.R index 84774f4..dc41d76 100644 --- a/data-raw/biomarker_utilities.R +++ b/data-raw/biomarker_utilities.R @@ -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) @@ -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) )) |> @@ -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)) |> @@ -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)