Skip to content

Instantly share code, notes, and snippets.

@inodb
Last active June 16, 2022 15:32
Show Gist options
  • Save inodb/28a8a7870d6b9a55291fdee56ea68cd1 to your computer and use it in GitHub Desktop.
Save inodb/28a8a7870d6b9a55291fdee56ea68cd1 to your computer and use it in GitHub Desktop.

Convert SingleCellExperiment to H5ad

This worked 2022/06/16. Run:

docker run -v ${PWD}:/pwd -it bioconductor/bioconductor_docker:RELEASE_3_15 /bin/sh
cd /pwd
R

Inside R prompt install dependencies:

devtools::install_github("cellgeni/sceasy")
library(sceasy)
use_condaenv('r-reticulate')

In another shell install anndata:

conda activate r-reticulate
conda install -c conda-forge anndata

And finally 😭:

sce <- readRDS("/pwd/SingleCellExperiment_final.rds")
adata <- SCE2AnnData(sce)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment