convertTo: Convert to other classes

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

View source: R/convertTo.R

Description

Convert a SingleCellExperiment object into other classes for entry into other analysis pipelines.

Usage

1
2
3
4
5
6
7
convertTo(
  x,
  type = c("edgeR", "DESeq2", "monocle"),
  ...,
  assay.type = 1,
  subset.row = NULL
)

Arguments

x

A SingleCellExperiment object.

type

A string specifying the analysis for which the object should be prepared.

...

Other arguments to be passed to pipeline-specific constructors.

assay.type

A string specifying which assay of x should be put in the returned object.

subset.row

See ?"scran-gene-selection".

Details

This function converts an SingleCellExperiment object into various other classes in preparation for entry into other analysis pipelines, as specified by type.

Value

For type="edgeR", a DGEList object is returned containing the count matrix. Size factors are converted to normalization factors. Gene-specific rowData is stored in the genes element, and cell-specific colData is stored in the samples element.

For type="DESeq2", a DESeqDataSet object is returned containing the count matrix and size factors. Additional gene- and cell-specific data is stored in the mcols and colData respectively.

For type="monocle", a CellDataSet object is returned containing the count matrix and size factors. Additional gene- and cell-specific data is stored in the featureData and phenoData respectively.

Author(s)

Aaron Lun

See Also

DGEList, DESeqDataSetFromMatrix, newCellDataSet, for specific class constructors.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(scuttle)
sce <- mockSCE()

# Adding some additional embellishments.
sizeFactors(sce) <- 2^rnorm(ncol(sce)) 
rowData(sce)$SYMBOL <- paste0("X", seq_len(nrow(sce)))
sce$other <- sample(LETTERS, ncol(sce), replace=TRUE)

# Converting to various objects.
convertTo(sce, type="edgeR")
convertTo(sce, type="DESeq2")
convertTo(sce, type="monocle")

scran documentation built on April 17, 2021, 6:09 p.m.