Creates a page with up to four different linked components, including a scatterplot for dimension reductions, a bar plot showing numbers of observations by group, and a silhouette plot to assess grouping consistency. Additional sample metadata is visualized using boxplots and barplots, depending on the data type of the underlying variable.

add_dimred_sample_page(dashboard, object, ...)

# S4 method for i2dashboard,missing
add_dimred_sample_page(
  dashboard,
  use_dimred,
  sample_metadata,
  group_by,
  page = "dimred_sample_page",
  title = "Dim. reduction & sample metadata",
  labels = rownames(use_dimred),
  show_group_sizes = TRUE,
  show_silhouette = FALSE,
  menu = NULL
)

# S4 method for i2dashboard,SingleCellExperiment
add_dimred_sample_page(dashboard, object, use_dimred, sample_metadata, ...)

# S4 method for i2dashboard,Seurat
add_dimred_sample_page(dashboard, object, use_dimred, sample_metadata, ...)

Arguments

dashboard

A i2dashboard.

object

An object of class Seurat or SingleCellExperiment.

...

Further parameters passed to the core function.

use_dimred

Data containing coordinates of the reduced dimensions or a string indicating a dimension reduction from "reductions" of a Seurat object. Rownames are used as sample labels.

sample_metadata

Sample metadata in columns and samples in rows (see Details).

group_by

A string indicating a column in sample_metadata that is used to group observations.

page

The name of the page to be added.

title

The title of the page.

labels

An optional vector with sample labels.

show_group_sizes

A logical value indicating if a barplot showing the number of observations from group_by will be creaed (default TRUE).

show_silhouette

A logical value indicating if a silhouette plot should be shown (default FALSE).

menu

The name of the menu, under which the page should appear.

Value

An object of class i2dashboard.

Details

The parameters use_dimred, sample_metadata (or assay) and group_by take different arguments depending on the class of object. In case no object is supplied (i2dashboard,missing-method), the parameters are expected to be of class data.frame or matrix. In case a SingleCellExperiment or Seurat object is supplied, the parameters are expected to be of class character, containing

  • the name of an item in reducedDims(object) or object@reductions,

  • a valid assay name from assayNames(object) or names(object@assays),

  • column names of colData(object) or object@meta.data.