View source: R/plot_hexbin_interact.R
plot_hexbin_interact | R Documentation |
Plot of interaction of expression of single cells in bivariate hexagon cells.
plot_hexbin_interact(
sce,
mod,
type,
feature,
interact,
title = NULL,
xlab = NULL,
ylab = NULL
)
sce |
A |
mod |
A vector of strings referring to the names of the modularities.
For |
type |
A vector of strings referring to the types of assays in the
|
feature |
A vector of strings referring to the names of one features in the same order as the vector of modularities. |
interact |
A string specifying how interaction between features is
calculated. Possible interaction measures 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. |
This function plots the interaction between any features in the
hexagon cell representation calculated with make_hexbin
. The
interaction between the chosen features is calculated by one of two
measurers corr_spearman
, ratio
and mi
:
mi
Returns the mutual information coefficient.
corr_spearman
Returns the Spearman correlation.
fc
Return the log fold change between the features.
Note that fc
should be applied to log normalized values.
A ggplot2{ggplot}
object.
# For SingleCellExperiment
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, 10, dimension_reduction = "PCA")
plot_hexbin_interact(tenx_pbmc3k,
type = c("counts", "counts"), mod = c("RNA", "RNA"),
feature = c("ENSG00000146109", "ENSG00000102265"), interact = "fc"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.