Skip to content

Commit

Permalink
Wf: fix writer
Browse files Browse the repository at this point in the history
  • Loading branch information
pdiakumis committed Sep 21, 2024
1 parent bb854c2 commit 108c07f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
5 changes: 2 additions & 3 deletions R/Wf.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
16 changes: 12 additions & 4 deletions R/tso.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"
#' )
Expand Down

0 comments on commit 108c07f

Please sign in to comment.