{"id":22582462,"url":"https://github.com/paccmann/paccmann_sarscov2","last_synced_at":"2026-02-01T18:31:32.537Z","repository":{"id":47000450,"uuid":"295421286","full_name":"PaccMann/paccmann_sarscov2","owner":"PaccMann","description":"Code for paper on automation of discovery and synthesis of targeted molecules: https://iopscience.iop.org/article/10.1088/2632-2153/abe808","archived":false,"fork":false,"pushed_at":"2021-09-18T00:06:30.000Z","size":1095,"stargazers_count":19,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-19T01:47:56.983Z","etag":null,"topics":["accelerated-discovery","computer-aided-synthesis-planning","de-novo-drug-design","deep-learning","drug-discovery","proteochemometrics","sars-cov-2"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaccMann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-14T13:15:38.000Z","updated_at":"2024-10-08T23:34:58.000Z","dependencies_parsed_at":"2022-09-01T11:51:32.167Z","dependency_job_id":null,"html_url":"https://github.com/PaccMann/paccmann_sarscov2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PaccMann/paccmann_sarscov2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaccMann%2Fpaccmann_sarscov2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaccMann%2Fpaccmann_sarscov2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaccMann%2Fpaccmann_sarscov2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaccMann%2Fpaccmann_sarscov2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaccMann","download_url":"https://codeload.github.com/PaccMann/paccmann_sarscov2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaccMann%2Fpaccmann_sarscov2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28985818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T18:17:03.387Z","status":"ssl_error","status_checked_at":"2026-02-01T18:16:57.287Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["accelerated-discovery","computer-aided-synthesis-planning","de-novo-drug-design","deep-learning","drug-discovery","proteochemometrics","sars-cov-2"],"created_at":"2024-12-08T06:10:18.811Z","updated_at":"2026-02-01T18:31:32.520Z","avatar_url":"https://github.com/PaccMann.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/PaccMann/paccmann_sarscov2/actions/workflows/build.yml/badge.svg)](https://github.com/PaccMann/paccmann_sarscov2/actions/workflows/build.yml)\n\n\n# paccmann_sarscov2\n\nPipeline to reproduce the results of the paper [Data-driven molecular design for discovery and synthesis of novel ligands: a case study on SARS-CoV-2](https://iopscience.iop.org/article/10.1088/2632-2153/abe808) (_Machine Learning: Science and Technology_, 2021). In that paper, we propose a de-novo molecular generative model for protein driven molecular design and bundle it with molecular retrosynthesis models to automatize all steps before the actual synthesis of a drug candidate.\n\n![Graphical abstract](https://github.com/PaccMann/paccmann_sarscov2/blob/master/assets/overview.png \"Graphical abstract\")\n\n\n## Description\n\nIn the repo we provide a conda environment and instructions to reproduce the pipeline described in the manuscript:\n\n1. Train a multimodal protein-compound interaction classifier, also known as the affinity predictor ([source code](https://github.com/PaccMann/paccmann_predictor))\n2. Train a toxicity predictor ([source code](https://github.com/PaccMann/toxsmi))\n3. Train a generative model for encoded proteins, also known as the ProteinVAE ([source code](https://github.com/PaccMann/paccmann_omics))\n4. Train a generative model for molecules, also known as the SELFIESVAE ([source code](https://github.com/PaccMann/paccmann_chemistry))\n5. Train PaccMann^RL on SARS-CoV-2 using the pretained models from above ([source code](https://github.com/PaccMann/paccmann_generator))\n\n\n**NOTE:** In the linked repositories, there are often multiple examples for training. For the use case of `paccmann_sarscov2`, relevant examples are named `affinity` or `encoded_proteins`.\n\n## Requirements\n\n- `conda\u003e=3.7`\n- The following data from this [Box link](https://ibm.ent.box.com/v/paccmann-sarscov2-data).  \n  View the respective `README.md` files on data sources.  \n- The git repos linked in the [previous section](#description)\n\n\u003c!-- **NOTE:** please refer to the [README.md](https://ibm.ent.box.com/v/paccmann-pytoda-data/file/548614344106) and to the manuscript for details on the datasets used and the preprocessing applied. --\u003e\n\n## Setup\n\n### Install the environment\n\nCreate a conda environment:\n\n```sh\nconda env create -f conda.yml\n```\n\nActivate the environment:\n\n```sh\nconda activate paccmann_sarscov2\n```\n\n**NOTE:** On Ubuntu, you may now need to run the following to obtain a functional `RDKit` distribution: \n```sh\nsudo apt-get install libxrender1\n```\n\n### Download data and pretrained models\n\nDownload the [data](https://ibm.ent.box.com/v/paccmann-sarscov2-data) as reported in the [requirements section](#requirements).\nFrom now on, we will assume that they are stored in the root of the repository in a folder called `data`, following this structure:\n\n```console\ndata\n├── pretraining\n│   ├── ProteinVAE\n│   ├── SELFIESVAE\n│   ├── affinity_predictor\n│   ├── language_models\n│   └── toxicity_predictor\n└── training\n```\nThis is around **6GB** of data, required for pretaining multiple models.\nAlso, the workload required to run the full pipeline is intensive and might not be straightforward to run all the steps on a desktop laptop.\n\nFor these reasons we also provide [pretrained models](https://ibm.ent.box.com/v/paccmann-sarscov2-models) (ca. 700MB) for download.\n\nOnce the download of the pretrained models is completed, the directory structure looks like this:\n\n```console\nmodels\n├── ProteinVAE\n├── SELFIESVAE\n├── Tox21\n└── affinity\n```\n\n**NOTE:** no worries, the `data` and `models` folders are in the [.gitignore](./.gitignore).\n\n## PaccMann^RL on SARS-CoV-2\n\nUsing the pretrained models to train the conditional generator you would only require the data under `data/training/` (8MB).\n\n### Clone the repo\n\nTo get the training script simply type this:\n\n```sh\nmkdir code \u0026\u0026 cd code \u0026\u0026 \\\n  git clone --branch sarscov2 https://github.com/PaccMann/paccmann_generator \u0026\u0026 \\\n  cd ..\n```\nThe branch is given to ensure a version working with the provided conda environment.\n\n**NOTE:** no worries, the `code` folder is in the [.gitignore](./.gitignore).\n\n### Running training\n\nRunning the training is as easy as running:\n\n``` console\n(paccmann_sarscov2) $ python ./code/paccmann_generator/examples/affinity/train_conditional_generator.py \\\n    ./models/SELFIESVAE \\\n    ./models/ProteinVAE \\\n    ./models/affinity \\\n    ./data/training/merged_sequence_encoding/uniprot_covid-19.csv \\\n    ./code/paccmann_generator/examples/affinity/conditional_generator.json \\\n    paccmann_sarscov2 \\\n    35 \\\n    ./data/training/unbiased_predictions \\\n    --tox21_path ./models/Tox21\n```\n\nThis will create a `biased_models` folder containing the conditional generators, biased for all provided proteins from [covid-19.uniprot.org](https://covid-19.uniprot.org/) except one, in the example for ACE2_HUMAN. The biased generator generates compounds with a shifted distribution compared to unbiased predictions. Ideally, the model generalizes to ACE2_HUMAN and the biased compounds have overall higher affinity (to ACE2_HUMAN) **according to the affinity predictor**. See the pdf files in `biased_models/paccmann_sarscov2_35/results` to observe the effect at different stages of training.  \n\n**NOTE:** no worries, the `biased_models` folder is in the [.gitignore](./.gitignore).\n\n## Pretraining pipeline\n\nWe also provide instructions and scripts to reproduce the full pretraining pipeline, keep in mind **we discourage you from running this on a desktop laptop**.\n\nCalling any of the scripts with the `-h` or `--help` flag will provide you with some information on the arguments.\n\n**NOTE:** in the following, we assume a folder `models` has been created in the root of the repository.  \n\n### Clone the repos\n\nTo get the scripts to run each of the component create a `code` folder and clone the repos. Simply type this:\n\n```sh\nmkdir code \u0026\u0026 cd code \u0026\u0026 \\\n  git clone --branch sarscov2 https://github.com/PaccMann/paccmann_predictor \u0026\u0026 \\ \n  git clone --branch 0.0.2 https://github.com/PaccMann/toxsmi \u0026\u0026 \\\n  git clone --branch sarscov2 https://github.com/PaccMann/paccmann_omics \u0026\u0026 \\ \n  git clone --branch sarscov2 https://github.com/PaccMann/paccmann_chemistry \u0026\u0026 \\ \n  git clone --branch sarscov2 https://github.com/PaccMann/paccmann_generator \u0026\u0026 \\\n  cd ..\n```\nThe branch is given to ensure a version working with the provided conda environment.\n\n### affinity predictor\n```console\n(paccmann_sarscov2) $ python ./code/paccmann_predictor/examples/affinity/train_affinity.py \\\n    ./data/pretraining/affinity_predictor/filtered_train_binding_data.csv \\\n    ./data/pretraining/affinity_predictor/filtered_val_binding_data.csv \\\n    ./data/pretraining/affinity_predictor/sequences.smi \\\n    ./data/pretraining/affinity_predictor/filtered_ligands.smi \\\n    ./data/pretraining/language_models/smiles_language_chembl_gdsc_ccle_tox21_zinc_organdb_bindingdb.pkl \\\n    ./data/pretraining/language_models/protein_language_bindingdb.pkl \\\n    ./models/ \\\n    ./code/paccmann_predictor/examples/affinity/affinity.json \\\n    affinity\n```\n\n### toxicity predictor\n```console\n(paccmann_sarscov2) $ python ./code/toxsmi/scripts/train_tox.py \\\n    ./data/pretraining/toxicity_predictor/tox21_train.csv \\\n    ./data/pretraining/toxicity_predictor/tox21_test.csv \\\n    ./data/pretraining/toxicity_predictor/tox21.smi \\\n    ./data/pretraining/language_models/smiles_language_tox21.pkl \\\n    ./models/ \\\n    ./code/toxsmi/params/mca.json \\\n    Tox21 \\\n    --embedding_path ./data/pretraining/toxicity_predictor/smiles_vae_embeddings.pkl\n```\n\n### protein VAE\n``` console\n(paccmann_sarscov2) $ python ./code/paccmann_omics/examples/encoded_proteins/train_protein_encoding_vae.py \\\n    ./data/pretraining/proteinVAE/tape_encoded/train_representation.csv \\\n    ./data/pretraining/proteinVAE/tape_encoded/val_representation.csv \\\n    ./models/ \\\n    ./code/paccmann_omics/examples/encoded_proteins/protein_encoding_vae_params.json \\\n    ProteinVAE\n```\n\n### SELFIES VAE\n``` console\n(paccmann_sarscov2) $ python ./code/paccmann_chemistry/examples/train_vae.py \\\n    ./data/pretraining/SELFIESVAE/train_chembl_22_clean_1576904_sorted_std_final.smi \\\n    ./data/pretraining/SELFIESVAE/test_chembl_22_clean_1576904_sorted_std_final.smi \\\n    ./data/pretraining/language_models/selfies_language.pkl \\\n    ./models/ \\\n    ./code/paccmann_chemistry/examples/example_params.json \\\n    SELFIESVAE\n```\n\n## References\n\nIf you use `paccmann_sarscov2` in your projects, please cite the following:\n\n```bib\n@article{born2021datadriven,\n  author = {Born, Jannis and Manica, Matteo and Cadow, Joris and Markert, Greta and Mill, Nil Adell and Filipavicius, Modestas and Janakarajan, Nikita and Cardinale, Antonio and Laino, Teodoro and {Rodr{\\'{i}}guez Mart{\\'{i}}nez}, Mar{\\'{i}}a},\n  doi = {10.1088/2632-2153/abe808},\n  issn = {2632-2153},\n  journal = {Machine Learning: Science and Technology},\n  number = {2},\n  pages = {025024},\n  title = {{Data-driven molecular design for discovery and synthesis of novel ligands: a case study on SARS-CoV-2}},\n  url = {https://iopscience.iop.org/article/10.1088/2632-2153/abe808},\n  volume = {2},\n  year = {2021}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaccmann%2Fpaccmann_sarscov2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaccmann%2Fpaccmann_sarscov2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaccmann%2Fpaccmann_sarscov2/lists"}