computeSpikeFactors {scran} | R Documentation

## Normalization with spike-in counts

### Description

Compute size factors based on the coverage of spike-in transcripts.

### Usage

    computeSpikeFactors(x, spikes, assay.type = "counts")

### Arguments

`x` | A SingleCellExperiment object containing spike-in transcripts in an `altExps` entry. Support for spike-in transcripts in the rows of `x` itself is deprecated.
`spikes` | String or integer scalar specifying the alternative experiment containing the spike-in transcripts.
`assay.type` | A string indicating which assay contains the counts.

### Details

The spike-in size factor for each cell is computed from the sum of all spike-in counts in each cell. This aims to scale the counts to equalize spike-in coverage between cells, thus removing differences in coverage due to technical effects like capture or amplification efficiency.

Spike-in normalization can be helpful for preserving changes in total RNA content between cells, if this is of interest. Such changes would otherwise be lost when normalizing with methods that assume a non-DE majority. Indeed, spike-in normalization is the only available approach if a majority of genes are DE between two cell types or states.

Size factors are computed by applying `librarySizeFactors` to the spike-in count matrix. This ensures that the mean of all size factors is unity for standardization purposes, if one were to compare expression values normalized with sets of size factors (e.g., in `modelGeneVarWithSpikes`).

Users who want the spike-in size factors without returning a SingleCellExperiment object can simply call `librarySizeFactors(altExp(x, spikes))`, which gives the same result.

### Value

A modified `x` is returned, containing spike-in-derived size factors for all cells in `sizeFactors`.

### Author(s)

Aaron Lun

### References

Lun ATL, McCarthy DJ and Marioni JC (2016). A step-by-step workflow for low-level analysis of single-cell RNA-seq data with Bioconductor. F1000Res. 5:2122

### See Also

`altExps`, for the concept of alternative experiments.

`librarySizeFactors`, for how size factors are derived from library sizes.

### Examples

    library(scuttle)
    sce <- mockSCE()
    sce <- computeSpikeFactors(sce, "Spikes")
    summary(sizeFactors(sce))

[Package scran version 1.18.7 Index]