plot_hexbin_gene {schex} | R Documentation

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

### Description

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

### Usage

    plot_hexbin_gene(
      sce,
      type,
      gene,
      action,
      title = NULL,
      xlab = NULL,
      ylab = NULL
    )

    ## S4 method for signature 'SingleCellExperiment'
    plot_hexbin_gene(
      sce,
      type,
      gene,
      action,
      title = NULL,
      xlab = NULL,
      ylab = NULL
    )

    ## S4 method for signature 'Seurat'
    plot_hexbin_gene(
      sce,
      type,
      gene,
      action,
      title = NULL,
      xlab = NULL,
      ylab = NULL
    )

### Arguments

`sce` | A `SingleCellExperiment` or `Seurat-class` object.
`type` | A string referring to the type of assay in the `SingleCellExperiment` object or the data transformation in the `Seurat-class` object.
`gene` | A string referring to the name of one gene.
`action` | A strings pecifying how gene expression of observations in binned hexagon cells are to be summarized. Possible actions are `prop_0`, `mode`, `mean` and `median` (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 expression of any gene 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.

### Value

A `ggplot2{ggplot}` object.

### Methods (by class)

- `SingleCellExperiment`: Plot of gene expression into hexagon cell for SingleCellExperiment object.

- `Seurat`: Plot of gene expression into hexagon cell for Seurat object.

### Examples

    # For Seurat object
    library(Seurat)
    data("pbmc_small")
    pbmc_small <- make_hexbin(pbmc_small, 10, dimension_reduction = "PCA")
    plot_hexbin_gene(pbmc_small, type = "counts", gene = "TALDO1",
        action = "prop_0")

[Package schex version 1.8.0 Index]