From 108c07f64a4f0f8d9f12cbfdf13bf18be423a868 Mon Sep 17 00:00:00 2001 From: pdiakumis Date: Sat, 21 Sep 2024 12:14:06 +1000 Subject: [PATCH] Wf: fix writer --- R/Wf.R | 5 ++--- R/tso.R | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/R/Wf.R b/R/Wf.R index 6863046..128aabf 100644 --- a/R/Wf.R +++ b/R/Wf.R @@ -213,12 +213,11 @@ Wf <- R6::R6Class( d_write <- x |> dplyr::rowwise() |> dplyr::mutate( - section = sub("read_", "", .data$type), - p = glue("{prefix}_{.data$section}"), + p = glue("{prefix}_{.data$name}"), out = list(write_dracarys(obj = .data$data, prefix = .data$p, out_format = format, drid = drid)) ) |> dplyr::ungroup() |> - dplyr::select("section", "data") |> + dplyr::select("name", "data") |> tibble::deframe() invisible(d_write) } diff --git a/R/tso.R b/R/tso.R index 65fb371..68dcb1e 100644 --- a/R/tso.R +++ b/R/tso.R @@ -19,13 +19,21 @@ #' t1$list_files_filter_relevant(max_files = 300) #' d <- t1$download_files(max_files = 100, dryrun = F) #' d_tidy <- t1$tidy_files(d) +#' d_write <- t1$write( +#' d_tidy, +#' outdir = file.path(p, "dracarys_tidy"), +#' prefix = prefix, +#' format = "tsv" +#' ) #' #' #---- GDS ----# #' p <- file.path( -#' "gds://production/analysis_data/SBJ04651/tso_ctdna_tumor_only", -#' "20240223d1951163/L2400183/Results" +#' "gds://production/analysis_data/SBJ05563/tso_ctdna_tumor_only", +#' "20240914d41300cd/L2401388/Results" #' ) -#' +#' SampleID <- "PRJ241446" +#' LibraryID <- "L2401388" +#' prefix <- glue("{SampleID}__{LibraryID}") #' outdir <- file.path(sub("gds:/", "~/icav1/g", p)) #' token <- Sys.getenv("ICA_ACCESS_TOKEN") #' t2 <- Wf_tso_ctdna_tumor_only$new(path = p, SampleID = SampleID, LibraryID = LibraryID) @@ -38,7 +46,7 @@ #' d_tidy <- t2$tidy_files(d) #' d_write <- t2$write( #' d_tidy, -#' outdir = file.path(p, "dracarys_tidy"), +#' outdir = file.path(outdir, "dracarys_tidy"), #' prefix = prefix, #' format = "tsv" #' )