qiaochen / VeloAE

Low-dimensional Projection of Single Cell Velocity
MIT License
28 stars 1 forks source link
autoencoder singlecell velocity

A working conda environment could be downloaded. Please follow the README.txt file there to activate this environment. Once successfully activated, you may skip the installation steps.

News Board

2022/05/03 New features experimented, details introduced in notebooks

2022/04/29 VeloAE updated to 0.2.0. To simplify the project, the folder notebooks is reorganized and only notebooks involving veloAE experiments are kept, scvelo dynamical mode models are additionally included for comparison. The previous data are backuped in the branch paper-version-backup

2022/04/29 Version Updating in progress. We thank @Mingze Yuan from PKU for his great insights in correcting issues regarding veloAE's cohort aggregation module and a suggestion on replacing GCN with GAT layers, which leads to better performances on challenging datasets like human and mouse bonemarrow, a preview of updated results:

2022/04/04 Exciting news! UnitTVelo, a new single cell RNA velocity estimation tool that addresses the challenging datasets of existing tools is published by our lab.

VeloAE

Low-dimensional Estimation of Single Cell RNA Velocity with AutoEncoder. VeloAE can learn low-dimensional projections for count matrices leveraging a tailored AutoEncoder, with the aim to obtain better representations for RNA velocity estimation. Results of VeloAE could be previewed in the jupyter notebooks located under the notebooks folder.

Our revised manuscript is in progress, while the first version could be found in bioarxiv with the title Representation learning of RNA velocity reveals robust cell transitions

Follow https://github.com/qiaochen/VeloAE/blob/main/notebooks/readme.md to access the datasets used in the notebooks and manuscript

Install

Dependencies:

Install using pip

pip install git+https://github.com/qiaochen/VeloAE

An example local installation procedure in linux system

conda create -n veloAE
conda activate veloAE
git clone https://github.com/qiaochen/VeloAE.git
cd VeloAE
conda install python=3.7
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.11.0+cu113.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.11.0+cu113.html
pip install torch-geometric
pip install .

Usage

Command line usage

Basic execution command and arguments:

Project velocity into low-dimensional space using a trained model.

veloproj --refit false --vis_type_col clusters --scv_n_jobs 10 --vis-key X_umap --nb_g_src X --gumbsoft_tau 5 --fit_offset_pred true --adata notebooks/dentategyrus/data/DentateGyrus/10X43_1.h5ad --device cuda:3 --model-name ./notebooks/dentategyrus/dentategyrus_model.cpt

Fit a new veloAE model and project velocity into low-dimensional space.

veloproj --lr 1e-5 --nb_g_src X --gumbsoft_tau 5 --fit_offset_pred true --vis_type_col clusters --scv_n_jobs 10 --vis-key X_umap --refit true --adata notebooks/dentategyrus/data/DentateGyrus/10X43_1.h5ad --device cuda:3 --model-name dentategyrus_model.cpt --output './' 

Use command line help to investigate more arguments.

veloproj -h