Generate a ggplot plot for Assay objects

# S3 method for Assay
autoplot(
  object,
  data = missing_arg(),
  features = NULL,
  layer = c("data", "scale.data", "counts"),
  na.rm = TRUE,
  show.legend = NA,
  ...
)

Arguments

object

An Assay object

data

A data.frame (eg. from FetchData) with extra data for visualization

features

A vector of features to include in the fortified data; defaults to the variable features

layer

Name of layer to pull expression data for

na.rm

Remove values with NAs

show.legend

logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes. It can also be a named logical vector to finely select the aesthetics to display.

...

Arguments passed to geom_violin

Value

A ggplot object

Details

The following aesthetics are mapped automatically:

  • x

  • y

  • fill

See also

ggplot2::autoplot()

Visualize Assay Expression Data: autolayer.Assay(), fortify.Assay()

Examples

data("pbmc_small")
rna <- pbmc_small[["RNA"]]
md <- FetchData(pbmc_small, vars = "ident")

# Generate a plot using `autoplot()`