View source: R/generateMaskSeurat.R
| generateMaskSeurat | R Documentation |
SeuratObject package.Generates mask from a Seurat object. Requires SeuratObject package.
generateMaskSeurat(
object,
reduction = NULL,
group.by = NULL,
gridSize = 200,
expand = 0.005,
minSize = 10
)
object |
Seurat object |
reduction |
character vector specifying which reduction to use
(default: |
group.by |
character vector specifying which field to use for clusters
(default: |
gridSize |
target width and height of the raster used internally |
expand |
distance used to expand borders, represented as a fraction of sqrt(width*height). Default: 1/200. |
minSize |
Groups of less than |
data.table with points representing the mask borders.
Each individual border line corresponds to a single level of group column.
Cluster assignment is in cluster column.
# only run if Seurat is installed
if (require("Seurat")) {
data("pbmc_small")
maskTable <- generateMaskSeurat(pbmc_small)
library(ggplot2)
# not the best plot, see vignettes for better examples
DimPlot(pbmc_small) +
geom_path(data=maskTable, aes(x=tSNE_1, y=tSNE_2, group=group))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.