plot_hexbin_interact {schex} | R Documentation

## Plot of interaction of expression of single cells in bivariate hexagon cells.

### Description

Plot of interaction of expression of single cells in bivariate hexagon cells.

### Usage

    plot_hexbin_interact(
      sce,
      mod,
      type,
      feature,
      interact,
      title = NULL,
      xlab = NULL,
      ylab = NULL
    )

### Arguments

`sce` | A `SingleCellExperiment` or `Seurat-class` object.
`mod` | A vector of strings referring to the names of the modularities. For `SingleCellExperiment` use "RNA" to access the RNA expression data stored as the main experiment type.
`type` | A vector of strings referring to the types of assays in the `SingleCellExperiment` or the types of transformation in `Seurat-class` object.
`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 `corr_spearman` and `mi` (see details).
`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 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.

### Value

A `ggplot2{ggplot}` object.

### Examples

    # 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")

[Package schex version 1.8.0 Index]