spatial_hsv_plot: Overlay HSVplot on one selected HE image

spatial_hsv_plotR Documentation

Overlay HSVplot on one selected HE image

Description

Colors spots on an an ST array grid according to a 'feature' (i.e. gene expression (raw counts or scaled) and features available in the meta data slot). NOTE that this function only draws a plot for one sample at the time.

Usage

spatial_hsv_plot(
  object,
  features,
  split.hsv = FALSE,
  sample.index = 1,
  rescale = TRUE,
  spots = NULL,
  type = NULL,
  min.cutoff = NA,
  max.cutoff = NA,
  slot = "data",
  pt.size = 2,
  pt.alpha = 1,
  pt.border = FALSE,
  add.alpha = FALSE,
  palette = NULL,
  cols = NULL,
  grid.ncol = NULL,
  dark.theme = FALSE,
  sample.label = TRUE,
  show.sb = TRUE,
  value.scale = c("samplewise", "all"),
  verbose = FALSE,
  ...
)

Arguments

object

Seurat object

features
  • An Assay feature (e.g. a gene name - "MS4A1")

  • A column name from meta.data (e.g. mitochondrial percentage - "percent.mito")

split.hsv

Should the HSV colored features be split into separate plots? [default: FALSE]

sample.index

Index specifying the sample that you want to use for plotting

rescale

Rescale each feature column separately from 0 to 1 range. If set to FALSE, all feature columns will be scaled together from 0 to 1 and preserve the relative differencies

spots

Character vector with spot IDs to plot [default: all spots]

type

Image type to plot on. Here you can specify any of the images available in your Seurat object. To get this list you can run the rasterlists function on your Seurat object. If the type is not specified, the images will be prioritized in the following order if they are available; "processed", "masked" and "raw".

min.cutoff

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10'). This can be useful if you have outlier values that skew the colorscale in the plot. For example, if you specify 'q1', you will trim of values below the 1st percentile. [default: no cuttoffs]

max.cutoff

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10'). This can be useful if you have outlier values that skew the colorscale in the plot. For example, if you specify 'q1', you will trim of values below the 1st percentile. [default: no cuttoffs]

slot

Which slot to pull expression data from? [dafault: 'data']

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.

grid.ncol

Number of columns for display when combining plots. This option will only have an effect on the sample level structure.

dark.theme

Switches color of scalebar to 'white'

sample.label

Should the sample label be included in the image? [default: TRUE]

show.sb

Should a scalebar be drawn? [default: TRUE]

value.scale

Defines how the dimensionality reduction values should be mapped to the colorbar. 'value.scale = "samplewise"' will scale each feature independantly while 'value.scale = "all"' will use the same value range for all vectors

verbose

Print messages

...

Extra parameters passed on to ST.ImagePlot

Value

A ggplot object


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