Displays the spatial dimension of the sample and colors the surface according to the expression of averaged gene expression values. For each element in the list specified in argument color_by a surface plot is generated colored by the gene's average expression score.

plotSurfaceAverage(
  object,
  color_by,
  pt_alpha = NULL,
  pt_clrsp = NULL,
  pt_size = NULL,
  smooth = FALSE,
  smooth_span = NULL,
  use_scattermore = FALSE,
  sctm_pixels = c(1024, 1024),
  sctm_interpolate = FALSE,
  display_image = NULL,
  bcsp_rm = NULL,
  na_rm = FALSE,
  ...
)

Arguments

object

An object of class spata2.

color_by

A character vector of gene names or a named list in which each element is a vector of gene names.

pt_alpha

Numeric value. Specifies the degree of transparency 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.

pt_size

Numeric value. Specifies the size of all points.

smooth

Logical. If TRUE, a loess fit is used to smooth the values.

smooth_span

Numeric value. Controls the degree of smoothing. Given to argument span of stats::loess().

use_scattermore

Logical value. If TRUE, data points are plotted with scattermore::geom_scattermore() which allows quick plotting of several thousand data points. If the number of data points plotted is bigger than 10.000 it is used anyway.

sctm_interpolate, sctm_pixels

Given to the corresponding arguments of scattermore::geom_scattermore(). Note: With increasing sctm_pixels the point size must be adjusted with the argument pt_size.

display_image

Logical. If set to TRUE the histology image of the specified sample is displayed underneath the plot.

bcsp_rm

Character vector or NULL. If character, specifies barcode-spots that are removed before analysis or plotting.

...

Used to absorb deprecated arguments or functions.

Examples

#Not run:

color_by_list <- list(Example1 = c("PGK1", "PDK1", "GBE1"),
                      Example2 = c("METRN", "GFAP")
                      )

plotSurfaceAverage(
   object = spata_obj,
   color_by = color_by_list
 )