plotSpatialTrajectories: Plot spatial trajectory

View source: R/plotN-S.R

plotTrajectoryR Documentation

Plot spatial trajectory

Description

Displays the spatial course of spatial trajectory that was drawn with createSpatialTrajectories() on a surface plot. Increase the transparency via argument pt_alpha to highlight the trajectory's course.

Usage

plotTrajectory(...)

plotSpatialTrajectories(
  object,
  ids = NULL,
  color_by = NULL,
  alpha_by = NULL,
  method_gs = NULL,
  smooth = NULL,
  smooth_span = NULL,
  pt_size = NULL,
  pt_alpha = 0.5,
  pt_alpha2 = 0.9,
  pt_clr = NULL,
  pt_clrp = NULL,
  pt_clrsp = NULL,
  sgmt_clr = NULL,
  sgmt_size = NULL,
  display_facets = FALSE,
  display_image = NULL,
  display_title = NULL,
  uniform_genes = NULL,
  arrow = ggplot2::arrow(length = ggplot2::unit(x = 0.125, "inches")),
  nrow = NULL,
  ncol = NULL,
  verbose = NULL,
  of_sample = NA,
  ...
)

Arguments

...

Used to absorb deprecated arguments or functions.

object

An object of class spata2.

ids

Character vector or NULL. If character, specifies the IDs of the image annotations of interest. If numeric, the image annotations are picked by number. If NULL, all image annotations are included - subsequent selection with tags and test is possible.

color_by

The variable to be displayed by color:

  • Gene set as a single character value. Must be in getGeneSets()

  • Genes as a character vector. If more than one gene is specified the average expression of those genes will be calculated and displayed. Must be in getGenes()

  • Feature as a single character value. Must be in getFeaturenNames()

method_gs

Character value. The method according to which gene sets will be handled specified as a character of length one. This can be either 'mean or one of 'gsva', 'ssgsea', 'zscore', or 'plage'. The latter four will be given to gsva::GSVA().

smooth

Logical. If TRUE, a loess fit is used to smooth the values.

smooth_span

Numeric value. Controls the degree of smoothing. Given to argument span of stats::loess().

pt_size

Numeric value. Specifies the size of all points.

pt_alpha

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

pt_alpha2

Numeric value. Specifies the transparency of the spots that fall into the trajectory's reach.

pt_clr

Character value. Specifies the color 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.

pt_clrsp

The color spectrum to be used if the specified variable displayed by color is continuous. Run validColorSpectra() to see valid input.

sgmt_size

The size of the segment arrrow specified as a numeric value.

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. If set to TRUE the histology image of the specified sample is displayed underneath the plot.

display_title

Logical value. If set to TRUE an informative title is displayed.

uniform_genes

Character value. If set to 'discard' genes that are uniformly expressed across all barcode-spots of the specified coordinates data.frame are discarded. If set to 'keep' they are kept.

nrow, ncol

Numeric values or NULL. Used to arrange multiple plots.

verbose

Logical. If set to TRUE informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

of_sample

This argument is currently inactive. It might be reactivated when spata-objects can store more than one sample.

Value

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


kueckelj/SPATA2 documentation built on March 16, 2024, 10:25 a.m.