Skip to contents

Saves a named list of DE or GO enrichment results into cluster-specific CSV files. For DE results, each list element is written directly. For GO results, the GeneRatio column is parsed into numeric numerator/denominator columns, and results can optionally be split by regulation direction.

Usage

write_de_results(
  de_list,
  outSubDir,
  type = c("DE", "GO"),
  split_direction = NULL
)

Arguments

de_list

Named list of data frames (for type = "DE") or enrichResult objects / direction-split lists (for type = "GO").

outSubDir

Character path to the output directory. Created recursively if it does not exist.

type

Character, one of "DE" or "GO". Controls output filename suffixes and parsing logic.

split_direction

Logical or NULL. Required when type = "GO". If TRUE, each element of de_list is expected to be a list with sub-elements $up and $down (each an enrichResult). If FALSE, elements are single enrichResult objects.

Value

invisible(NULL). Called for its side effect of writing CSV files.

Output files

  • DE mode: <outSubDir>/<cluster>_DE_Results.csv

  • GO mode (no split): <outSubDir>/<cluster>_GO_ORA_Results.csv

  • GO mode (split): <outSubDir>/<cluster>_GO_ORA_up_Results.csv and ..._down_Results.csv