spatial_dim_plot: Dimensional reduction plot on ST coordinates on top of HE...

spatial_dim_plotR Documentation

Dimensional reduction plot on ST coordinates on top of HE image

Description

Dimensional reduction plot on ST coordinates on top of HE image

Usage

spatial_dim_plot(
  object,
  dims = 1:2,
  sample.index = 1,
  spots = NULL,
  type = NULL,
  min.cutoff = NA,
  max.cutoff = NA,
  blend = FALSE,
  pt.size = 1,
  pt.alpha = 1,
  pt.border = FALSE,
  add.alpha = FALSE,
  reduction = NULL,
  palette = "MaYl",
  cols = NULL,
  grid.ncol = NULL,
  center.zero = TRUE,
  channels.use = NULL,
  verbose = FALSE,
  dark.theme = FALSE,
  show.sb = TRUE,
  value.scale = c("samplewise", "all"),
  label.by = NULL,
  ...
)

Arguments

object

Seurat object

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.

sample.index

Index specifying the sample that you want to use for plotting

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]

blend

Scale and blend expression values to visualize coexpression of two features (this options will override other coloring parameters). See 'Blending values' below for a more thourough description.

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.

reduction

Which dimensionality reduction to use. If not specified, first searches for "umap", then "tsne", then "pca"

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.

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.

channels.use

Color channels to use for blending. Has to be a character vector of length 2 or 3 with "red", "green" and "blue" color names specified [default: c("red", "green", "blue)]

verbose

Print messages

dark.theme

Switches color of scalebar to 'white'

show.sb

Should the size bar be displayed? [default: TRUE]

value.scale

Defines how the feature values should be mapped to the colorbar. If 'value.scale = "samplewise"', each feature will be scaled independently and if 'value.scale = "all"' the features will all have the same value reange.

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.

...

Extra parameters passed on to ST.ImagePlot

Value

A ggplot object


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