3D-Dimensional reduction plot for cell classification visualization.
Source:R/SCP-plot.R
CellDimPlot3D.Rd
Plotting cell points on a reduced 3D space and coloring according to the groups of the cells.
Usage
CellDimPlot3D(
srt,
group.by,
reduction = NULL,
dims = c(1, 2, 3),
axis_labs = NULL,
palette = "Paired",
palcolor = NULL,
bg_color = "grey80",
pt.size = 1.5,
cells.highlight = NULL,
cols.highlight = "black",
shape.highlight = "circle-open",
sizes.highlight = 2,
lineages = NULL,
lineages_palette = "Dark2",
span = 0.75,
width = NULL,
height = NULL,
save = NULL,
force = FALSE
)
Arguments
- srt
A Seurat object.
- group.by
Name of one or more meta.data columns to group (color) cells by (for example, orig.ident).
- reduction
Which dimensionality reduction to use. If not specified, will use the reduction returned by
DefaultReduction
.- dims
Dimensions to plot, must be a three-length numeric vector specifying x-, y- and z-dimensions
- axis_labs
A character vector of length 3 indicating the labels for the axes.
- palette
Name of a color palette name collected in SCP. Default is "Paired".
- palcolor
Custom colors used to create a color palette.
- bg_color
Color value for background(NA) points.
- pt.size
Point size.
- 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 cell points.
- lineages
Lineages/pseudotime to add to the plot. If specified, curves will be fitted using
loess
method.- lineages_palette
Color palette used for lineages.
- span
A numeric value specifying the span of the loess smoother for lineages line.
- 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 maximum levels in any cell group is greater than 100.
Examples
data("pancreas_sub")
pancreas_sub <- Standard_SCP(pancreas_sub)
#> [2023-11-21 07:10:31.757817] Start Standard_SCP
#> [2023-11-21 07:10:31.75878] Checking srtList... ...
#> Data 1/1 of the srtList is raw_counts. Perform NormalizeData(LogNormalize) on the data ...
#> Perform FindVariableFeatures on the data 1/1 of the srtList...
#> Use the separate HVF from srtList...
#> Number of available HVF: 2000
#> [2023-11-21 07:10:32.453668] Finished checking.
#> [2023-11-21 07:10:32.453853] Perform ScaleData on the data...
#> [2023-11-21 07:10:32.526244] Perform linear dimension reduction (pca) on the data...
#> Warning: The following arguments are not used: force.recalc
#> Warning: The following arguments are not used: force.recalc
#> [2023-11-21 07:10:33.084557] Perform FindClusters (louvain) on the data...
#> [2023-11-21 07:10:33.157226] Reorder clusters...
#> [2023-11-21 07:10:33.222341] Perform nonlinear dimension reduction (umap) on the data...
#> Non-linear dimensionality reduction(umap) using Reduction(Standardpca, dims:1-13) as input
#> Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics'
#> Also defined by ‘spam’
#> Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics'
#> Also defined by ‘spam’
#> Non-linear dimensionality reduction(umap) using Reduction(Standardpca, dims:1-13) as input
#> Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics'
#> Also defined by ‘spam’
#> Found more than one class "dist" in cache; using the first, from namespace 'BiocGenerics'
#> Also defined by ‘spam’
#> [2023-11-21 07:10:39.768675] Standard_SCP done
#> Elapsed time: 8.01 secs
CellDimPlot3D(pancreas_sub, group.by = "SubCellType", reduction = "StandardpcaUMAP3D")
pancreas_sub <- RunSlingshot(pancreas_sub, group.by = "SubCellType", reduction = "StandardpcaUMAP3D")
CellDimPlot3D(pancreas_sub, group.by = "SubCellType", reduction = "StandardpcaUMAP3D", lineages = "Lineage1")