plot_hexbin_bivariate: Plot of feature expression and uncertainty of single cells in...

View source: R/plot_hexbin_bivariate.R

plot_hexbin_bivariateR Documentation

Plot of feature expression and uncertainty of single cells in bivariate hexagon cells.

Description

Plot of feature expression and uncertainty of single cells in bivariate hexagon cells.

Usage

plot_hexbin_bivariate(
  sce,
  mod = "RNA",
  type,
  feature,
  fan = FALSE,
  title = NULL,
  xlab = NULL,
  ylab = NULL
)

Arguments

sce

A SingleCellExperiment object.

mod

A string referring to the name of the modality used for plotting. For RNA modality use "RNA". For other modalities use name of alternative object for the SingleCellExperiment object.

type

A string referring to the type of assay in the SingleCellExperiment object.

feature

A string referring to the name of one feature.

fan

Logical indicating whether to plot uncertainty surpressing palette.

title

A string containing the title of the plot.

xlab

A string containing the title of the x axis.

ylab

A string containing the title of the y axis.

Details

This function plots the mean expression and a measure of uncertainty of any feature in the hexagon cell representation calculated with make_hexbin using a bivariate scale. When fan=FALSE, the standard deviation and the mean expression are plotted. When fan=TRUE, the mean expression and coefficient of variation are calculated. The coefficient of variation is converted to a percentage of uncertainty. When using fan=TRUE the raw count data should be used. In order to enable the calculation of the coefficient of variation a pseduo-count of 1 is added to every count.

Value

A ggplot2{ggplot} object.

Examples

# 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")
plot_hexbin_bivariate(tenx_pbmc3k, type = "counts", feature = "ENSG00000135250")
plot_hexbin_bivariate(tenx_pbmc3k, type = "counts", feature = "ENSG00000135250", fan = TRUE)

SaskiaFreytag/schex documentation built on Feb. 4, 2024, 7:49 p.m.