plot_hexbin_interact {schex} | 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 ) ## S4 method for signature 'SingleCellExperiment' plot_hexbin_interact( sce, mod, type, feature, interact, title = NULL, xlab = NULL, ylab = NULL ) ## S4 method for signature 'Seurat' 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
, and mi
:
mi
Returns the mutual information coefficient.
corr_spearman
Returns the Spearman correlation.
A ggplot2{ggplot}
object.
SingleCellExperiment
: Plot of gene expression into hexagon cell
for SingleCellExperiment object.
Seurat
: Plot of gene expression into hexagon cell
for Seurat object.
# For Seurat object library(Seurat) data("pbmc_small") pbmc_small <- make_hexbin(pbmc_small, 10, dimension_reduction = "PCA") protein <- matrix(rnorm(10* ncol(pbmc_small)), ncol=ncol(pbmc_small)) rownames(protein) <- paste0("A", seq(1,10,1)) colnames(protein) <- colnames(pbmc_small) pbmc_small[["ADT"]] <- CreateAssayObject(counts = protein) plot_hexbin_interact(pbmc_small, type=c("counts", "counts"), mod=c("RNA", "ADT" ), feature=c("CD7", "A1"), interact="mi")