From abfb5597b187314a8c4a3cd62620e1255b1d6ee9 Mon Sep 17 00:00:00 2001 From: pdiakumis Date: Thu, 10 Oct 2024 00:45:08 +1100 Subject: [PATCH] tsov2: ignore SmallVariants_Annotated.json.gz; better dl size info --- R/fs_icav1.R | 2 +- R/fs_s3.R | 11 +++++++++-- R/tsov2.R | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/R/fs_icav1.R b/R/fs_icav1.R index 270c7fe..56c6ad4 100644 --- a/R/fs_icav1.R +++ b/R/fs_icav1.R @@ -189,10 +189,10 @@ dr_gds_download <- function(gdsdir, outdir, token = Sys.getenv("ICA_ACCESS_TOKEN gdspath = .data$path ) |> dplyr::select("type", "bname", "size", "lastmodified", "file_id", "localpath", "gdspath") - # download recognisable dracarys files to outdir//{bname} tot_size <- d |> dplyr::summarise(tot_size = sum(.data$size)) |> dplyr::pull(tot_size) + # download recognisable dracarys files to outdir//{bname} if (!dryrun) { txt <- paste0( "{e('arrow_heading_down')} {nrow(d)} files ({tot_size}): {.file {gdsdir}}\n" diff --git a/R/fs_s3.R b/R/fs_s3.R index eb314ce..f2e3226 100644 --- a/R/fs_s3.R +++ b/R/fs_s3.R @@ -142,10 +142,16 @@ dr_s3_download <- function(s3dir, outdir, max_objects = 100, pattern = NULL, s3path = .data$path ) |> dplyr::select("type", "bname", "size", "lastmodified", "localpath", "s3path") + tot_size <- d |> + dplyr::summarise(tot_size = sum(.data$size)) |> + dplyr::pull(tot_size) # download recognisable dracarys files to outdir//{bname} if (!dryrun) { - cli::cli_alert_info("{date_log()} {e('arrow_heading_down')} Downloading files from {.file {s3dir}}") - d |> + txt <- paste0( + "{e('arrow_heading_down')} {nrow(d)} files ({tot_size}): {.file {s3dir}}\n" + ) + cli::cli_alert_info(txt) + res <- d |> dplyr::rowwise() |> dplyr::mutate( s3bucket = sub("s3://(.*?)/.*", "\\1", .data$s3path), @@ -158,6 +164,7 @@ dr_s3_download <- function(s3dir, outdir, max_objects = 100, pattern = NULL, localpath = normalizePath(.data$localpath) ) |> dplyr::select("type", "bname", "size", "lastmodified", "localpath", "s3path") + return(res) } else { cli::cli_alert_info("{date_log()} {e('camera')} Just list relevant files from {.file {s3dir}}") d |> diff --git a/R/tsov2.R b/R/tsov2.R index 9a41204..5e3e3a7 100644 --- a/R/tsov2.R +++ b/R/tsov2.R @@ -78,7 +78,7 @@ Wf_tso_ctdna_tumor_only_v2 <- R6::R6Class( glue("{res}/{pref}_CombinedVariantOutput\\.tsv$"), "cvo", glue("{res}/{pref}_Fusions\\.csv$"), "fus", glue("{res}/{pref}_MetricsOutput\\.tsv$"), "DOWNLOAD_ONLY", - glue("{res}/{pref}_SmallVariants_Annotated\\.json\\.gz$"), "DOWNLOAD_ONLY", + # glue("{res}/{pref}_SmallVariants_Annotated\\.json\\.gz$"), "DOWNLOAD_ONLY", glue("{li}/SampleAnalysisResults/{pref}_SampleAnalysisResults\\.json$"), "sar" ) # DragenCaller