Skip to content

Commit

Permalink
Merge pull request #121 from umccr/tidy_update
Browse files Browse the repository at this point in the history
Initial bcl_convert refactor
  • Loading branch information
pdiakumis authored Aug 14, 2024
2 parents 9e013f8 + c9f4a28 commit 38b861e
Show file tree
Hide file tree
Showing 21 changed files with 594 additions and 268 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
^setup\.py$
^vignettes$
inst/rmd/umccr_portal/html
inst/rmd/umccr_workflows/alignment_qc/html
inst/rmd/umccr_workflows/alignment_qc/nogit
inst/rmd/umccr_workflows/bcl_convert/html
inst/rmd/umccr_workflows/interop/html
inst/rmd/umccr_workflows/umccrise/html
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/conda_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: |
dvc pull
ls -l inst/extdata/*
conda mambabuild --R 4.2 ${recipe_path} -c conda-forge --token ${atoken}
conda mambabuild --R 4.3.3 ${recipe_path} -c conda-forge --token ${atoken}
- name: 🔒 Conda lock
run: |
conda-lock lock --file ${env_yaml_path}/dracarys.yaml -p linux-64
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🐳 Docker img build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
tags: ghcr.io/${{ github.repository }}:${{ env.VERSION }}
context: . # yes, dot
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Imports:
tibble,
tidyr
Suggests:
SparkR,
rmarkdown,
SparkR,
testthat (>= 3.0.0)
Roxygen: list(markdown = TRUE,
roclets = c("namespace", "rd", "roxytest::testthat_roclet"))
Expand Down
8 changes: 4 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ export(UmHrdetectTsvFile)
export(UmQcSumFile)
export(UmSigsSnvFile)
export(VCMetricsFile)
export(Wf)
export(Wf_bcl_convert)
export(Wf_tso_ctdna_tumor_only)
export(WgsContigMeanCovFile)
export(WgsCoverageMetricsFile)
export(WgsFineHistFile)
export(WgsHistFile)
export(bcftools_parse_vcf)
export(bcftools_parse_vcf_regions)
export(bclconvert_read_adaptermetrics)
export(bclconvert_read_demultiplexstats)
export(bclconvert_read_indexhoppingcounts)
export(bclconvert_read_topunknownbarcodes)
export(date_log)
export(dr_func_eval)
export(dr_gds_download)
Expand All @@ -53,6 +52,7 @@ export(gds_file_download)
export(gds_file_download_api)
export(gds_file_presignedurl)
export(gds_files_list)
export(gds_files_list_fastq)
export(gds_files_list_filter_relevant)
export(gds_volumes_list)
export(ica_token_validate)
Expand Down
85 changes: 85 additions & 0 deletions R/Wf.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#' Workflow R6 Class
#'
#' @description Workflow is a base R6 class representing a bioinformatic
#' workflow run from a UMCCR workflow manager.
#'
#' @examples
#' p1 <- system.file("extdata/portaldb_workflow_top4.rds", package = "rportal") |>
#' readRDS() |>
#' dplyr::filter(type_name == "umccrise") |>
#' dplyr::slice(1)
#' w <- Wf$new(
#' prid = p1$portal_run_id, type = p1$type_name, start = p1$start, end = p1$end,
#' status = p1$end_status, input = p1$input, output = p1$output
#' )
#' w
#' @export
Wf <- R6::R6Class(
"Wf",
public = list(
#' @field prid Portal run ID.
#' @field type Workflow type.
#' @field start Workflow start datetime.
#' @field end Workflow end datetime.
#' @field status Workflow end status.
#' @field input Workflow input JSON string.
#' @field output Workflow output JSON string.
prid = NULL,
type = NULL,
start = NULL,
end = NULL,
status = NULL,
input = NULL,
output = NULL,
#' @description Create a new Workflow object.
#' @param prid Portal run ID.
#' @param type Workflow type.
#' @param start Workflow start datetime.
#' @param end Workflow end datetime.
#' @param status Workflow end status.
#' @param input Workflow input JSON string.
#' @param output Workflow output JSON string.
initialize = function(prid = NULL, type = NULL, start = NULL, end = NULL,
status = NULL, input = NULL, output = NULL) {
types <- c(
"bcl_convert",
"tso_ctdna_tumor_only",
"wgs_alignment_qc",
"wts_alignment_qc",
"wts_tumor_only",
"wgs_tumor_normal",
"umccrise",
"rnasum",
"star_alignment",
"oncoanalyser_wts",
"oncoanalyser_wgs",
"oncoanalyser_wgts_existing_both",
"sash"
)
assertthat::assert_that(
type %in% types
)
self$prid <- prid
self$type <- type
self$start <- start
self$end <- end
self$status <- status
self$input <- input
self$output <- output
},
#' @description Print details about the Workflow.
#' @param ... (ignored).
print = function(...) {
res <- tibble::tribble(
~var, ~value,
"prid", self$prid,
"type", self$type,
"start", as.character(self$start),
"end", as.character(self$end),
"status", self$status,
)
print(res)
invisible(self)
}
) # end public
)
Loading

0 comments on commit 38b861e

Please sign in to comment.