Gene selection {scran} | R Documentation

## Gene selection

### Description

Details on how gene selection is performed in almost all scran functions.

### Subsetting by row

For functions accepting some matrix `x`, we can choose to perform calculations only on a subset of rows with `subset.row`. This can be a logical, integer or character vector indicating the rows of `x` to use. If a character vector, it must contain the names of the rows in `x`. Future support will be added for more esoteric subsetting vectors like the Bioconductor Rle classes.

The output of running a function with `subset.row` will always be the same as the output of subsetting `x` beforehand and passing it into the function. However, it is often more efficient to use `subset.row` as we can avoid constructing an intermediate subsetted matrix. The same reasoning applies for any `x` that is a SingleCellExperiment object.

### Handling spike-in transcripts

Many functions only make sense when performed on the endogenous genes. For such functions, spike-in transcripts are automatically removed when the input is a SingleCellExperiment and `get.spikes=FALSE`. This is achieved based on the spike-in information returned by `isSpike`.

If `get.spikes=TRUE`, no filtering on the spike-in transcripts will be performed. Filtering will not be performed (and in fact, the argument should be unavailable) if the input is not a SingleCellExperiment object.

If `get.spikes=FALSE` and `subset.row` is not `NULL`, the two selections are intersected. That is, only the non-spike-in entries of `subset.row` will be used in the function.

A number of functions may require special treatment of spike-ins, e.g., `trendVar`. Refer to the corresponding documentation for more details.

### Filtering by mean

Some functions will have a `min.mean` argument to filter out low-abundance genes prior to processing. Depending on the function, the filter may be applied to the average library size-adjusted count computed by `calcAverage`, the average log-count, or some other measure of abundance - see the documentation for each function for details.

Any filtering on `min.mean` is automatically intersected with `get.spikes=FALSE` and/or a specified `subset.row`. For example, only non-spike-in genes that pass the `min.mean` filter are retained if `get.spikes=TRUE`. Similarly, only selected genes that pass the filter are retained if `subset.row` is specified.

### Author(s)

Aaron Lun

[Package scran version 1.12.1 Index]