{"id":21441721,"url":"https://github.com/dmis-lab/cradle-vae","last_synced_at":"2025-03-17T00:43:05.437Z","repository":{"id":256166603,"uuid":"854484422","full_name":"dmis-lab/CRADLE-VAE","owner":"dmis-lab","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-18T14:18:36.000Z","size":1255,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-18T15:27:45.206Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmis-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-09T08:57:37.000Z","updated_at":"2025-01-18T14:18:38.000Z","dependencies_parsed_at":"2024-09-09T11:21:43.487Z","dependency_job_id":null,"html_url":"https://github.com/dmis-lab/CRADLE-VAE","commit_stats":null,"previous_names":["dmis-lab/cradle-vae"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FCRADLE-VAE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FCRADLE-VAE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FCRADLE-VAE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FCRADLE-VAE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmis-lab","download_url":"https://codeload.github.com/dmis-lab/CRADLE-VAE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955720,"owners_count":20374372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T01:41:16.020Z","updated_at":"2025-03-17T00:43:05.417Z","avatar_url":"https://github.com/dmis-lab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CRADLE-VAE: Enhancing Single-Cell Gene Perturbation Modeling with Counterfactual Reasoning-based Artifact Disentanglement\n![img](./figures/CradleVAE_overview.png)\n\n## Abstract\nPredicting cellular responses to various perturbations is a critical focus in drug discovery and personalized therapeutics, with deep learning models playing a significant role in this endeavor. Single-cell datasets contain technical artifacts that may hinder the predictability of such models, which poses quality control issues highly regarded in this area. To address this, we propose CRADLE-VAE, a causal generative framework tailored for single-cell gene perturbation modeling, enhanced with counterfactual reasoning-based artifact disentanglement. Throughout training, CRADLE-VAE models the underlying latent distribution of technical artifacts and perturbation effects present in single-cell datasets. It employs counterfactual reasoning to effectively disentangle such artifacts by modulating the latent basal spaces and learns robust features for generating cellular response data with improved quality. Experimental results demonstrate that this approach improves not only treatment effect estimation performance but also generative quality as well.\n\n## How to run the experiments\n### Prerequisites\nThis project is tested with following environments:\n- Python: 3.9.19\n- CUDA: 11.8\n- Pytorch-lightning: 2.4.0\n- Rapids-singlecell: 0.10.8\n- Scanpy: 1.10.2\n---\n### Install environment (Linux)\n```\nconda env create --file environment.yml\nconda activate cradle_vae_env\n```\n- If you encounter a conflict, run this command: `conda config --set channel_priority disabled`\n\n```\npip install 'rapids-singlecell[rapids11]' --extra-index-url=https://pypi.nvidia.com #CUDA11.X\npip install 'rapids-singlecell[rapids12]' --extra-index-url=https://pypi.nvidia.com #CUDA12\n```\n- Install `rapids-singlecell` according to your CUDA version\n\n---\n### Download datasets\nIf you want to annotated dataset when training our model,\n```\npip install gdown\ngdown https://drive.google.com/uc?id=1OIi1Z3fiw8yKbzarLXMlxy5tJRm1w8Rx # datasets(norman, dixit, replogle, adamson)\ntar -zxvf datasets.tar.gz\n```\n---\n### Training models\nThe easiest way to train a model is specify a config file (eg `demo/cradle_vae_norman.yaml`) with data, model, and training hyperparameters\n```\npython train_norman.py --config ./demo/cradle_vae_norman.yaml\n```\nFor larger experiments, we provide support for wandb sweeps using redun.\n```\npip install redun\nbash sweep_norman.sh\n```\nIf you want to run a sweep, you should make the following changes in the `train_{data}.py` script:\n- Change the argument defaults: `default=None`\n- Comment out the cp line: `# cp.cuda.Device(config['devices'][0]).use()`\n- Modify the devices setting in `pl.Trainer`: Set `devices=-1`\n\n---\n## Acknowledgement\nThis code includes modifications based on the code of SAMS-VAE. We are grateful to the authors for providing their code/models as open-source software. And figure was created with BioRender.\n\n## Contributors\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003eName\u003c/th\u003e\t\t\n\t\t\u003cth\u003eAffiliation\u003c/th\u003e\n\t\t\u003cth\u003eEmail\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eSeungheun Baek\u0026dagger;\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003esheunbaek@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eSoyon Park\u0026dagger;\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003esoyon_park@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eYan Ting Chok\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003eyanting1412@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eJunhyun Lee\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003eljhyun33@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eJueon Park\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003ejueon_park@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eMogan Gim*\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eDepartment of Biomedical Engineering,\u003cbr\u003eHankuk University of Foreign Studies, Yongin, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003egimmogan@hufs.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eJaewoo Kang*\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003ekangj@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n- \u0026dagger;: *Equal Contributors*\n- \u0026ast;: *Corresponding Author*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmis-lab%2Fcradle-vae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmis-lab%2Fcradle-vae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmis-lab%2Fcradle-vae/lists"}