Skip to contents

Plotting cell points on a reduced 3D space and coloring according to the gene expression in the cells.

Usage

FeatureDimPlot3D(
  srt,
  features,
  reduction = NULL,
  dims = c(1, 2, 3),
  axis_labs = NULL,
  split.by = NULL,
  layer = "data",
  assay = NULL,
  calculate_coexp = FALSE,
  pt.size = 1.5,
  cells.highlight = NULL,
  cols.highlight = "black",
  shape.highlight = "circle-open",
  sizes.highlight = 2,
  width = NULL,
  height = NULL,
  save = NULL,
  force = FALSE
)

Arguments

srt

A Seurat object.

features

A character vector or a named list of features to plot. Features can be gene names in Assay or names of numeric columns in meta.data.

reduction

Which dimensionality reduction to use. If not specified, will use the reduction returned by DefaultReduction.

dims

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions.

axis_labs

A character vector of length 3 indicating the labels for the axes.

split.by

Name of a column in meta.data to split plot by.

layer

Which layer to pull expression data from? Default is data.

assay

Which assay to pull expression data from. If NULL, will use the assay returned by SeuratObject::DefaultAssay.

calculate_coexp

Whether to calculate the co-expression value (geometric mean) of the features.

pt.size

Point size for plotting.

cells.highlight

A vector of cell names to highlight.

cols.highlight

Color used to highlight the cells.

shape.highlight

Shape of the cell to highlight. See scattergl-marker-symbol

sizes.highlight

Size of highlighted cells.

width

Width in pixels, defaults to automatic sizing.

height

Height in pixels, defaults to automatic sizing.

save

The name of the file to save the plot to. Must end in ".html".

force

Whether to force drawing regardless of the number of features greater than 100.

Examples

data("pancreas_sub")
pancreas_sub <- standard_scop(pancreas_sub)
#>  [2025-07-02 02:29:04] Start standard_scop
#>  [2025-07-02 02:29:04] Checking srt_list...
#>  [2025-07-02 02:29:04] Data 1/1 of the srt_list has been log-normalized.
#>  [2025-07-02 02:29:05] Perform FindVariableFeatures on the data 1/1 of the srt_list...
#>  [2025-07-02 02:29:05] Use the separate HVF from srt_list...
#>  [2025-07-02 02:29:05] Number of available HVF: 2000
#>  [2025-07-02 02:29:05] Finished checking.
#>  [2025-07-02 02:29:05] Perform ScaleData on the data...
#>  [2025-07-02 02:29:06] Perform linear dimension reduction (pca) on the data...
#>  [2025-07-02 02:29:06] linear_reduction(pca) is already existed. Skip calculation.
#>  [2025-07-02 02:29:06] Perform FindClusters (louvain) on the data...
#>  [2025-07-02 02:29:06] Reorder clusters...
#> ! [2025-07-02 02:29:06] Using 'Seurat::AggregateExpression()' to calculate pseudo-bulk data for 'Assay5'.
#>  [2025-07-02 02:29:06] Perform nonlinear dimension reduction (umap) on the data...
#>  [2025-07-02 02:29:06] Non-linear dimensionality reduction(umap) using Reduction(Standardpca, dims:1-50) as input
#>  [2025-07-02 02:29:10] Non-linear dimensionality reduction(umap) using Reduction(Standardpca, dims:1-50) as input
#>  [2025-07-02 02:29:13] Run standard_scop done
#>  [2025-07-02 02:29:13] Elapsed time:9.4 secs
FeatureDimPlot3D(
  pancreas_sub,
  features = c("Ghrl", "Ins1", "Gcg", "Ins2"),
  reduction = "StandardpcaUMAP3D"
)