This function takes an input of samples and pathways to compare gene set perturbations over different conditions with SCPA.

compare_pathways(
  samples,
  pathways,
  downsample = 500,
  min_genes = 15,
  max_genes = 500,
  parallel = FALSE,
  cores = NULL
)

Arguments

samples

List of samples, each supplied as an expression matrix with cells in columns and genes in rows.

pathways

Pathways and their genes with each pathway in a separate list. For formatting of gene lists, see documentation at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html

downsample

Option to downsample cell numbers. Defaults to 500 cells per condition. If a population has < 500 cells, all cells from that condition are used.

min_genes

Gene sets with fewer than this number of genes will be excluded

max_genes

Gene sets with more than this number of genes will be excluded

parallel

Should parallel processing be used?

cores

The number of cores used for parallel processing

Value

Statistical results from the SCPA analysis. The qval should be the primary metric that is used to interpret pathway differences i.e. a higher qval translates to larger pathway differences between conditions. If only two samples are provided, a fold change (FC) enrichment score will also be calculated. The FC statistic is generated from a running sum of mean changes in gene expression from all genes of the pathway. It's calculated from average pathway expression in population1 - population2, so a negative FC means the pathway is higher in population2.

Examples

if (FALSE) {
scpa_result <- compare_pathways(
     list(sample1, sample2, sample3),
     pathways = pathways)
}