
Build a PowerPoint summary from an analysis output folder
create_analysis_pptx.RdCollects all PDFs in output_dir, converts them to images with
magick::image_read_pdf(), groups them into labeled sections based on
filename patterns, and assembles a polished .pptx via the
officer package.
Usage
create_analysis_pptx(
output_dir,
params_json = NULL,
out_pptx = NULL,
slide_format = "standard",
slide_width = NULL,
slide_height = NULL,
pdf_density = 150,
include_legends = TRUE,
legend_font_size = 8,
include = NULL,
exclude = NULL
)Arguments
- output_dir
Character. Folder containing PDF figures.
- params_json
Character or
NULL. Path toanalysis_params.json. WhenNULL(default) the function walks up the directory tree fromoutput_diruntil it finds the file - this lets you callcreate_analysis_pptxon a sub-folder (e.g., the CellChat or GSEA output directory) and still get the shared analysis parameters from the parent folder.- out_pptx
Character or
NULL. Where to save the.pptx. WhenNULL(default) a filename is auto-generated from the dataset/subset labels and the current date, saved insideoutput_dir.- slide_format
Character. Slide aspect ratio preset:
"standard"(4:3, 10 × 7.5 in, default) or"widescreen"(16:9, 13.33 × 7.5 in). Override with explicitslide_width/slide_heightif needed.- slide_width, slide_height
Numeric. Explicit slide dimensions in inches. When provided these override
slide_format.- pdf_density
Integer. DPI used when rasterising PDFs. Increase (e.g.
200) for sharper figures at the cost of speed. Default150.- include_legends
Logical. If
TRUE(default), a legend sentence is placed below each figure slide, sourced from the.legendsidecar file beside the PDF or from auto-generated fallback templates.- legend_font_size
Numeric. Font size in points for the legend text box on each slide. Default
8.- include
Character vector or
NULL. Section names to include; all other sections are dropped. WhenNULL(default) all sections are included. PDFs are assigned to sections by filename pattern matching - see.pptx_section_rulesfor the rules. Valid section names:"Quality Control"- QC density plots, doublet scores, filtration barplots"Dimensionality Reduction"- PCA elbow, UMAP before/after Harmony, RNA UMAPs"Cluster Markers"- ComplexHeatmap heatmaps, presto marker tables"Dotplots"- any PDF with "dotplot" in the filename"Cell Type Annotation"- AutoAssignment UMAPs, SingleR, scType, featureheatmaps, assignment helper"All UMAPs"- the combined multi-panel UMAP PDF"Composition"- barplots, chord diagrams, rose/trend plots, iteration-with-bar figures"Feature Maps"- PlotFeaturePlots per-gene UMAPs"Pathway Analysis"- GSEA heatmaps and lollipop PDFs"CellChat"- RunCellChat, CompareCellChat, and RankCellChatPathways output PDFs"Other"- anything not matched by the rules above
- exclude
Character vector or
NULL. Section names to drop (applied afterinclude).NULLexcludes nothing. Same valid values asinclude. Typical use:exclude = c("Feature Maps", "CellChat")to keep the main analysis compact while running separate sub-folder PPTXs for those heavy sections.
Details
A parameters / methods overview slide is generated automatically from
analysis_params.json (written by log_analysis_params()).