library(scKirby)
ingest_data() runs three main steps:
read_data()). to_<format>). save_data()).seurat <- example_obj("seurat") h5seurat <- example_obj("h5seurat") sce <- example_obj("sce") se <- example_obj("se") h5 <- example_obj("h5") cds <- example_obj("cds") ctd <- example_obj("ctd") adat <- example_obj("anndata") library(Seurat) loom <- example_obj("loom")
SingleCellExperimentsce2 <- ingest_data(obj = seurat, output_type = "SingleCellExperiment")
Seuratseurat <- ingest_data(obj=seurat@assays$RNA@counts, output_type = "Seurat")
scKirby can ingest a named list (i.e. list(exp=..., annot=...)) with the following items:
exp: Expression matrix with rows/genes x cols/cells.
Can be a variety of matrix classes, including dense or sparse.
annot: Cell annotation data.frame with one cell per row.
rownames(annot) should be the same as colnames(exp).
This happens to be the format that the example data in EWCE uses, but any user-supplied data will work.
SingleCellExperimentsce <- ingest_data(obj=ctd)
Seuratseurat.2 <- ingest_data(obj = ctd, output_type = "seurat")
SingleCellExperimentIn-memory
sce.2 <- ingest_data(obj=seurat)
On-disk
seurat.2 <- ingest_data(obj = h5seurat, output_class = "seurat")
SingleCellExperiment## Read in the sce object directly h5.2 <- ingest_data(obj=h5) ## Read it from disk sce_dir <- dirname(se_filepath(h5.2)) h5.3 <- ingest_data(obj=sce_dir)
Seurat## Read in the sce object directly h5.4 <- ingest_data(obj = h5, output_type = "Seurat")
seurat.2 <- ingest_data(obj=cds, output_type = "Seurat")
SingleCellExperiment# ### Set condaenv= to the name of a conda env you've made # reticulate::use_condaenv(condaenv = "echoR") ## In memory sce.2 <- ingest_data(obj=adat) ## On disk path <- save_data(obj = adat, filetype = "anndata") sce.3 <- ingest_data(obj = path)
Seuratseurat.2 <- ingest_data(obj=adat, output_type = "Seurat")
From loomR package
SingleCellExperiment## In memory sce2 <- ingest_data(obj=loom) ## From disk sce3 <- ingest_data(obj=loom$filename)
Seurat## In memory seurat2 <- ingest_data(obj=loom, output_type = "Seurat") ## From disk print(loom$filename) seurat3 <- ingest_data(obj=loom$filename, output_type = "Seurat")
Remove example files
try({ file.remove("./pbmc_small.h5Seurat", showWarnings=FALSE) }) try({ unlink("./pbmc_small_h5/", recursive = TRUE) }) try({ file.remove("./pbmc_small.h5ad") }) try({ file.remove("./pbmc_small.loom") })
utils::sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.