convertTo {scran} | R Documentation

## Convert to other classes

### Description

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

### Usage

    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

    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")

[Package scran version 1.20.1 Index]