Skip to content

Commit

Permalink
meta: add account argument
Browse files Browse the repository at this point in the history
  • Loading branch information
pdiakumis committed Sep 18, 2023
1 parent 951ea64 commit e90eb6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/portal_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ meta_main_cols <- function() {
#' \dontrun{
#' portal_meta_read(params = "&type_name=rnasum", rows = 4)
#' }
portal_meta_read <- function(pmeta = NULL, rows = 100, params = "") {
portal_meta_read <- function(pmeta = NULL, rows = 100, params = "", account = "prod") {
au_tz <- "Australia/Melbourne"
utc_tz <- "UTC"
if (!is.null(pmeta)) {
Expand Down Expand Up @@ -505,7 +505,7 @@ portal_meta_read <- function(pmeta = NULL, rows = 100, params = "") {
}
} # else pmeta is NULL, so read via portal API

base_url <- "https://api.portal.prod.umccr.org/iam"
base_url <- glue("https://api.portal.{account}.umccr.org/iam")
url1 <- utils::URLencode(glue("{base_url}/workflows?rowsPerPage={rows}{params}"))
awscurl_cmd <- glue(
"awscurl '{url1}' ",
Expand Down
12 changes: 6 additions & 6 deletions inst/rmd/umccr_portal/portal_summary.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ get_colours <- function(nc) {
clrs[seq_len(nc)]
}
get_sbj_url <- function(x, colour = NULL) {
sbj_url <- glue("https://portal.umccr.org/subjects/{x}/overview")
get_sbj_url <- function(x, colour = NULL, account = "") {
sbj_url <- glue("https://portal.{account}umccr.org/subjects/{x}/overview")
if (!is.null(colour)) {
return(glue("<a href={sbj_url} style='background-color:{colour}'>{x}</a>"))
}
Expand All @@ -113,8 +113,8 @@ get_sbj_url <- function(x, colour = NULL) {
```{r vars}
# options(width = 150)
fmt1 <- "%Y-%m-%dT%H:%M:%S"
date_start <- as.POSIXct("2023-09-02T00:00:01", format = fmt1)
date_end <- as.POSIXct("2023-09-03T23:59:59", format = fmt1)
date_start <- as.POSIXct("2023-09-15T00:00:01", format = fmt1)
date_end <- as.POSIXct("2023-09-18T23:59:59", format = fmt1)
wf_order <- c(
"bcl_convert",
"tso_ctdna_tumor_only",
Expand All @@ -130,7 +130,7 @@ lims_rds <- here(glue("nogit/data_portal/lims/{as.Date(date_end)}.rds"))
# saveRDS(lims_raw, file = lims_rds)
lims_raw <- readr::read_rds(lims_rds)
pmeta_rds <- here(glue("nogit/data_portal/workflows/{as.Date(date_end)}.rds"))
# pmeta_raw <- dracarys::portal_meta_read(rows = 65)
# pmeta_raw <- dracarys::portal_meta_read(rows = 80, account = "stg")
# saveRDS(pmeta_raw, file = pmeta_rds)
pmeta_raw <- readr::read_rds(pmeta_rds)
pmeta <- pmeta_raw |>
Expand Down Expand Up @@ -161,7 +161,7 @@ unique_sbj <- sort(unique(pmeta_sumy$sbjid))
clrs1 <- get_colours(length(unique_sbj)) |>
purrr::set_names(unique_sbj) |>
tibble::enframe(name = "sbjid", value = "color") |>
dplyr::mutate(sbj_url = get_sbj_url(.data$sbjid, colour = .data$color))
dplyr::mutate(sbj_url = get_sbj_url(.data$sbjid, colour = .data$color, account = "stg."))
pmeta_sumy_count <- pmeta_sumy |>
dplyr::count(type_name, .drop = FALSE) |>
tibble::deframe()
Expand Down

0 comments on commit e90eb6e

Please sign in to comment.