From bcb16a56a71b3506ad17ee3e23428c35261f3d4e Mon Sep 17 00:00:00 2001 From: Ally Hawkins Date: Thu, 9 Jan 2025 10:24:56 -0600 Subject: [PATCH] compress output --- analyses/cell-type-consensus/assign-consensus-celltypes.sh | 2 +- .../scripts/04-combine-celltype-tables.R | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/analyses/cell-type-consensus/assign-consensus-celltypes.sh b/analyses/cell-type-consensus/assign-consensus-celltypes.sh index facc31ebf..c48e5c680 100755 --- a/analyses/cell-type-consensus/assign-consensus-celltypes.sh +++ b/analyses/cell-type-consensus/assign-consensus-celltypes.sh @@ -15,7 +15,7 @@ cd $(dirname "$0") data_dir="../../data/current" # path to save consensus results -scpca_consensus_assignments_file="results/scpca-consensus-celltype-assignments.tsv" +scpca_consensus_assignments_file="results/scpca-consensus-celltype-assignments.tsv.gz" # directory to store all individual tsv files celltype_tsv_dir="results/original-celltype-assignments" mkdir -p ${celltype_tsv_dir} diff --git a/analyses/cell-type-consensus/scripts/04-combine-celltype-tables.R b/analyses/cell-type-consensus/scripts/04-combine-celltype-tables.R index 59e199e07..602340f56 100644 --- a/analyses/cell-type-consensus/scripts/04-combine-celltype-tables.R +++ b/analyses/cell-type-consensus/scripts/04-combine-celltype-tables.R @@ -34,7 +34,8 @@ option_list <- list( make_option( opt_str = c("--output_file"), type = "character", - help = "Path to file where combined TSV file will be saved, must end in `.tsv`" + help = "Path to file where combined TSV file will be saved. + File name must end in either `.tsv` or `.tsv.gz` to save a compressed TSV file" ) ) @@ -46,7 +47,8 @@ opt <- parse_args(OptionParser(option_list = option_list)) # make sure reference files exist stopifnot( "panglao reference file does not exist" = file.exists(opt$panglao_ref_file), - "cell type consensus reference file does not exist" = file.exists(opt$consensus_ref_file) + "cell type consensus reference file does not exist" = file.exists(opt$consensus_ref_file), + "output file must end in `.tsv` or `.tsv.gz`" = stringr::str_detect(opt$output_file, ".tsv|.tsv.gz") ) # read in ref files