Visualizes the positions of molecules in 2D space on the sample.

plotMolecules2D(
  object,
  molecules,
  pt_alpha = 0.5,
  pt_size = 1,
  pt_clrp = NULL,
  clrp_adjust = NULL,
  use_scattermore = TRUE,
  xrange = getCoordsRange(object)$x,
  yrange = getCoordsRange(object)$y,
  display_facets = TRUE,
  nrow = NULL,
  ncol = NULL,
  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.

molecules

Character vector. The molecules of interest.

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.

clrp_adjust

Named character vector or NULL. If character, it adjusts the color palette that is used to represent the groups. Names of the input vector must refer to the group and the respective named element denotes the color with which to represent the group.

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.

xrange, yrange

Distance vector of length two or NULL. If not NULL, specifies the x- and y-range to which the spatial output is cropped. E.g. xrange = c(200, 500) results in the two dimensional space being cropped from x-coordinate 200px up to x-coordinate 500px. If NULL, the original range is used.

display_facets

Logical value. If set to TRUE the plot is split via ggplot2::facet_wrap() such that each variable gets it's own subplot.

nrow, ncol

Numeric values or NULL. Used to arrange multiple plots.

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.

Value

The updated input object, containing the added, removed or computed results.