plot_hexbin_feature_plus {schex} | R Documentation

## Plot of gene expression and meta data of single cell data in bivariate hexagon cells.

### Description

Plot of gene expression and meta data of single cell data in bivariate hexagon cells.

### Usage

    plot_hexbin_feature_plus(
      sce,
      col,
      mod = "RNA",
      type,
      feature,
      action,
      colors = NULL,
      title = NULL,
      xlab = NULL,
      ylab = NULL,
      expand_hull = 3,
      ...
    )

### Arguments

`sce` | A `SingleCellExperiment` or `Seurat-class` object.
`col` | A string referring to the name of one column in the meta data of sce by which to colour the hexagons.
`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 `SingleCellExperiment` or the name of the assay for the `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.
`feature` | A string referring to the name of one feature.
`action` | A string specifying how gene expression of observations in binned hexagon cells are to be summarized. Possible actions are `prop_0`, `mode`, `mean` and `median` (see details).
`colors` | A vector of strings specifying which colors to use for plotting the different levels in the selected column of the meta data.
`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.
`expand_hull` | A numeric value determining the expansion of the line marking different clusters.
`...` | Additional arguments passed on to `ggforce{geom_mark_hull}`.

### Details

This function plots any gene expresssion in the hexagon cell representation calculated with `make_hexbin` as well as at the same time representing outlines of clusters. 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.

To access the data that has been integrated in the `Seurat-class` object specifiy `mod="integrated"`.

### Value

A `ggplot2{ggplot}` object.

### Examples

    #' # For Seurat object
    library(Seurat)
    data("pbmc_small")
    pbmc_small <- make_hexbin(pbmc_small, 10, dimension_reduction = "PCA")
    plot_hexbin_feature_plus(pbmc_small, col="RNA_snn_res.1", type="counts",
       feature="NRBP1",action="mean")

[Package schex version 1.6.3 Index]