plotMolecules: plotMolecules

View source: R/plotMolecules.R

plotMoleculesR Documentation

plotMolecules

Description

Plotting functions for spatial transcriptomics data.

Usage

plotMolecules(
  spe,
  molecule = NULL,
  x_coord = NULL,
  y_coord = NULL,
  sample_id = "sample_id",
  pal = c("gray90", "navy"),
  point_size = 0.3
)

Arguments

spe

(SpatialExperiment) Input data, assumed to be a SpatialExperiment object.

molecule

Name of mRNA molecule to plot (assumed to match one of the row names of rowData).

x_coord

Name of column in spatialCoords containing x coordinates. Default = NULL, which selects the first column of spatialCoords.

y_coord

Name of column in spatialCoords containing y coordinates. Default = NULL, which selects the second column of spatialCoords.

sample_id

Name of column in colData containing sample IDs. This argument is only required for datasets containing multiple samples (tissue sections). If provided, samples will be shown in multiple panels using facetting. Default = NULL.

pal

Color palette, provided as a vector of length 2 for the low and high range. Default = c("gray90", "navy").

point_size

Point size. Default = 0.3.

Details

Function to create spot plot for molecule-based datasets, showing spatial locations in x-y coordinates with optional annotations such as expression of a gene.

Value

Returns a ggplot object, which may be further modified using ggplot functions.

Author(s)

Lukas M. Weber

Examples

library(STexampleData)
spe <- seqFISH_mouseEmbryo()
plotMolecules(spe, molecule = "Sox2")


lmweber/ggspavis documentation built on April 4, 2024, 3:21 a.m.