Skip to content

Commit

Permalink
pcgr: handle tmb v_stat (fixes #99)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdiakumis committed Sep 29, 2023
1 parent 8213fc2 commit c3aa59f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions R/pcgr.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ PcgrJsonFile <- R6::R6Class(
# purrr::map(l2tib) |>
# dplyr::bind_rows(.id = "name_tidy") |>
# dplyr::select("name", "name_tidy", "version", "url", "resource_type")
tmb <- j[["content"]][["tmb"]][["variant_statistic"]]
# handle nulls
tmb <- tmb %||% list(tmb_estimate = NA, n_tmb = NA)
# handle nulls and rename - see umccr/dracarys#99
tmb <-
j[["content"]][["tmb"]][["variant_statistic"]] %||%
j[["content"]][["tmb"]][["v_stat"]] %||%
list(tmb_estimate = NA, n_tmb = NA)
tmb <- purrr::flatten(tmb) |>
tibble::as_tibble() |>
tibble::as_tibble_row() |>
dplyr::select("tmb_estimate", "n_tmb")
msi <- j[["content"]][["msi"]][["prediction"]][["msi_stats"]]
# handle nulls
msi <- msi %||% list(fracIndels = NA, predicted_class = NA)
msi <- purrr::flatten(msi) |>
tibble::as_tibble() |>
tibble::as_tibble_row() |>
dplyr::select("fracIndels", "predicted_class")
metrics <- dplyr::bind_cols(msi, tmb)
list(
Expand Down

0 comments on commit c3aa59f

Please sign in to comment.