plot_spatial_expression: Plot spatial gene expressions

Description Usage Arguments Value

Description

This function can be used to plot expression of one or more genes in spatial locations. This function can be used to visualize predictions from this package, and gene expression in general as well if locations are known. Plotly-based interactive graphics can be generated, but by default, ggplot2 will be used.

Usage

1
2
3
plot_spatial_expression(gene_expressions, locations, symmetry,
  transposed = FALSE, interactive = FALSE, n_col = 2, pt_size = 1,
  alpha = 1)

Arguments

gene_expressions

Numeric vector or matrix with genes in rows and locations in columns. Matrices with genes in columns instead are also permitted, with transposed = TRUE.

locations

Data frame or numeric matrix with 1 to 3 columns specifying locations, assumed to have x in the first column, y in the second, and z in the 3rd.

symmetry

A string for the column name in locations that specifies an axis about which symmetry is present. This is useful if due to symmetry, only half of the locations are in locations as the other half would be the same anyway. However, if all locations are present in locations even though the actual tissue does have symmetry, this argument can be left missing.

transposed

Logical, whether the matrix in gene_expressions has genes in columns and locations in rows. Defaults to FALSE.

interactive

Logical, whether the plot returned should be interactive. If TRUE, then a Plotly-based html widget will be returned. Otherwise a ggplot object. Defaults to FALSE. When there are 3 columns in locations, this argument will be ignored and an interactive plot will always be returned.

n_col

Number of columns in multi-faceted plot when multiple genes are plotted at once.

pt_size

Numeric, point size.

alpha

Numeric, transparency of points.

Value

If interactive = FALSE and the plot is less than 3D, a ggplot2 object. Otherwise a Plotly object.


lambdamoses/novoSpaRc documentation built on May 12, 2019, 3:14 p.m.