runDEA.RdThis 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(...)An object of class SPATA2 or, in case of S4 generics,
objects of classes for which a method has been defined.
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.
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.
Logical. If TRUE, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
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()
Given to corresponding arguments of Seurat::FindAllMarkers().
The updated input object, containing the added, removed or computed results.
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().
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)