Visualizes results of gene set enrichment analysis with dot plots.

plotGseaDotPlot(
  object,
  across = getDefaultGrouping(object, verbose = TRUE, "across"),
  across_subset = NULL,
  relevel = NULL,
  method_de = NULL,
  by_group = TRUE,
  n_gsets = 20,
  signif_var = "fdr",
  signif_threshold = 0.05,
  alpha_by = NULL,
  alpha_trans = "reverse",
  color_by = "fdr",
  color_trans = "reverse",
  size_by = "fdr",
  size_trans = "reverse",
  pt_alpha = 0.9,
  pt_size = 2,
  pt_color = "blue4",
  pt_clrsp = "plasma",
  force_gsets = NULL,
  force_opt = "add",
  remove = "^.+?(?=_)",
  remove_gsets = NULL,
  replace = c("_", " "),
  arrange_gsets = TRUE,
  reverse = TRUE,
  reverse_within = FALSE,
  scientific = TRUE,
  scales = "free",
  nrow = NULL,
  ncol = NULL,
  transform_with = NULL,
  verbose = NULL,
  ...
)

Arguments

object

An object of class spata2.

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.

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.

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.

by_group

Logical value. If TRUE for every group in the grouping variable a single dot plot is created. If FALSE one plot for all groups and all gene sets is created.

n_gsets

Numeric value. Maximal number of gene sets whose results are included. The first n_gsets are included starting with the one with the lowest significance value.

signif_var

Character value. Determines what to be considered while checking for significance. Either 'pval' (p-Value) or 'fdr' (False Discovery Rate).

signif_threshold

Numeric value. Significance values below signif_threshold are not included.

pt_alpha

Numeric value. Specifies the degree of transparency of all points.

pt_size

Numeric value. Specifies the size of all points.

pt_clrsp

The color spectrum to be used if the specified variable displayed by color is continuous. Run validColorSpectra() to see valid input.

remove

Character value or NULL. If character, regular expression given to pattern of stringr::str_remove_all(). Used to adjust gene set names.

remove_gsets

Character value or NULL. If character, regular expression. All gene set names that match the regular expression are not included in the plot.

replace

Character vector of length 2 or NULL. If character vector, two regular expressions. First value is given to argument pattern and second is given to argument replacement of stringr::str_replace_all(). Used to adjust gene set names.

arrange_gsets

Logical. If TRUE gene sets are arranged by their group belonging. Making the appearance of the plots tidier.

reverse

Logical. If TRUE the gene sets are arranged from top to bottom. If FALSE they are arranged from bottom to top.

nrow, ncol

Numeric values or NULL. Used to arrange multiple plots.

transform_with

List or NULL. If list, can be used to transform continuous variables before plotting. Names of the list slots refer to the variable. The content of the slot refers to the transforming functions. Slot content can either be a character vector of function names. Use validScaleTransformations() to obtain all valid character value inputs. Or it can be a list of functions (and function names).

Useful if you want to apply more than one transformation on variables mapped to plotting aesthetics. Input for transform_with is applied before the respective <aes>_trans argument.

verbose

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

(Warning messages will always be printed.)

...

Used to absorb deprecated arguments or functions.

reverse_whitin

Logical. If TRUE the gene sets are displayed in a reversed order within the groups.

Value

A ggplot.