Collate DEGs detected in DGE analysis outputs, across all celltypes in a dataset (datasets/DGE analysis outputs should have common celltypes as specified below)

gather_celltype_DEGs(
  celltype_correspondence,
  pvalue = 0.05,
  Nperms = 20,
  sampled = "individuals",
  output_path = getwd()
)

Arguments

celltype_correspondence

A named vector that maps a standard cell type label (e.g., "Endo", "Micro") to how that cell type appears in each dataset. Use NA if the cell type is not present in a given dataset.

pvalue

P-value threshold for defining DEGs in the bulk dataset.

Nperms

Number of permutations to perform for each down-sampling level. Default is 20.

sampled

Specifies the unit of down-sampling. Can be either "individuals" or "cells", depending on whether the analysis downsamples across samples or cells. Saves combined list of DEGs (across all cell types) in a subdirectory inside the dataset directory

output_path

A clean directory path where down-sampled outputs and plots will be saved (should contain no subdirectories).