This function makes use of Seurat::FindAllMarkers() to identify the differently expressed variables across the groups of the grouping variable denoted in the argument across.

See details for more.

runDEA(
  object,
  across,
  method_de = NULL,
  verbose = NULL,
  base = 2,
  assay_name = activeAssay(object),
  ...
)

runDeAnalysis(...)

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.

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.

verbose

Logical. If TRUE, informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

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().

...

Additional arguments given to Seurat::FindAllMarkers()

fc_name, base

Given to corresponding arguments of Seurat::FindAllMarkers().

Value

The updated input object, containing the added, removed or computed results.

Details

This function is a wrapper around the DEA pipeline from the Seurat package. It creates a temporary Seurat object via Seurat::CreateSeuratObject(), and Seurat::SCTransform(). Then, Seurat::FindAllMarkers() is run. The output data.frame is stored in the SPATA2 object which is returned at the end.

If across and/or method_de are vectors instead of single values runDEA() iterates over all combinations in a for-loop and stores the results in the respective slots. (e.g.: If across = 'seurat_clusters' and method_de = c('wilcox', 'bimod') the function computes the differently expressed genes across all groups found in the feature variable seurat_clusters according to method wilcox and stores the results in the respective slot. Then it does the same according to method bimod.)

The results are obtainable via getDeaResults(), getDeaResultsDf() and getDeaGenes().

Examples


library(SPATA2)

data("example_data")
object <- example_data$object_UKF269T_diet

getGroupingOptions(object)

plotSurface(object, color_by = "histology")

object <- runDEA(object, across = "histology")

# extract best marker gene for each group by lowest p-value
top_marker_genes <-
  getDeaGenes(object, across = "histology", n_lowest_pval = 1)

print(top_marker_genes)

plotSurfaceComparison(object, color_by = top_marker_genes)