scDIOR: Single cell RNA-seq Data IO softwaRe
- scDIOR
scDIOR software contains two modules, dior for R and diopy for Python. The data conversion was implemented by a ‘.h5’ file of HDF5 format, which harmonizes the different data types between R and Python. The different aspects of single-cell information were stored in HDF5 group with dataset. scDIOR creates 8 HDF5 groups to store core single-cell information, including data, layers, obs, var, dimR, graphs, uns and spatial.
Users install and operate scDIOR following two ways:
- The environment is created by
conda create
in which scDIOR is installed. - Docker images are available on the jiekailab/scdior-image.
The environment is created by conda create
in which dior and diopy are installed.
conda create -n conda_env python=3.8 R=4.0
- R installation:
# for R
install.packages('devtools')
devtools::install_github('JiekaiLab/dior')
# or devtools::install_github('JiekaiLab/dior@HEAD')
- Python installation:
# for python
pip install diopy
It is recommend to perform scDIOR in docker image, which ensures that the operating environment remains stable. scDIOR image is available on the jiekailab/scdior-image.
Brief description
- We first built the basic jupyter image which based on jupyter/base-notebook (jupyter managing Python and R) and fixuid (fixing user/group mapping issues in containers). This basic image is on jiekailab/scdior-image:base-jupyter-notebook1.0.
- Based on our customized basic image, we built scDIOR image again by
Dockerfile
. For the content ofDockerfile
, it is at this link.
The current latest image contains the following main analysis platforms and software:
R | version | Python | version |
---|---|---|---|
R | 4.0.5 | Python | 3.8.8 |
Seurat | 4.0.2 | Scanpy | 1.8.1 |
SingleCellExperiment | 1.12.0 | scvelo | 0.2.3 |
monocle3 | 1.0.0 | anndata | 0.7.6 |
dior | 0.1.5 | diopy | 0.5.2 |
At present, scDIOR is widely compatible with Seurat (v3~v4) and Scanpy (1.4~1.8) in different docker image. We configured multiple version docker image (https://hub.docker.com/repository/docker/jiekailab/scdior-image) to confirm that scDIOR can work well between multiple versions of Scanpy and Seurat.
Platform | Software | Version | data IO |
---|---|---|---|
R | Seurat | v3~v4 | ☑️ |
Python | Scanpy | 1.4~1.8 | ☑️ |
Pulling the scDIOR image by docker pull jiekailab/scdior-image
.
-
Local computer
- Starting the container of scDIOR image
docker run -p 8840:8888 \ # Port mapping (local computer and docker image) --name scdior \ -e JUPYTER_ENABLE_LAB=yes \ -e JUPYTER_TOKEN=1234 \ -v ~/:/home/jovyan \ # Directory mapping --rm \ -it jiekailab/scdior-image
- Opening jupyter notebook in user's browser
localhost:8840
-
**Remote server **
- Logging in server through
ssh -L
ssh -L localhost:8840:localhost:8853 user@remote_ip # localhost:8840:localhost:8853 Port mapping (local and remote server) # user@remote_ip remote useer
- Starting container of scDIOR image
IMG=jiekailab/scdior-image PORT=8853 PROJECT=scdior MEMORY=64g CWD=$(docker inspect $IMG | grep WorkingDir | head -n 1 | sed 's/.* "//;s/"//g;s/,//g') docker run -p $PORT:8888 \ # Port mapping (remote server and docker image) --name $PROJECT \ -m $MEMORY \ -u $(id -u):$(id -g) \ # id mapping (user id and user group) -e JUPYTER_ENABLE_LAB=yes \ -e JUPYTER_TOKEN=1234 \ -v $PWD:$CWD \ # # Directory mapping --rm \ -it $IMG
- Starting jupyter in user's browser
localhost:8840
- Logging in server through
The environment is activated by conda activate
.
-
Local computer
- Activating conda environment
conda activate conda_env
- Operating
jupyter lab
orjupyter notebook
jupyter lab --port=8840 # or jupyter notebook --port=8840
- Opening jupyter notebook in user's browser
localhost:8840
-
Remote server
- Logging in server through
ssh -L
ssh -L localhost:8840:localhost:8853 user@remote_ip # localhost:8840:localhost:8853 Port mapping (local and remote server) # user@remote_ip remote useer
- Activating conda environment
conda activate conda_env
- Operating
jupyter lab
orjupyter notebook
jupyter lab --port=8853 # or jupyter notebook --port=8853
- Opening jupyter notebook in user's browser
localhost:8840
- Logging in server through
Here, we list several demos to show the powerful performance of scDIOR.
Users can perform trajectory analysis using Monocle3 in R, then transform the single-cell data to Scanpy in Python using scDIOR, such as expression profiles of spliced and unspliced, as well as cell layout. The expression profile can be used to run dynamical RNA velocity analysis and results can be projected on the layout of Monocle3.
User can employ single-cell data preprocess and normalization method provided by Scanpy, and utilize batches correction method provided by Seurat.
scDIOR supports spatial omics data IO between R and Python platforms.
- The function to load ‘.rds’ file in Python directly;
- The function to load ‘.h5ad’ file in R directly;
- Command line
- jupyter docker stacks:
- fixuid: https://github.com/boxboat/fixuid
- Seurat: https://satijalab.org/seurat/index.html
- monocle3:https://cole-trapnell-lab.github.io/monocle3/
- Scanpy: https://scanpy.readthedocs.io/en/stable/index.html
- Scvelo: https://scanpy.readthedocs.io/en/stable/index.html