Skip to content

Commit

Permalink
Merge pull request #167 from umccr/pcgr_nontier
Browse files Browse the repository at this point in the history
Handle edge case when no tiered PCGR variants
  • Loading branch information
pdiakumis authored Sep 17, 2024
2 parents 0a5abfb + a3278fa commit 3c10ff5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
17 changes: 12 additions & 5 deletions inst/rmd/rnasum.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,18 @@ rm(g1, r1)
# PCGR annotation of mutated genes in given patient based on PCGR report, including only those with variants classified according to user-defined tier
# Also include splice region variants if specified
if (runPcgrChunk) {
ref_genes.list[["summary"]]$Mutated <- RNAsum::genes_pcgr_summary(
pcgr_tbl = sample_data.list[["wgs"]][["pcgr_tiers_tsv"]],
tiers = 1:params$pcgr_tier,
splice_vars = params$pcgr_splice_vars
)
# check if there are any tiered variants in pcgr
tmp <- sample_data.list[["wgs"]][["pcgr_tiers_tsv"]] |>
dplyr::filter(.data$TIER %in% 1:params$pcgr_tier)
if (nrow(tmp) > 0) {
ref_genes.list[["summary"]]$Mutated <- RNAsum::genes_pcgr_summary(
pcgr_tbl = sample_data.list[["wgs"]][["pcgr_tiers_tsv"]],
tiers = 1:params$pcgr_tier,
splice_vars = params$pcgr_splice_vars
)
} else {
runPcgrChunk <- FALSE
}
}
# ARRIBA annotation of gene fusion events detected in given patient
Expand Down
14 changes: 6 additions & 8 deletions inst/scripts/icav1_download_and_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ athena_lims <- function(libid) {
# download gds files to a local structure reflecting the gds path starting from
# the outdir as the fs root.
rnasum_download <- function(gdsdir, outdir, token, page_size = 200, regexes) {
dracarys::gds_files_list(gdsdir = gdsdir, token = token, page_size = page_size) |>
dracarys::gds_list_files_dir(gdsdir = gdsdir, token = token, page_size = page_size) |>
dplyr::mutate(type = purrr::map_chr(.data$bname, \(x) dracarys::match_regex(x, regexes))) |>
dplyr::select("file_id", "type", "size", "path", "bname") |>
dplyr::filter(!is.na(.data$type)) |>
Expand All @@ -37,12 +37,12 @@ rnasum_download <- function(gdsdir, outdir, token, page_size = 200, regexes) {
}

# SBJ IDs of interest
sbj <- "SBJ04426"
lib <- "L2301428"
date1 <- "2024-08-20"
sbj <- "SBJ05637"
lib <- "L2401376"
date1 <- "2024-09-16"
lims_raw <- athena_lims(lib)
pmeta_raw <- athena_rnasum(sbj) |>
rportal::meta_rnasum()
rportal::meta_rnasum(status = "Failed")
lims <- lims_raw |>
dplyr::select(library_id, sample_id, subject_id)

Expand All @@ -56,9 +56,7 @@ pmeta <- pmeta_raw |>
end_status,
wfr_id, start, end, gds_outfile_rnasum_html,
) |>
dplyr::arrange(desc(SubjectID), start) |>
dplyr::filter(rnasum_dataset == "BRCA") |>
dplyr::slice_head(n = 1)
dplyr::arrange(desc(SubjectID), start)

# patterns of files to fish out
rnasum_file_regex <- tibble::tribble(
Expand Down

0 comments on commit 3c10ff5

Please sign in to comment.