Size factor methods {SingleCellExperiment} | R Documentation

## Size factors methods

### Description

Gets or sets the size factors for all cells.

### Usage

    ## S4 method for signature 'SingleCellExperiment'
    sizeFactors(object, type=NULL)

    ## S4 replacement method for signature 'SingleCellExperiment'
    sizeFactors(object, type=NULL) <- value

    ## S4 method for signature 'SingleCellExperiment'
    clearSizeFactors(object)

    ## S4 method for signature 'SingleCellExperiment'
    sizeFactorNames(object)

### Arguments

`object` | A SingleCellExperiment object.
`type` | A string specifying the type of size factor to get or set.
`value` | A numeric vector of size factors for all cells.

### Details

A size factor is a scaling factor used to divide the raw counts of a particular cell to obtain normalized expression values. The `sizeFactors` methods can be used to get or set size factors for all cells.

The `type` argument is deprecated, as are the `sizeFactorNames` and `clearSizeFactors` functions.

### Value

For `sizeFactors`, a numeric vector is returned containing size factors for all cells.

For `sizeFactors<-`, a SingleCellExperiment is returned with size factors stored in the internal metadata fields.

For `clearSizeFactors`, a SingleCellExperiment is returned with no size factor information.

For `sizeFactorNames`, a character vector is returned containing the names of all named size factor sets.

### Author(s)

Aaron Lun

### See Also

`SingleCellExperiment-class`

### Examples

    example(SingleCellExperiment, echo=FALSE) # Using the class example
    sizeFactors(sce) <- runif(ncol(sce))
    sizeFactors(sce)

[Package SingleCellExperiment version 1.8.0 Index]