Skip to content

Commit 80158c4

Browse files
authored
Merge pull request #173 from umccr/bugfix-svexpr
Do not run SV chunks when 0 expressed SV genes
2 parents 2cde2f1 + d5f05da commit 80158c4

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

inst/rmd/rnasum.Rmd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,13 @@ fusions_ann <- RNAsum::fusions_annot(
14211421
```{r fusions_and_manta_data_prep, comment = NA, message=FALSE, warning=FALSE, eval = runSVsChunk}
14221422
manta_sv <- sample_data.list[["wgs"]][["manta_tsv"]] |>
14231423
RNAsum::manta_process()
1424-
1424+
tmp_sv_genes <- manta_sv$genes_all$Genes
1425+
tmp_expressed_sv_genes <- tmp_sv_genes[tmp_sv_genes %in% ref_dataset.list[[dataset]][["gene_annot_all"]]$SYMBOL]
1426+
if (length(tmp_expressed_sv_genes) == 0) {
1427+
# from now on don't evaluate SV chunks
1428+
runSVsChunk <- FALSE
1429+
}
1430+
rm(tmp_sv_genes, tmp_expressed_sv_genes)
14251431
##### Compare fusion genes called by MANTA
14261432
##### First limit MANTA output to fusions only
14271433
if (runFusionChunk) {

inst/scripts/icav1_download_and_run.R

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
# helpers for downloading GDS data for local testing
2-
require(dracarys)
2+
require(dracarys, include.only = "ica_token_validate")
33
require(dplyr)
4-
require(readr)
54
require(rportal, include.only = "portaldb_query_workflow")
65
require(glue, include.only = "glue")
76
require(here, include.only = "here")
87

8+
# make sure you have logged into AWS and ICA
9+
c("AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_REGION") |>
10+
rportal::envvar_defined() |>
11+
stopifnot()
12+
icav1_token <- Sys.getenv("ICA_ACCESS_TOKEN") |>
13+
dracarys::ica_token_validate()
14+
# this helps keep annoying reticulate prompt away
15+
Sys.setenv(RETICULATE_PYTHON = Sys.getenv("CONDA_PYTHON_EXE"))
916
# grab rnasum workflow metadata from Athena
1017
athena_rnasum <- function(sbj) {
1118
q_quote <- shQuote(paste(glue("rnasum__{sbj}"), collapse = "|"))
12-
query1 <- glue('WHERE REGEXP_LIKE("wfr_name", {q_quote});')
19+
query1 <- glue('WHERE "type_name" = \'rnasum\' AND REGEXP_LIKE("wfr_name", {q_quote});')
1320
rportal::portaldb_query_workflow(query1)
1421
}
1522

1623
athena_lims <- function(libid) {
17-
query1 <- glue("WHERE REGEXP_LIKE(\"library_id\", '{libid}');")
24+
query1 <- glue('WHERE "type" = \'WTS\' AND REGEXP_LIKE("library_id", \'{libid}\');')
1825
rportal::portaldb_query_limsrow(query1)
1926
}
2027

@@ -37,9 +44,9 @@ rnasum_download <- function(gdsdir, outdir, token, page_size = 200, regexes) {
3744
}
3845

3946
# SBJ IDs of interest
40-
sbj <- "SBJ05637"
41-
lib <- "L2401376"
42-
date1 <- "2024-09-16"
47+
sbj <- "SBJ05690"
48+
lib <- "L2401448"
49+
date1 <- "2024-09-29"
4350
lims_raw <- athena_lims(lib)
4451
pmeta_raw <- athena_rnasum(sbj) |>
4552
rportal::meta_rnasum(status = "Failed")
@@ -71,7 +78,6 @@ rnasum_file_regex <- tibble::tribble(
7178
"manta\\.tsv$", "MantaTsvFile",
7279
"mapping_metrics\\.csv$", "MapMetricsFile"
7380
)
74-
token <- dracarys::ica_token_validate()
7581
outdir <- here::here("nogit/patient_data")
7682

7783
# melt gds_indir columns to get a single column with paths to gds directories
@@ -81,7 +87,7 @@ meta_rnasum <- pmeta |>
8187
dplyr::select(SubjectID, LibraryID, rnasum_dataset, folder_type, gds_indir) |>
8288
dplyr::rowwise() |>
8389
dplyr::mutate(
84-
down = list(rnasum_download(gdsdir = gds_indir, outdir = outdir, token = token, regexes = rnasum_file_regex))
90+
down = list(rnasum_download(gdsdir = gds_indir, outdir = outdir, token = icav1_token, regexes = rnasum_file_regex))
8591
) |>
8692
dplyr::ungroup()
8793

0 commit comments

Comments
 (0)