Skip to contents

Recursively scans output_dir for every analysis_params.json written by scSidekick's Run*() functions and log_analysis_params(), pulls out every distinct methods-text paragraph (the base preprocessing summary plus each method-specific one - GSEA, CellChat, Slingshot, cNMF, ...), deduplicates text that got inherited into multiple sub-folder files via the shared-base merge (see log_analysis_params()), and writes the result as one clean, ready-to-quote text file - one paragraph per analysis step, in the order those steps were actually run.

Usage

SummarizeMethods(
  output_dir,
  seurat_object = NULL,
  out_file = NULL,
  recursive = TRUE
)

Arguments

output_dir

Character. Top-level folder to search (recursively) for analysis_params.json files.

seurat_object

A Seurat object, optional. Used as a fallback: if no analysis_params.json is found anywhere under output_dir (or none of the files found include the base preprocessing paragraph - e.g. log_analysis_params()/PrepObject() was never called even though individual Run*() steps were), the base paragraph is reconstructed directly from the object's own command history via ExtractMethods().

out_file

Character or NULL. Where to write the combined methods text. NULL (default) saves "Methods_Summary.txt" inside output_dir.

recursive

Logical. Search subfolders of output_dir too. Default TRUE.

Value

Invisibly, the combined methods text (also written to out_file).

Examples

if (FALSE) { # \dontrun{
# After running PrepObject(), RunGSEA(), RunCellChat(), etc. into the
# same project folder:
SummarizeMethods("./Figures")

# If the base preprocessing paragraph was never saved (no PrepObject()/
# log_analysis_params() call), reconstruct it from the object:
SummarizeMethods("./Figures", seurat_object = SeuratObj)
} # }