Skip to contents

Reorder idents by the gene expression

Usage

srt_reorder(
  srt,
  features = NULL,
  reorder_by = NULL,
  layer = "data",
  assay = NULL,
  log = TRUE,
  distance_metric = "euclidean"
)

Arguments

srt

A Seurat object.

features

Features used to reorder idents.

reorder_by

Reorder groups instead of idents.

layer

Specific layer to get data from.

assay

Specific assay to get data from.

log

Whether log1p transformation needs to be applied. Default is TRUE.

distance_metric

Metric to compute distance. Default is "euclidean".

Examples

data("pancreas_sub")
pancreas_sub <- srt_reorder(
  srt = pancreas_sub,
  reorder_by = "SubCellType",
  layer = "data"
)
#> ! [2025-07-03 08:52:51] Using 'Seurat::AggregateExpression()' to calculate pseudo-bulk data for 'Assay5'.