Skip to content

Commit

Permalink
only create supplemental if > 1 cell in object
Browse files Browse the repository at this point in the history
  • Loading branch information
allyhawkins committed Apr 25, 2024
1 parent 2d3d30f commit c74328a
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions bin/sce_qc_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,20 @@ if (opt$celltype_report_file != "") {
stop("Supplemental cell types report template not found.")
}

# render report
rmarkdown::render(
input = opt$celltype_report_template,
output_file = basename(opt$celltype_report_file),
output_dir = dirname(opt$celltype_report_file),
intermediates_dir = tempdir(),
knit_root_dir = tempdir(),
envir = new.env(),
params = list(
library = metadata_list$library_id,
processed_sce = processed_sce
# only render supplemental report if there's more than one cell
if (ncol(processed_sce) > 1) {
# render report
rmarkdown::render(
input = opt$celltype_report_template,
output_file = basename(opt$celltype_report_file),
output_dir = dirname(opt$celltype_report_file),
intermediates_dir = tempdir(),
knit_root_dir = tempdir(),
envir = new.env(),
params = list(
library = metadata_list$library_id,
processed_sce = processed_sce
)
)
)
}
}

0 comments on commit c74328a

Please sign in to comment.