make_hexbin: Bivariate binning of single cell data into hexagon cells.

Description Usage Arguments Details Value Functions Examples

Description

make_hexbin returns a SingleCellExperiment or Seurat-class object of binned hexagon cells.

Usage

1
2
3
4
5
6
7
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))

Arguments

sce

A SingleCellExperiment or Seurat-class object.

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.

Details

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.

Value

A SingleCellExperiment or Seurat-class object.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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)

schex documentation built on Nov. 8, 2020, 5:56 p.m.