From de6ca34031286ec0bdad7575294719c4558416fb Mon Sep 17 00:00:00 2001 From: pdiakumis Date: Tue, 1 Oct 2024 00:06:33 +1000 Subject: [PATCH] alignqc dl_and_tidy.R: add envvar checker --- .../alignment_qc/dl_and_tidy.R | 12 ++++++++++- .../umccr_workflows/alignment_qc/summary.Rmd | 20 ++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/inst/rmd/umccr_workflows/alignment_qc/dl_and_tidy.R b/inst/rmd/umccr_workflows/alignment_qc/dl_and_tidy.R index 836e7f2..f5ed36b 100755 --- a/inst/rmd/umccr_workflows/alignment_qc/dl_and_tidy.R +++ b/inst/rmd/umccr_workflows/alignment_qc/dl_and_tidy.R @@ -8,6 +8,15 @@ require(rportal, include.only = c("portaldb_query_workflow")) } +# make sure you have logged into AWS and ICA +c("AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_REGION") |> + rportal::envvar_defined() |> + stopifnot() +icav1_token <- Sys.getenv("ICA_ACCESS_TOKEN") |> + dracarys::ica_token_validate() +# this helps keep annoying reticulate prompt away +Sys.setenv(RETICULATE_PYTHON = Sys.getenv("CONDA_PYTHON_EXE")) + query_workflow_alignqc <- function(start_date) { wfs <- c("wgs_alignment_qc", "wts_alignment_qc") |> shQuote() |> @@ -28,7 +37,7 @@ query_limsrow_libids <- function(libids) { } # first read in the workflows table, extract metadata, then join with lims -start_date <- "2024-09-09" +start_date <- "2024-09-27" p_raw <- query_workflow_alignqc(start_date) wgs <- p_raw |> @@ -76,6 +85,7 @@ meta <- d |> "echo ---{.data$rownum}--- && ", "{tidy_script} tidy --in_dir {.data$indir} ", "--out_dir {.data$outdir} --prefix {.data$SampleID} ", + "--token {icav1_token} ", "--format rds" ) ) diff --git a/inst/rmd/umccr_workflows/alignment_qc/summary.Rmd b/inst/rmd/umccr_workflows/alignment_qc/summary.Rmd index 7c44233..b40fbe7 100644 --- a/inst/rmd/umccr_workflows/alignment_qc/summary.Rmd +++ b/inst/rmd/umccr_workflows/alignment_qc/summary.Rmd @@ -9,7 +9,7 @@ output: highlight: kate params: title: "UMCCR Alignment QC Summary Report" - meta: !r here::here("inst/rmd/umccr_workflows/alignment_qc/nogit/meta/2024-09-14_wgts.rds") + meta: !r here::here("inst/rmd/umccr_workflows/alignment_qc/nogit/meta/2024-09-27_wgts.rds") description: "UMCCR Alignment QC Summary Report" title: "`r params$title`" --- @@ -401,7 +401,8 @@ f1_plot <- ggplot() + subtitle = glue("Percentage of reads with average quality scores. Shows if\na subset of reads has poor quality.") ) -plotly::ggplotly(f1_plot) +# plotly::ggplotly(f1_plot) +f1_plot ``` ### GC Content ('Per-Sequence GC Content') @@ -426,7 +427,8 @@ gc_data_plot <- gc_data |> title = "Read GC Content", subtitle = glue("Total number of reads with each GC content\npercentile between 0% and 100%") ) -plotly::ggplotly(gc_data_plot) +# plotly::ggplotly(gc_data_plot) +gc_data_plot ``` ### GC Content Quality ('GC Content Mean Quality Scores') @@ -452,7 +454,8 @@ f1_plot <- ggplot() + title = "GC Content Quality", subtitle = glue("Average Phred-scale read mean quality for reads with\neach GC content percentile between 0% and 100%.") ) -plotly::ggplotly(f1_plot) +# plotly::ggplotly(f1_plot) +f1_plot ``` ### Positional Base Content ('Per-Position Sequence Content') @@ -543,7 +546,8 @@ read_len_plot <- read_len |> title = "Read Lengths", subtitle = glue("Read percentage with each observed length.") ) -plotly::ggplotly(read_len_plot) +# plotly::ggplotly(read_len_plot) +read_len_plot ``` ### Sequence Positions ('Adapter Content') @@ -609,7 +613,8 @@ flp <- fl1 |> panel.grid.minor = ggplot2::element_blank(), plot.title = ggplot2::element_text(colour = "#2c3e50", size = 14, face = "bold") ) -plotly::ggplotly(flp) +# plotly::ggplotly(flp) +flp ``` --- @@ -633,7 +638,8 @@ d_pl_plot <- d_pl_plot_data |> geom_line(aes(colour = umccrid, group = umccrid), na.rm = TRUE) + geom_point(aes(colour = umccrid), na.rm = TRUE) + labs(title = "Chromosome Median / Autosomal Median") -plotly::ggplotly(d_pl_plot) +# plotly::ggplotly(d_pl_plot) +d_pl_plot ```