Convert Other Formats to SeuratObject.
Usage
ImportSeurat(
obj = NULL,
assay = "RNA",
from = c("SCE", "AnnData", "CellDataSet", "cell_data_set", "loom"),
count.assay = "counts",
data.assay = "logcounts",
slot = "counts",
anndata.file = NULL,
loom.file = NULL,
conda.path = NULL,
...
)
Arguments
- obj
Other formats object (eg: SingleCellExperiment, CellDataSet). Default: NULL (used when
from
is "AnnData").- assay
Assay name to store expression matrices in SeuratObject. Default: RNA.
- from
The source formats, chosen from "SCE" (SingleCellExperiment), "AnnData", "CellDataSet", "cell_data_set". Default: "SCE".
- count.assay
The assay of source formats to save raw counts, used when
from
is "SCE" or cell_data_set. Default: counts.- data.assay
The assay of source formats to save log transformed counts, used when
from
is "SCE" or cell_data_set. Default: logcounts.- slot
Slot to store expression data as, used when
from
is "CellDataSet". Default: counts.- anndata.file
The file contains AnnData. Default: NULL.
- loom.file
The file contains loom. Default: NULL.
- conda.path
Conda environment path, used when
from
is "AnnData". Default: NULL.- ...
Parameter for
as.Seurat
,sceasy::convertFormat
,as.Seurat
,as.Seurat
,as.Seurat
, corresponding tofrom
.
Examples
if (FALSE) {
# import data from SingleCellExperiment
seu.obj <- ImportSeurat(
obj = sce.obj, from = "SCE", count.assay = "counts",
data.assay = "logcounts", assay = "RNA"
)
# import data from CellDataSet
seu.obj <- ImportSeurat(obj = cds.obj, from = "CellDataSet", count.assay = "counts", assay = "RNA")
# import data from cell_data_set
seu.obj <- ImportSeurat(
obj = sce.obj, from = "cell_data_set", count.assay = "counts",
data.assay = "logcounts", assay = "RNA"
)
# import data from AnnData, need users to provide the file for conversion
seu.obj <- ImportSeurat(anndata.file = "path/to/h5ad", from = "AnnData", assay = "RNA")
# import data from loom, need users to provide the file for conversion
seu.obj <- ImportSeurat(loom.file = "path/to/loom", from = "loom")
}