make_hexbin {schex} | R Documentation |
make_hexbin
returns a
SingleCellExperiment
or
Seurat-class
object of binned hexagon cells.
make_hexbin(sce, nbins = 80, dimension_reduction = "UMAP", use_dims = c(1, 2)) ## S4 method for signature 'SingleCellExperiment' make_hexbin(sce, nbins = 80, dimension_reduction = "UMAP", use_dims = c(1, 2)) ## S4 method for signature 'Seurat' make_hexbin(sce, nbins = 80, dimension_reduction = "UMAP", use_dims = c(1, 2))
sce |
A |
nbins |
The number of bins partitioning the range of the first component of the chosen dimension reduction. |
dimension_reduction |
A string indicating the reduced dimension result to calculate hexagon cell representation of. |
use_dims |
A vector of two integers specifying the dimensions used. |
This function bins observations with computed reduced dimension
results into hexagon cells. For a Seurat-class
object the
results from this function are stored in @misc
. For a
SingleCellExperiment
as a list in the @metadata
. The list contains two items. The first
item stores a vector specifying the hexagon ID for each
observation. The second item stores a matrix with the x and y positions of
the hexagon cells and the number of observations in each of them.
A SingleCellExperiment
or
Seurat-class
object.
make_hexbin,SingleCellExperiment-method
: Bivariate binning of SingleCellExperiment
into hexagon cells.
make_hexbin,Seurat-method
: Bivariate binning of Seurat
into hexagon cells.
# For Seurat object library(Seurat) data("pbmc_small") pbmc_small <- make_hexbin(pbmc_small, 10, dimension_reduction = "PCA") # For SingleCellExperiment object ## Not run: library(TENxPBMCData) library(scater) tenx_pbmc3k <- TENxPBMCData(dataset = "pbmc3k") rm_ind <- calculateAverage(tenx_pbmc3k) < 0.1 tenx_pbmc3k <- tenx_pbmc3k[!rm_ind, ] tenx_pbmc3k <- logNormCounts(tenx_pbmc3k) tenx_pbmc3k <- runPCA(tenx_pbmc3k) tenx_pbmc3k <- make_hexbin(tenx_pbmc3k, 80, dimension_reduction = "PCA") ## End(Not run)