scale_isoforms: Scale single-cell expression data for cluster visualization

View source: R/cluster_visualization.R

scale_isoformsR Documentation

Scale single-cell expression data for cluster visualization

Description

This function performs scaling on isoform-level single-cell counts to assist visualization of isoform clusters obtained with acorde.

Usage

scale_isoforms(data, isoform_col = NULL, method = c("range", "classic"))

Arguments

data

A data.frame or tibble including isoforms as rows and cells as columns. Isoform IDs can be included as row names (data.frame) or as an additional column (tibble).

isoform_col

When a tibble is provided in data, a character object indicating the name of the column where isoform IDs are specified. Otherwise, isoform identifiers will be assumed to be defined as rownames, and this argument will not need to be provided.

method

Character. Should be one of "range" (default) and "classic".

Details

The purpose of scaling is to be able to jointly visualize isoform expression trends for all members of a cluster, independently of each isoform's absolute expression level.

For each isoform, counts are first centered by substracting the isoform mean across all cell types. If method = "range" (default), the centered values are then scaled by the expression range. An isoform's expression range is computed as the difference between the maximum and minimum count values of the isoform. Of note, this range is often equivalent to the maximum counts, since most isoforms show minimum count values of zero. Alternatively, if method = "classic" is selected, centered expression values are scaled by the transcript's standard deviation across all cells.

Value

A data.frame containing the scaled counts, with cell IDs as column names and isoform IDs as row names.


ConesaLab/acorde documentation built on Feb. 25, 2024, 4:16 a.m.