3D-Dimensional reduction plot for gene expression visualization.
Source:R/SCP-plot.R
FeatureDimPlot3D.Rd
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,
slot = "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.
- slot
Which slot to pull expression data from? Default is
data
.- assay
Which assay to pull expression data from. If
NULL
, will use the assay returned byDefaultAssay
.- 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_SCP(pancreas_sub)
#> [2023-11-21 07:15:45.126217] Start Standard_SCP
#> [2023-11-21 07:15:45.126401] 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:15:45.74611] Finished checking.
#> [2023-11-21 07:15:45.746291] Perform ScaleData on the data...
#> [2023-11-21 07:15:45.820417] 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:15:46.46184] Perform FindClusters (louvain) on the data...
#> [2023-11-21 07:15:46.534466] Reorder clusters...
#> [2023-11-21 07:15:46.595159] 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:15:53.597916] Standard_SCP done
#> Elapsed time: 8.47 secs
FeatureDimPlot3D(pancreas_sub, features = c("Ghrl", "Ins1", "Gcg", "Ins2"), reduction = "StandardpcaUMAP3D")
FeatureDimPlot3D(pancreas_sub, features = c("StandardPC_1", "StandardPC_2"), reduction = "StandardpcaUMAP3D")