Skip to content

Commit

Permalink
alignqc dl_and_tidy.R: add envvar checker
Browse files Browse the repository at this point in the history
  • Loading branch information
pdiakumis committed Sep 30, 2024
1 parent 52bca17 commit de6ca34
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
12 changes: 11 additions & 1 deletion inst/rmd/umccr_workflows/alignment_qc/dl_and_tidy.R
Original file line number Diff line number Diff line change
Expand Up @@ -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() |>
Expand All @@ -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 |>
Expand Down Expand Up @@ -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"
)
)
Expand Down
20 changes: 13 additions & 7 deletions inst/rmd/umccr_workflows/alignment_qc/summary.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
---
Expand Down Expand Up @@ -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')
Expand All @@ -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')
Expand All @@ -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')
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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
```

---
Expand All @@ -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
```


Expand Down

0 comments on commit de6ca34

Please sign in to comment.