Skip to content

Commit

Permalink
Merge pull request #28 from umccr/cttso_payload
Browse files Browse the repository at this point in the history
Add cttsov2 tidy payload
  • Loading branch information
pdiakumis authored Nov 14, 2024
2 parents 3f3c5d3 + ad4f4e1 commit c720ba9
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 8 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export(orca_query_url)
export(orca_wfrid2payload)
export(orca_wfrid2state)
export(orca_workflow_list)
export(pld_cttsov2)
export(pld_umccrise)
export(pld_wts)
export(portaldb_query)
Expand Down
44 changes: 44 additions & 0 deletions R/meta_tso_ctdna_tumor_only.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,47 @@ meta_tso_ctdna_tumor_only <- function(pmeta, status = c("Succeeded")) {
cttso_rerun = "rerun"
)
}

#' Payload Tidy tso
#'
#' @param pld List with tso workflow parameters.
#'
#' @return A tidy tibble.
#' @export
pld_cttsov2 <- function(pld) {
payload_okay(pld)
pdata <- pld[["data"]]
id <- pld[["orcabusId"]]
# collapse FastqListRowIds into single string
pdata[["tags"]][["fastqListRowIds"]] <- pdata[["tags"]][["fastqListRowIds"]] |>
paste(collapse = ", ")
tags <- pdata[["tags"]] |>
tibble::as_tibble_row() |>
dplyr::mutate(orcabusId = id)
# ignore verbose inputs$samplesheet
inputs <- pdata[["inputs"]]
inputs[["samplesheet"]] <- NULL
inputs[["fastqListRows"]] <- inputs[["fastqListRows"]] |>
purrr::map(tibble::as_tibble_row) |>
dplyr::bind_rows()
inputs[["fastqListRows"]] <- list(inputs[["fastqListRows"]])
inputs <- inputs |>
tibble::as_tibble_row() |>
rlang::set_names(\(x) glue("input_{x}")) |>
dplyr::mutate(orcabusId = id)
outputs <- pdata[["outputs"]] |>
purrr::map(\(x) x |> stringr::str_replace("/$", "")) |>
tibble::as_tibble_row() |>
rlang::set_names(\(x) glue("output_{x}")) |>
dplyr::mutate(orcabusId = id)
engpar <- pdata[["engineParameters"]] |>
purrr::map(\(x) x |> stringr::str_replace("/$", "")) |>
tibble::as_tibble_row() |>
rlang::set_names(\(x) glue("engparam_{x}")) |>
dplyr::mutate(orcabusId = id)
d <- tags |>
dplyr::left_join(inputs, by = "orcabusId") |>
dplyr::left_join(outputs, by = "orcabusId") |>
dplyr::left_join(engpar, by = "orcabusId")
return(d)
}
2 changes: 1 addition & 1 deletion R/meta_umccrise.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ meta_umccrise <- function(pmeta, status = "Succeeded") {
)
}

#' Payload for umccrise workflow
#' Payload Tidy umccrise
#'
#' @param pld List with umccrise workflow parameters.
#'
Expand Down
4 changes: 2 additions & 2 deletions R/meta_wts_tumor_only.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ meta_wts_tumor_only <- function(pmeta, status = "Succeeded") {
)
}

#' Payload for WTS workflow
#' Payload Tidy wts
#'
#' @param pld List with WTS workflow parameters.
#' @param pld List with wts workflow parameters.
#'
#' @return A tidy tibble.
#' @export
Expand Down
2 changes: 2 additions & 0 deletions R/orcabus.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ orca_wfrid2state <- function(wfrid, token, stage = "prod") {
#' token <- orca_jwt() |> jwt_validate()
#' wfrid <- "wfr.01JCARAVTXKG5581SRA1HKBTD3"
#' wfrid <- "wfr.01JCA5DZFD0T4MFQX0HHEEFBCH" # wts
#' wfrid <- "wfr.01JBX361HKV0V9WS96RAFG135T" # cttsov2
#' p <- orca_wfrid2payload(wfrid = wfrid, token = token)
#' }
#'
Expand Down Expand Up @@ -139,6 +140,7 @@ orca_prid2wfpayload <- function(prid, token, stage = "prod") {
#' libid <- "L2401591" # wgs
#' libid <- "L2401074" # wts # nothing
#' libid <- "L2401577" # wts
#' libid <- "L2401558" # cttsov2
#' wf_name <- NULL
#' d <- orca_libid2workflows(libid = libid, token = token, wf_name = wf_name, page_size = 20)
#' }
Expand Down
1 change: 1 addition & 0 deletions man/orca_libid2workflows.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/orca_wfrid2payload.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions man/pld_cttsov2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/pld_umccrise.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/pld_wts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c720ba9

Please sign in to comment.