Learn R Programming

Seurat (version 2.3.4)

Convert: Convert Seurat objects to other classes and vice versa

Description

Currently, we support direct conversion to/from loom (http://loompy.org/), SingleCellExperiment (https://bioconductor.org/packages/release/bioc/html/SingleCellExperiment.html), and Anndata(https://anndata.readthedocs.io/en/latest/) objects.

Usage

Convert(from, ...)

# S3 method for seurat Convert(from, to, filename, chunk.dims = "auto", chunk.size = 1000, overwrite = FALSE, display.progress = TRUE, anndata.raw = "raw.data", anndata.X = "data", ...)

# S3 method for SingleCellExperiment Convert(from, to, raw.data.slot = "counts", data.slot = "logcounts", ...)

# S3 method for anndata.base.AnnData Convert(from, to, X.slot = "scale.data", raw.slot = "data", ...)

as.seurat(from)

# S3 method for SingleCellExperiment as.seurat(from)

as.SingleCellExperiment(from)

# S3 method for seurat as.SingleCellExperiment(from)

Arguments

from

Object to convert from

...

Arguments passed to and from other methods

to

Class of object to convert to

filename

Filename for writing files

chunk.dims

Internal HDF5 chunk size

chunk.size

Number of cells to stream to loom file at a time

overwrite

Overwrite existing file at filename?

display.progress

Display a progress bar

anndata.raw

Name of matrix (raw.data, data) to put in the anndata raw slot

anndata.X

Name of matrix (data, scale.data) to put in the anndata X slot

raw.data.slot

name of the SingleCellExperiment assay to slot into @raw.data

data.slot

name of the SingleCellExperiment assay to slot into @data

X.slot

Seurat slot to transfer anndata X into. Default is scale.data

raw.slot

Seurat slot to transfer anndata raw into. Default is data

Value

An object of class to

Methods (by class)

  • seurat: Convert a Seurat object

  • SingleCellExperiment: Convert from SingleCellExperiment to a Seurat object

  • anndata.base.AnnData: from Anndata file to a Seurat object