This function calculates the quantiles specified in n_qntl of the numeric variable specified in color_by and divides the barcode spots accordingly. If you want to grey-out certain quantiles use argument keep_qntls.

plotSurfaceQuantiles(
  object,
  color_by,
  alpha_by = NULL,
  n_qntls = 5,
  keep_qntls = 1:n_qntls,
  pt_alpha = NULL,
  pt_clrp = NULL,
  pt_size = NULL,
  smooth = NULL,
  smooth_span = NULL,
  display_image = NULL,
  bcsp_rm = NULL,
  use_scattermore = FALSE,
  sctm_pixels = c(1024, 1024),
  sctm_interpolate = FALSE,
  verbose = NULL,
  ...
)

Arguments

object

An object of class spata2.

color_by

Character value. Specifies the numeric variable of interest:

  • Gene set as a single character value. Must be in getGeneSets()

  • Genes as a character vector. If more than one gene is specified the average expression of those genes will be calculated and displayed. Must be in getGenes()

  • Feature as a single character value. Must be in getFeaturenNames(..., of_class = "numeric")

n_qntls

Numeric value. Specifies the number of bins in which to distribute the barcode spots.

keep_qntls

Numeric vector. Specifies the quantiles to highlight by color. The remaining ones are displayed in grey.

pt_alpha

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

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.

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.

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.

Value

A ggplot.