View source: R/plot_hexbin_feature.R
plot_hexbin_feature | R Documentation |
Plot of feature expression of single cells in bivariate hexagon cells.
plot_hexbin_feature(
sce,
mod = "RNA",
type,
feature,
action,
title = NULL,
xlab = NULL,
ylab = NULL,
lower_cutoff = 0,
upper_cutoff = 1
)
sce |
A |
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 |
type |
A string referring to the type of assay in the
|
feature |
A string referring to the name of one feature. |
action |
A strings pecifying how meta data of observations in
binned hexagon cells are to be summarized. Possible actions are
|
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. |
lower_cutoff |
For |
upper_cutoff |
For |
This function plots the expression of any feature in the hexagon
cell representation calculated with make_hexbin
. The chosen
gene expression is summarized by one of four actions prop_0
,
mode
, mean
and median
:
prop_0
Returns the proportion of observations in the bin greater than 0. The associated meta data column needs to be numeric.
mode
Returns the mode of the observations in the bin. The associated meta data column needs to be numeric.
mean
Returns the mean of the observations in the bin. The associated meta data column needs to be numeric.
median
Returns the median of the observations in the bin. The associated meta data column needs to be numeric.
A ggplot2{ggplot}
object.
# 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, ]
colData(tenx_pbmc3k) <- cbind(
colData(tenx_pbmc3k),
perCellQCMetrics(tenx_pbmc3k)
)
tenx_pbmc3k <- logNormCounts(tenx_pbmc3k)
tenx_pbmc3k <- runPCA(tenx_pbmc3k)
tenx_pbmc3k <- make_hexbin(tenx_pbmc3k, 20, dimension_reduction = "PCA")
plot_hexbin_feature(tenx_pbmc3k,
type = "logcounts",
feature = "ENSG00000135250", action = "median"
)
plot_hexbin_feature(tenx_pbmc3k,
type = "logcounts",
feature = "ENSG00000135250", action = "mode"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.