Plots single cell input on the sample surface.

plotSurfaceSC(
  object,
  sc_input,
  cell_types = NULL,
  line_size = 0.5,
  pt_alpha = 1,
  pt_size = 0.5,
  display_density = TRUE,
  display_facets = TRUE,
  display_image = FALSE,
  display_points = TRUE,
  clrp = NULL,
  clrp_adjust = NULL,
  frame_by = "coords",
  nrow = NULL,
  ncol = NULL
)

Arguments

object

An object of class spata2.

sc_input

Data.frame that contains the results from single cell deconvolution. Must have at least three columns:

  • x : numeric. Position of cell on the x axis in pixel.,

  • y : numeric. Position of cell on the y axis in pixel.,

  • cell_type : factor Cell type of the cell.

line_size

Numeric. Affects size of the main lines of the plot.

pt_alpha

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

pt_size

Numeric value. Specifies the size of all points.

display_density

Logical value. If TRUE, uses ggplot2::geom_density2d() to visualize cell density with contours.

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.

display_image

Logical value. If TRUE, adds the image of the tissue.

display_points

Logical value. If set to TRUE points are used additionally to display the results.

clrp

Character value. Specifies the color palette to be used to represent groups of discrete variables. Run validColorPalettes() to obtain valid input options.

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.

nrow, ncol

Numeric values or NULL. Used to arrange multiple plots.

cell_type

Character value or NULL. If character, subsets the cell types that are included in the plots.

Value

Returns a ggplot-object that can be additionally customized according to the rules of the ggplot2-framework.

Examples


object <- downloadPubExample("MCI_LMU", verbose = FALSE)

data("sc_deconvolution")

plotSurfaceSC(
 object = object,
 sc_input = sc_deconvolution$MCI_LMU,
 cell_types = c("Astrocytes", "Neurons", "Microglia", "Macrophages/Monocytes"),
 clrp = "sifre"
 )