Visualizes results of DE analysis with dot plots.

plotDeaDotPlot(
  object,
  across = getDefaultGrouping(object),
  across_subset = NULL,
  relevel = NULL,
  method_de = NULL,
  by_group = TRUE,
  max_adj_pval = NULL,
  min_lfc = NULL,
  n_highest_lfc = NULL,
  n_lowest_pval = NULL,
  genes = NULL,
  color_by = "avg_log2FC",
  alpha_by = NULL,
  alpha_trans = "identity",
  color_trans = "identity",
  size_by = "p_val_adj",
  size_trans = "reverse",
  pt_alpha = 0.9,
  pt_size = 2,
  pt_color = "blue4",
  pt_clrp = NULL,
  pt_clrsp = "plasma",
  scales = "free",
  nrow = NULL,
  ncol = NULL,
  transform_with = NULL,
  arrange_genes = TRUE,
  reverse = TRUE,
  reverse_within = FALSE,
  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.

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.

genes

Character vector or NULL. If character, vector of gene names that determines which genes are included. If NULL, genes are taken according to the threshold input for average log fold change and adjusted p-value.

color_by

Character value. The variables by which to color the data points.

pt_alpha

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

pt_size

Numeric value. Specifies the size of all points.

pt_clrp

The color palette to be used if the specified variable displayed by color is categorical/discrete. Run validColorPalettes() to see valid input.

pt_clrsp

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

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 usage. Names of the list slots refer to the variable. The content of the slot refers to the transforming functions. E.g if the variable of interest is GFAP gene expression, the following would work:

  • Single function: transform_with = log10,

  • Multiple functions: transform_with = list(GFAP = list(log10, log2)

In case of plotting: 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.

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.

x

Character value. Specifies what is plotted on the x-axis. If p_val_adj the scale is reversed. Ignored if by_group = FALSE.

Value

A ggplot.

Examples

library(SPATA2)

data("example_data")

object <- example_data$object_UKF269T_diet

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

plotDeaDotplot(object, across = "histology")
plotDeaDotplot(object, across = "histology", across_subset = c("tumor", "transition"))