Force an object to belong to a class

Note

Updated 2019-07-31.

CellCycleMarkers to tbl_df

S4 coercion support for creating a tbl_df from CellCycleMarkers.

CellTypeMarkers to tbl_df

S4 coercion support for creating a tbl_df from CellTypeMarkers.

Seurat to SingleCellExperiment

S4 coercion support for creating a SingleCellExperiment from a Seurat class object. The Seurat FAQ page explains the Seurat S4 class structure in detail. Internally, this method improves the basic Seurat::as.SingleCellExperiment S3 coercion method, including the object@scale.data matrix, and will keep track of stashed rowRanges and metadata if the Seurat object was originally created from a SingleCellExperiment (i.e. from the bcbioSingleCell package).

Seurat to RangedSummarizedExperiment

S4 coercion support for creating a RangedSummarizedExperiment from a Seurat class object.

Seurat to SummarizedExperiment

S4 coercion support for creating a SummarizedExperiment from a Seurat class object.

SeuratMarkers to tbl_df

S4 coercion support for creating a tbl_df from a Markers object.

SeuratMarkersPerCluster to tbl_df

S4 coercion support for creating a tbl_df from SeuratMarkersPerCluster.

SingleCellExperiment to Seurat

Interally Seurat::CreateSeuratObject is called without applying any additional filtering cutoffs, since we have already defined them during our quality control analysis. Here we are passing the raw gene-level counts of the filtered cells into a new Seurat class object. Use convertGenesToSymbols to convert gene IDs to names (symbols).

See also

Examples

data(Seurat, SingleCellExperiment, package = "acidtest") ## SingleCellExperiment to Seurat ==== x <- as(SingleCellExperiment, "Seurat") class(x)
#> [1] "Seurat" #> attr(,"package") #> [1] "Seurat"
#> An object of class Seurat #> 500 features across 100 samples within 1 assay #> Active assay: RNA (500 features)
## Seurat to SingleCellExperiment ==== x <- as(Seurat, "SingleCellExperiment") print(x)
#> class: SingleCellExperiment #> dim: 230 80 #> metadata(2): scaleData variableFeatures #> assays(2): counts logcounts #> rownames(230): MS4A1 CD79B ... SPON2 S100B #> rowData names(11): broadClass entrezID ... vst.variance.standardized #> vst.variable #> colnames(80): ATGCCAGAACGACT CATGGCCTGTGCAT ... GGAACACTTCAGAC #> CTTGATTGATCTTC #> colData names(8): orig.ident nCount_RNA ... RNA_snn_res.1 ident #> reducedDimNames(3): PCA TSNE UMAP #> spikeNames(0):