From 951ea64c3ca97bcf28860d2aa18a62061f34ed20 Mon Sep 17 00:00:00 2001 From: pdiakumis Date: Sun, 17 Sep 2023 21:14:07 +1000 Subject: [PATCH] meta: handle failed wgs_alignment_qc --- R/portal_meta.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/portal_meta.R b/R/portal_meta.R index 5a16bcd..3bb0dbe 100644 --- a/R/portal_meta.R +++ b/R/portal_meta.R @@ -161,7 +161,7 @@ meta_rnasum <- function(pmeta, status = "Succeeded") { d |> dplyr::select( dplyr::all_of(meta_main_cols()), - -c("sequence_run", "batch_run"), # NA for rnasum + -dplyr::any_of(c("sequence_run", "batch_run")), # NA for rnasum SubjectID = "sbjid1", LibraryID = "libid1", SampleID = "rnasum_sample_name", @@ -206,8 +206,8 @@ meta_wgs_alignment_qc <- function(pmeta, status = "Succeeded") { lane = purrr::map_int(.data$input, list("fastq_list_rows", "lane")), lane = as.character(.data$lane), # output - gds_outdir_dragen = purrr::map_chr(.data$output, list("dragen_alignment_output_directory", "location")), - gds_outdir_multiqc = purrr::map_chr(.data$output, list("multiqc_output_directory", "location")), + gds_outdir_dragen = purrr::map_chr(.data$output, list("dragen_alignment_output_directory", "location"), .default = NA), + gds_outdir_multiqc = purrr::map_chr(.data$output, list("multiqc_output_directory", "location"), .default = NA), SubjectID = sub("umccr__automated__wgs_alignment_qc__(SBJ.*)__L.*", "\\1", .data$wfr_name), ) d |> @@ -275,7 +275,7 @@ meta_wgs_tumor_normal <- function(pmeta, status = "Succeeded") { d |> dplyr::select( dplyr::all_of(meta_main_cols()), - -c("sequence_run", "batch_run"), # NA for wgs_tumor_normal + -dplyr::any_of(c("sequence_run", "batch_run")), # NA for wgs_tumor_normal "SubjectID", "LibraryID_tumor", "LibraryID_normal", @@ -373,7 +373,7 @@ meta_umccrise <- function(pmeta, status = "Succeeded") { d |> dplyr::select( meta_main_cols(), - -c("sequence_run", "batch_run"), # NA for umccrise + -dplyr::any_of(c("sequence_run", "batch_run")), # NA for umccrise "SubjectID", "LibraryID_tumor", "LibraryID_normal", @@ -448,7 +448,7 @@ meta_io_fromjson <- function(pmeta) { meta_main_cols <- function() { c( - "id", "wfr_name", "wfr_id", "version", "end_status", "sequence_run", "batch_run", + "id", "wfr_name", "wfr_id", "version", "end_status", # "sequence_run", "batch_run", "start", "end", "portal_run_id" ) }