Extracts differential expression analysis results. Function getDeaGenes() is a wrapper around getDeaResultsDf() and returns only gene names in a character vector.

getDeaGenes(
  object,
  across = getDefaultGrouping(object),
  across_subset = NULL,
  method_de = "wilcox",
  max_adj_pval = NULL,
  min_lfc = 0,
  n_highest_lfc = NULL,
  n_lowest_pval = NULL,
  flatten = TRUE,
  assay_name = activeAssay(object),
  ...
)

getDeaResultsDf(
  object,
  across = getDefaultGrouping(object),
  across_subset = NULL,
  relevel = FALSE,
  method_de = "wilcox",
  max_adj_pval = NULL,
  min_lfc = NULL,
  n_highest_lfc = NULL,
  n_lowest_pval = NULL,
  stop_if_null = TRUE,
  assay_name = activeAssay(object),
  ...
)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

across

Character value or NULL. Specifies the grouping variable of interest.

Use getGroupingOptions() to obtain all variable names that group the barcode spots of your object in a certain manner.

across_subset

Character vector or NULL. Specifies the particular groups of interest the grouping variable specified in argument across contains.

If set to NULL all of them are chosen. You can prefix groups you are NOT interested in with a '-'. (Saves writing if there are more groups you are interested in than groups you are not interested in.)

Use getGroupNames() to obtain all valid input options.

method_de

Character value. Denotes the method to according to which the de-analysis is performed. Given to argument test.use of the Seurat::FindAllMarkers()-function. Run SPATA::dea_methods to obtain all valid input options.

max_adj_pval

Numeric value. Sets the threshold for adjusted p-values. All genes with adjusted p-values above that threshold are ignored.

min_lfc

Numeric value. Sets the threshold for average log fold change. All genes with an average log fold change below that threshold are ignored.

n_highest_lfc

Numeric value. Affects the total number of genes that are kept. See details.

n_lowest_pval

Numeric value. Affects the total number of genes that are kept. See details.

assay_name

Only relevant if the SPATA2 object contains more than one assay: Denotes the assay of interest and thus the molecular modality to use. Defaults to the active assay as set by activateAssay().

...

Used to absorb deprecated arguments or functions.

relevel

Logical value. If set to TRUE the input order of across_subset determines the order in which the groups of interest are displayed. Groups that are not included are dropped which affects the colors with which they are displayed.

Value

A data.frame:

  • gene Character. The differentially expressed genes.

  • 'across' Character. The grouping across which the analysis was performed. The variable/column name is equal to the input for argument across.

  • avg_logFC Numeric. The average log-fold change to which the belonging gene was differentially expressed..

  • p_val Numeric. The p-values.

  • p_val_adj Numeric. The adjusted p-values.

Details

The de-data.frame is processed such that the following steps are performed for every experimental group.

  1. Discards genes with avg_logFC-values that are either infinite or negative

  2. Discards genes with adjusted p-values above the threshold set with max_adj_pval

  3. Discard genes with average log fold change below the treshold set with min_lfc

  4. Slices the data.frame in order that for every experimental group:

    1. the n genes with the highest avg_logFC-values are kept where n = n_highest_lfc

    2. the n genes with the lowest p_val_adj-values are kept where n = n_lowest_pval

  5. Arranges the genes according to the highest avg_logFC-values