Title: | Cluster a Single-cell RNA-seq Dot Plot |
---|---|
Description: | Dot plots of single-cell RNA-seq data allow for an examination of the relationships between cell groupings (e.g. clusters) and marker gene expression. The scDotPlot package offers a unified approach to perform a hierarchical clustering analysis and add annotations to the columns and/or rows of a scRNA-seq dot plot. It works with SingleCellExperiment and Seurat objects as well as data frames. |
Authors: | Benjamin I Laufer [aut, cre], Brad A Friedman [aut] |
Maintainer: | Benjamin I Laufer <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.1.0 |
Built: | 2024-12-18 04:14:42 UTC |
Source: | https://github.com/bioc/scDotPlot |
Create dot plot of gene expression profiles that can be annotated with hierarchical clustering from ggtree using aplot
## S3 method for class 'SingleCellExperiment' scDotPlot( object, features = features, group = NULL, block = NULL, swap_rownames = NULL, scale = FALSE, cluster = TRUE, clusterRows = cluster, clusterColumns = cluster, AverageThreshold = ifelse(scale == FALSE, 0, -Inf), NumDetectedThreshold = 0.01, groupAnno = FALSE, featureAnno = FALSE, treeWidth = 0.1, treeHeight = 0.1, annoWidth = 0.05, annoHeight = 0.02, annoColors = NULL, dotColors = NULL, groupLegends = TRUE, featureLegends = TRUE, fontSize = 11, fontFamily = "", flipPlot = FALSE, ... ) ## S3 method for class 'Seurat' scDotPlot( object, features = features, group = NULL, block = NULL, swap_rownames = NULL, scale = FALSE, cluster = TRUE, clusterRows = cluster, clusterColumns = cluster, AverageThreshold = ifelse(scale == FALSE, 0, -Inf), NumDetectedThreshold = 0.01, groupAnno = FALSE, featureAnno = FALSE, treeWidth = 0.1, treeHeight = 0.1, annoWidth = 0.05, annoHeight = 0.02, annoColors = NULL, dotColors = NULL, groupLegends = TRUE, featureLegends = TRUE, fontSize = 11, fontFamily = "", flipPlot = FALSE, ... ) ## Default S3 method: scDotPlot( object, features = NULL, group = NULL, block = NULL, swap_rownames = NULL, scale = FALSE, cluster = TRUE, clusterRows = cluster, clusterColumns = cluster, AverageThreshold = ifelse(scale == FALSE, 0, -Inf), NumDetectedThreshold = 0.01, groupAnno = FALSE, featureAnno = FALSE, treeWidth = 0.1, treeHeight = 0.1, annoWidth = 0.05, annoHeight = 0.02, annoColors = NULL, dotColors = NULL, groupLegends = TRUE, featureLegends = TRUE, fontSize = 11, fontFamily = "", flipPlot = FALSE, ... ) scDotPlot(object, ...)
## S3 method for class 'SingleCellExperiment' scDotPlot( object, features = features, group = NULL, block = NULL, swap_rownames = NULL, scale = FALSE, cluster = TRUE, clusterRows = cluster, clusterColumns = cluster, AverageThreshold = ifelse(scale == FALSE, 0, -Inf), NumDetectedThreshold = 0.01, groupAnno = FALSE, featureAnno = FALSE, treeWidth = 0.1, treeHeight = 0.1, annoWidth = 0.05, annoHeight = 0.02, annoColors = NULL, dotColors = NULL, groupLegends = TRUE, featureLegends = TRUE, fontSize = 11, fontFamily = "", flipPlot = FALSE, ... ) ## S3 method for class 'Seurat' scDotPlot( object, features = features, group = NULL, block = NULL, swap_rownames = NULL, scale = FALSE, cluster = TRUE, clusterRows = cluster, clusterColumns = cluster, AverageThreshold = ifelse(scale == FALSE, 0, -Inf), NumDetectedThreshold = 0.01, groupAnno = FALSE, featureAnno = FALSE, treeWidth = 0.1, treeHeight = 0.1, annoWidth = 0.05, annoHeight = 0.02, annoColors = NULL, dotColors = NULL, groupLegends = TRUE, featureLegends = TRUE, fontSize = 11, fontFamily = "", flipPlot = FALSE, ... ) ## Default S3 method: scDotPlot( object, features = NULL, group = NULL, block = NULL, swap_rownames = NULL, scale = FALSE, cluster = TRUE, clusterRows = cluster, clusterColumns = cluster, AverageThreshold = ifelse(scale == FALSE, 0, -Inf), NumDetectedThreshold = 0.01, groupAnno = FALSE, featureAnno = FALSE, treeWidth = 0.1, treeHeight = 0.1, annoWidth = 0.05, annoHeight = 0.02, annoColors = NULL, dotColors = NULL, groupLegends = TRUE, featureLegends = TRUE, fontSize = 11, fontFamily = "", flipPlot = FALSE, ... ) scDotPlot(object, ...)
object |
An object with normalized data
|
features |
Character vector with genes of interest |
group |
Column name from colData/metadata of the object to group cells by |
block |
Column name from colData of a SingleCellExperiment object to use as a blocking factor (e.g. batch or sample) |
swap_rownames |
Column name from rowData of a SingleCellExperiment object to match to features |
scale |
Logical indicating whether the data should be scaled and centered |
cluster |
Logical specifying whether to perform hierarchical clustering analysis on both the rows and columns |
clusterRows |
Logical specifying whether to perform hierarchical clustering analysis on the rows |
clusterColumns |
Logical specifying whether to perform hierarchical clustering analysis on the columns |
AverageThreshold |
Numeric specifying threshold for average expression, where values below AverageThreshold and NumDetectedThreshold are transparent |
NumDetectedThreshold |
Numeric specifying threshold for fraction of cells, where values below AverageThreshold and NumDetectedThreshold are transparent |
groupAnno |
Cell annotations that are stored as names of columns in colData of sce with annotations |
featureAnno |
Feature annotations that are stored as names of rows in rowData of sce with annotations |
treeWidth |
Numeric specifying width of the row tree relative to the dotPlot |
treeHeight |
Numeric specifying height of the column tree relative to the dotPlot |
annoWidth |
Numeric specifying the width of the row annotation relative to the dotPlot |
annoHeight |
Numeric specifying height of the column annotation relative to the dotPlot |
annoColors |
A list with a name for each annotation that contains a named vector of colors, where the name is the pairing of values to colors |
dotColors |
A character vector specifying the colors to be used in the gradient for the dots. If scale is set to TRUE, the first 3 colors will be used for the negative, zero, and positive values, respectively. |
groupLegends |
Logical indicating whether to show legends for group annotations |
featureLegends |
Logical indicating whether to show legends for feature annotations |
fontSize |
Numeric specifying the base font size in pts |
fontFamily |
Character specifying the base font family |
flipPlot |
Logical indicating whether to flip the x and y coordinates |
... |
Additional unused arguments |
The data for the dot plot is generated from different sources depending on the object:
When cluster = TRUE
, a aplot
object
When cluster = FALSE
, a ggplot2
object
https://yulab-smu.top/pkgdocs/aplot.html#a-single-cell-example
data("pbmc_small", package = "SeuratObject") pbmc_small |> scDotPlot(features = Seurat::VariableFeatures(pbmc_small), group = "RNA_snn_res.1")
data("pbmc_small", package = "SeuratObject") pbmc_small |> scDotPlot(features = Seurat::VariableFeatures(pbmc_small), group = "RNA_snn_res.1")