make_hexbin | R Documentation |
make_hexbin
returns a
SingleCellExperiment
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))
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
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
object.
make_hexbin(SingleCellExperiment)
: Bivariate binning of SingleCellExperiment
into hexagon cells.
# For SingleCellExperiment object
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.