plotSCEHeatmap {singleCellTK} | R Documentation

## Plot heatmap of using data stored in SingleCellExperiment Object

### Description

Plot heatmap of using data stored in SingleCellExperiment Object

### Usage

    plotSCEHeatmap(
      inSCE,
      useAssay = "logcounts",
      doLog = FALSE,
      featureIndex = NULL,
      cellIndex = NULL,
      featureIndexBy = "rownames",
      cellIndexBy = "rownames",
      featureAnnotations = NULL,
      cellAnnotations = NULL,
      featureAnnotationColor = NULL,
      cellAnnotationColor = NULL,
      rowDataName = NULL,
      colDataName = NULL,
      rowSplitBy = NULL,
      colSplitBy = NULL,
      rowLabel = FALSE,
      colLabel = FALSE,
      rowDend = TRUE,
      colDend = TRUE,
      scale = TRUE,
      trim = c(-2, 2),
      title = "SCE Heatmap",
      rowTitle = "Genes",
      colTitle = "Cells",
      rowGap = grid::unit(0, "mm"),
      colGap = grid::unit(0, "mm"),
      border = FALSE,
      colorScheme = NULL,
      ...
    )

### Arguments

`inSCE` | SingleCellExperiment inherited object.
`useAssay` | character. A string indicating the assay name that provides the expression level to plot.
`doLog` | Logical scalar. Whether to do `log(assay + 1)` transformation on the assay indicated by `useAssay`. Default `FALSE`.
`featureIndex` | A vector that can subset the input SCE object by rows (features). Alternatively, it can be a vector identifying features in another feature list indicated by `featureIndexBy`. Default `NULL`.
`cellIndex` | A vector that can subset the input SCE object by columns (cells). Alternatively, it can be a vector identifying cells in another cell list indicated by `featureIndexBy`. Default `NULL`.
`featureIndexBy` | A single character specifying a column name of `rowData(inSCE)`, or a vector of the same length as `nrow(inSCE)`, where we search for the non-rowname feature indices. Default `"rownames"`.
`cellIndexBy` | A single character specifying a column name of `colData(inSCE)`, or a vector of the same length as `ncol(inSCE)`, where we search for the non-rowname cell indices. Default `"rownames"`.
`featureAnnotations` | `data.frame`, with `rownames` containing all the features going to be plotted. Character columns should be factors. Default `NULL`.
`cellAnnotations` | `data.frame`, with `rownames` containing all the cells going to be plotted. Character columns should be factors. Default `NULL`.
`featureAnnotationColor` | A named list. Customized color settings for feature labeling. Should match the entries in the `featureAnnotations` or `rowDataName`. For each entry, there should be a list/vector of colors named with categories. Default `NULL`.
`cellAnnotationColor` | A named list. Customized color settings for cell labeling. Should match the entries in the `cellAnnotations` or `colDataName`. For each entry, there should be a list/vector of colors named with categories. Default `NULL`.
`rowDataName` | character. The column name(s) in `rowData` that need to be added to the annotation. Default `NULL`.
`colDataName` | character. The column name(s) in `colData` that need to be added to the annotation. Default `NULL`.
`rowSplitBy` | character. Do semi-heatmap based on the grouping of this(these) annotation(s). Should exist in either `rowDataName` or `names(featureAnnotations)`. Default `NULL`.
`colSplitBy` | character. Do semi-heatmap based on the grouping of this(these) annotation(s). Should exist in either `colDataName` or `names(cellAnnotations)`. Default `NULL`.
`rowLabel` | Use a logical for whether to display all the feature names, a single character to display a column of `rowData(inSCE)` annotation, a vector of the same length as full/subset `nrow(inSCE)` to display customized info. Default `FALSE`.
`colLabel` | Use a logical for whether to display all the cell names, a single character to display a column of `colData(inSCE)` annotation, a vector of the same length as full/subset `ncol(inSCE)` to display customized info. Default `FALSE`.
`rowDend` | Whether to display row dendrogram. Default `TRUE`.
`colDend` | Whether to display column dendrogram. Default `TRUE`.
`scale` | Whether to perform z-score scaling on each row. Default `TRUE`.
`trim` | A 2-element numeric vector. Values outside of this range will be trimmed to their nearst bound. Default `c(-2, 2)`
`title` | The main title of the whole plot. Default `"SCE Heatmap"`
`rowTitle` | The subtitle for the rows. Default `"Genes"`.
`colTitle` | The subtitle for the columns. Default `"Cells"`.
`rowGap` | A numeric value or a `unit` object. For the gap size between rows of the splitted heatmap. Default `grid::unit(0, 'mm')`.
`colGap` | A numeric value or a `unit` object. For the gap size between columns of the splitted heatmap. Default `grid::unit(0, 'mm')`.
`border` | A logical scalar. Whether to show the border of the heatmap or splitted heatmaps. Default `TRUE`.
`colorScheme` | function. A function that generates color code by giving a value. Can be generated by `colorRamp2`. Default `NULL`.
`...` | Other arguments passed to `Heatmap`.

### Value

A `Heatmap` object

### Author(s)

Yichen Wang

### Examples

    data(scExample, package = "singleCellTK")
    plotSCEHeatmap(sce[1:3,1:3], useAssay = "counts")

[Package singleCellTK version 2.0.0 Index]