isSpike: Spike-in methods

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Gets or sets the rows corresponding to spike-in transcripts.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S4 method for signature 'SingleCellExperiment,character'
isSpike(x, type)

## S4 method for signature 'SingleCellExperiment,missing'
isSpike(x, type)

## S4 method for signature 'SingleCellExperiment,NULL'
isSpike(x, type)

## S4 replacement method for signature 'SingleCellExperiment,character'
isSpike(x, type) <- value

## S4 method for signature 'SingleCellExperiment'
spikeNames(x)

Arguments

x

A SingleCellExperiment object.

type

A string containing the name of the spike-in set.

value

A vector indicating which rows correspond to spike-in transcripts.

Details

Spike-in transcripts may be added during library preparation in single-cell RNA sequencing experiments. These usually need to be handled differently during data analysis, compared to the endogenous genes. Thus, it is important to indicate which rows correspond to spike-in transcripts.

The isSpike<- method accepts any value that indicates which rows correspond to spike-ins. This can be a logical or integer subsetting vector, or a vector of row names. The type should be set to the name of the spike-in set, e.g., "ERCC" or "SIRV".

In this manner, multiple types of spike-in sets are supported for a single experiment. The names of all available spike-in sets can be obtained using spikeNames. To remove spike-ins for a particular set, value should be set to NULL when using isSpike<-.

The isSpike getter methods will return a logical vector indicatng which rows represent spike-ins of the set specified by type. If type is missing or NULL, the vector will instead indicate whether each row is in any spike-in set. If type is specified but not available, an error will be raised.

Value

For isSpike, a logical vector is returned indicating whether each row is in the specified set type or any set.

For isSpike<-, a SingleCellExperiment is returned with spike-in information stored in the internal metadata fields.

For spikeNames, a character vector is returned containing the names of available spike-in sets.

Author(s)

Aaron Lun

See Also

SingleCellExperiment-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
example(SingleCellExperiment, echo=FALSE) # Using the class example
isSpike(sce, "ERCC") <- 1:10
isSpike(sce)

isSpike(sce, "SIRV") <- 11:20
spikeNames(sce)
which(isSpike(sce))
which(isSpike(sce, "SIRV"))

isSpike(sce, "ERCC") <- NULL
spikeNames(sce)

Bioconductor-mirror/SingleCellExperiment documentation built on July 15, 2017, 12:01 a.m.