Skip to content

Commit

Permalink
fix civic test bug - show noncoding (e.g. TERT) biomarkers
Browse files Browse the repository at this point in the history
  • Loading branch information
sigven committed Jun 20, 2024
1 parent b190b3f commit 0c9eafd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
32 changes: 19 additions & 13 deletions pcgrr/R/acmg.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ assign_acmg_tiers <- function(
dplyr::left_join(
tier_classification,
by = c("VAR_ID","ENTREZGENE","VARIANT_CLASS")) |>
dplyr::mutate(ACMG_TIER2 = dplyr::if_else(

## Tumor suppressor/oncogene mutations (tier 3)
dplyr::mutate(ACMG_TIER_OTHER_VARS = dplyr::if_else(
(!is.na(.data$TUMOR_SUPPRESSOR) &
.data$TUMOR_SUPPRESSOR == TRUE) |
(!is.na(.data$ONCOGENE) &
Expand All @@ -129,25 +131,28 @@ assign_acmg_tiers <- function(
as.integer(3),
as.integer(NA)
)) |>
dplyr::mutate(ACMG_TIER2 = dplyr::if_else(
is.na(.data$ACMG_TIER2) |
(!is.na(.data$ACMG_TIER2) &
.data$ACMG_TIER2 != 3) &

## Other coding mutations (tier 4)
dplyr::mutate(ACMG_TIER_OTHER_VARS = dplyr::if_else(
is.na(.data$ACMG_TIER_OTHER_VARS) |
#(!is.na(.data$ACMG_TIER_OTHER_VARS) &
# .data$ACMG_TIER_OTHER_VARS != 3) &
.data$CODING_STATUS == "coding",
as.integer(4),
as.integer(.data$ACMG_TIER2)
as.integer(.data$ACMG_TIER_OTHER_VARS)
)) |>
dplyr::mutate(ACMG_AMP_TIER = dplyr::if_else(
.data$CODING_STATUS == "noncoding",
is.na(ACMG_AMP_TIER) &
.data$CODING_STATUS == "noncoding",
as.integer(5),
as.integer(.data$ACMG_AMP_TIER)
)) |>
dplyr::mutate(ACMG_AMP_TIER = dplyr::case_when(
is.na(.data$ACMG_AMP_TIER) &
!is.na(.data$ACMG_TIER2) ~ .data$ACMG_TIER2,
!is.na(.data$ACMG_TIER_OTHER_VARS) ~ .data$ACMG_TIER_OTHER_VARS,
TRUE ~ as.integer(.data$ACMG_AMP_TIER)
)) |>
dplyr::select(-c("ACMG_TIER2")) |>
dplyr::select(-c("ACMG_TIER_OTHER_VARS")) |>
dplyr::arrange(.data$ACMG_AMP_TIER)
}else{

Expand All @@ -159,7 +164,7 @@ assign_acmg_tiers <- function(
by = c("VAR_ID",
"ENTREZGENE",
"VARIANT_CLASS")) |>
dplyr::mutate(ACMG_TIER2 = dplyr::if_else(
dplyr::mutate(ACMG_TIER_OTHER_VARS = dplyr::if_else(
(!is.na(.data$TUMOR_SUPPRESSOR) &
.data$TUMOR_SUPPRESSOR == TRUE &
.data$VARIANT_CLASS == "homdel") |
Expand All @@ -171,10 +176,10 @@ assign_acmg_tiers <- function(
)) |>
dplyr::mutate(ACMG_AMP_TIER = dplyr::case_when(
is.na(.data$ACMG_AMP_TIER) &
!is.na(.data$ACMG_TIER2) ~ .data$ACMG_TIER2,
!is.na(.data$ACMG_TIER_OTHER_VARS) ~ .data$ACMG_TIER_OTHER_VARS,
TRUE ~ as.integer(.data$ACMG_AMP_TIER)
)) |>
dplyr::select(-c("ACMG_TIER2")) |>
dplyr::select(-c("ACMG_TIER_OTHER_VARS")) |>
dplyr::arrange(.data$ACMG_AMP_TIER) |>
dplyr::distinct()

Expand All @@ -201,7 +206,8 @@ assign_acmg_tiers <- function(
as.integer(.data$ACMG_AMP_TIER)
)) |>
dplyr::mutate(ACMG_AMP_TIER = dplyr::if_else(
.data$CODING_STATUS == "noncoding",
is.na(.data$ACMG_AMP_TIER) &
.data$CODING_STATUS == "noncoding",
as.integer(5),
as.integer(.data$ACMG_AMP_TIER)
)) |>
Expand Down
4 changes: 3 additions & 1 deletion pcgrr/R/biomarkers.R
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,9 @@ get_dt_tables <- function(
dplyr::filter(
!is.na(.data$ACTIONABILITY_TIER) &
.data$ACTIONABILITY_TIER == tier) |>
dplyr::select(-c("ACTIONABILITY_FRAMEWORK"))
dplyr::select(-c("ACTIONABILITY_FRAMEWORK",
#"ACTIONABILITY_TIER",
"ACTIONABILITY"))

if(NROW(var_eitems) > 0){
var_eitems <- var_eitems |>
Expand Down

0 comments on commit 0c9eafd

Please sign in to comment.