Convert SingleCellExperiemnt to AnnData using sceasy/scDIOR/zellkonverter.
Source:R/IObenchmark.R
SCE2AD.Rd
Convert SingleCellExperiemnt to AnnData using sceasy/scDIOR/zellkonverter.
Usage
SCE2AD(
sce.obj,
method = c("sceasy", "scDIOR", "zellkonverter"),
out.folder = NULL,
out.filename = NULL,
slot = "counts",
conda.path = NULL
)
Arguments
- sce.obj
A SingleCellExperiment object.
- method
Method used to perform conversion, choose from "sceasy", "scDIOR", "zellkonverter". Default: "sceasy".
- out.folder
Output folder. Default: NULL (current working directory).
- out.filename
Output file name, e.g., test.h5ad. Default: NULL (
seu.obj
name, method, h5ad.).- slot
Slot for adata.X, used when
method
is "sceasy", "zellkonverter". Default: counts.- conda.path
Conda environment path, used when
method
is "zellkonverter" or "sceasy". Default: NULL.
Examples
# sceasy
SCE2AD(sce.obj = pbmc3k.sce, method = "sceasy", out.folder = "benchmark", slot = "rawcounts", conda.path = "/path/to/conda")
#> Error in reticulate::use_condaenv(conda.path, required = TRUE): Unable to locate conda environment '/path/to/conda'.
# scDIOR
pbmc3k.sce.scdior <- pbmc3k.sce
#> Error in eval(expr, envir, enclos): object 'pbmc3k.sce' not found
library(SingleCellExperiment)
#> Loading required package: SummarizedExperiment
#> Loading required package: MatrixGenerics
#> Loading required package: matrixStats
#>
#> Attaching package: 'MatrixGenerics'
#> The following objects are masked from 'package:matrixStats':
#>
#> colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
#> colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
#> colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
#> colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
#> colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
#> colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
#> colWeightedMeans, colWeightedMedians, colWeightedSds,
#> colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
#> rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
#> rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
#> rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
#> rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
#> rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
#> rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
#> rowWeightedSds, rowWeightedVars
#> Loading required package: GenomicRanges
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> Loading required package: parallel
#>
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:parallel':
#>
#> clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
#> clusterExport, clusterMap, parApply, parCapply, parLapply,
#> parLapplyLB, parRapply, parSapply, parSapplyLB
#> The following objects are masked from 'package:stats':
#>
#> IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#>
#> Filter, Find, Map, Position, Reduce, anyDuplicated, append,
#> as.data.frame, basename, cbind, colnames, dirname, do.call,
#> duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
#> lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
#> pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table,
#> tapply, union, unique, unsplit, which.max, which.min
#> Loading required package: S4Vectors
#>
#> Attaching package: 'S4Vectors'
#> The following objects are masked from 'package:base':
#>
#> I, expand.grid, unname
#> Loading required package: IRanges
#> Loading required package: GenomeInfoDb
#> Warning: package 'GenomeInfoDb' was built under R version 4.0.5
#> Loading required package: Biobase
#> Welcome to Bioconductor
#>
#> Vignettes contain introductory material; view with
#> 'browseVignettes()'. To cite Bioconductor, see
#> 'citation("Biobase")', and for packages 'citation("pkgname")'.
#>
#> Attaching package: 'Biobase'
#> The following object is masked from 'package:MatrixGenerics':
#>
#> rowMedians
#> The following objects are masked from 'package:matrixStats':
#>
#> anyMissing, rowMedians
# scDIOR does not support varm in rowData
rowData(pbmc3k.sce.scdior)$varm <- NULL
#> Error in rowData(pbmc3k.sce.scdior)$varm <- NULL: object 'pbmc3k.sce.scdior' not found
SCE2AD(sce.obj = pbmc3k.sce.scdior, method = "scDIOR", out.folder = "benchmark")
#> There is an error when using scDIOR: Error in sce_write_h5(sce = data, file = file, assay.name = assay.name): object 'pbmc3k.sce.scdior' not found
#> NULL
# zellkonverter
SCE2AD(sce.obj = pbmc3k.sce, method = "zellkonverter", out.folder = "benchmark", slot = "rawcounts", conda.path = "/path/to/conda")
#> Error in reticulate::use_condaenv(conda.path, required = TRUE): Unable to locate conda environment '/path/to/conda'.