Skip to contents

Violin plot using genes or cell data

Usage

plotViolin(
  spe,
  feature,
  assay = "counts",
  group.by = NULL,
  type = c("raw", "log", "cpm", "logcpm"),
  point = FALSE,
  color.by = NULL,
  ncol = NULL,
  pt.size = 0.3,
  pt.alpha = 0.3,
  pt.shape = ".",
  label.y = "Expression"
)

Arguments

spe

A SpatialExperiment object.

feature

can be a vector of gene names in rownames(spe), or column names in colData(spe) if those columns are numeric.

assay

Name of assay to use for plotting feature.

group.by

values to group plot by. Must be in colData of spe and must be either factor or character.

type

Transformation to apply for the group/feature. Options are "raw" , "log", "cpm", "logcpm", or a function that accepts and returns a vector of the same length.

point

Whether to plot points.

color.by

values to color points by. Must be in colData of spe.

ncol

Number of column if group.by is used.

pt.size

Size of points.

pt.alpha

Alpha of points between 0 and 1.

pt.shape

Shape of points.

label.y

Label for the y-axis.

Examples


data("xenium_bc_spe")
plotViolin(spe,c("cell_area","nucleus_area"),group.by="cell_type",label.y="Area")