ST.ImagePlot: Graphs ST spots colored by continuous variable, e.g....

ST.ImagePlotR Documentation

Graphs ST spots colored by continuous variable, e.g. dimensional reduction vector

Description

Graphs ST spots colored by continuous variable, e.g. dimensional reduction vector

Usage

ST.ImagePlot(
  data,
  data.type,
  variable,
  image,
  dims,
  pt.size = 2,
  pt.alpha = 1,
  pt.border = FALSE,
  add.alpha = FALSE,
  palette = "MaYl",
  cols = NULL,
  ncol = NULL,
  spot.colors = NULL,
  center.zero = TRUE,
  plot.title = NULL,
  dark.theme = FALSE,
  pixels.per.um = NULL,
  limits = NULL,
  label.by = NULL,
  ...
)

Arguments

data

Object of class 'data.frame' containing at least (x, y) coordinates, a "sample" vector with labels for each sample and one column with the feature values. Can also include an additional column for shapes.

data.type

String specifying the class of the features in data to be plotted

variable

Name of feature column

image

Image of class "raster" to use as background for plotting

dims

List of dimensions for original images. This list has to contain one element for each sample and each element should be a vector of length 2 specifying the dimensions of the original HE image.

pt.size

Point size of each ST spot [default: 1]

pt.alpha

Opacity of each ST spot [default: 1]

pt.border

Should a border be drawn around the spots? [default: TRUE]

add.alpha

Scale spot opacity by selected feature. Higher values get more opaque while lower values make spots transparent.

palette

Color palette used for spatial heatmap (see palette.select(info = T) for available options). Disabled if a color vector is provided (see cols below).

cols

A vector of colors to use for colorscale, e.g. cols = c("blue", "white", "red") will create a gradient color scale going from blue to white to red. This options will deactivate the palette option.

ncol

Number of columns to arrange the samples into. This can for example be useful to adjust if you want to visualize the samples in just in one row or one column.

spot.colors

Character vector with color names that overrides default coloring with ggplot2

center.zero

Specifies whther or not the colorscale should be centered around 0. For some values, such as Principal Component vectors, the distribution of values is centered at 0 and in that case it can be appropriate to use a divergent colorscale with a predefined value for 0. If this parameter is set to TRUE, the ggplot2 function scale_color_gradient2 will be used to control the coloring instead of scale_color_gradientn. If center.zero is set to FALSE, the colorscale will simply map the values in equally spaced intervals which could skew the interpretaion of the output plot.

plot.title

String specifying the title of the plot

dark.theme

Switches color of scalebar to 'white'

pixels.per.um

Defines the number of pixels per micrometer to draw the scale bar

limits

Sets the limits of the colorbar

label.by

Feature to relabel facets by. By default, facets are given a unique section number ranging grom 1 to the number of sections available in the 'Staffli' object. If you want to relabel these facets you can pass the name of a column that keeps the labels that you want to use. For example, if you wish to rename the facets to use labels defined by a charcater vector in column "section_id" in your meta.data slot, you can pass 'label.by = "section_id"' to relabel the facets. Only works for categorical group variables with where the number of groups is less than or equal to the number of tissue sections in your Staffli object.

...

Parameters passed to geom_point()


jbergenstrahle/STUtility documentation built on March 14, 2023, 7:15 a.m.