{"id":34629476,"url":"https://github.com/pfizer-opensource/e3moldiffusion","last_synced_at":"2026-05-27T02:33:08.890Z","repository":{"id":258772933,"uuid":"663220711","full_name":"pfizer-opensource/e3moldiffusion","owner":"pfizer-opensource","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-12T11:54:59.000Z","size":16482,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T12:34:41.628Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pfizer-opensource.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-06T20:29:46.000Z","updated_at":"2025-03-12T11:55:03.000Z","dependencies_parsed_at":"2024-10-21T21:38:48.520Z","dependency_job_id":null,"html_url":"https://github.com/pfizer-opensource/e3moldiffusion","commit_stats":null,"previous_names":["pfizer-opensource/e3moldiffusion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pfizer-opensource/e3moldiffusion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2Fe3moldiffusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2Fe3moldiffusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2Fe3moldiffusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2Fe3moldiffusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfizer-opensource","download_url":"https://codeload.github.com/pfizer-opensource/e3moldiffusion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2Fe3moldiffusion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33548246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-12-24T16:33:50.912Z","updated_at":"2026-05-27T02:33:08.885Z","avatar_url":"https://github.com/pfizer-opensource.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PILOT: Equivariant diffusion for pocket conditioned de novo ligand generation with multi-objective guidance via importance sampling\n\n[![Chem. Sci.](https://img.shields.io/badge/paper-Chem.%20Sci.-B31B1B.svg)](https://doi.org/10.1039/D4SC03523B)\n\nThis is the official repository for PILOT - a model for guided structure-based drug discovery via equivariant (continuous and discrete) denoising diffusion. If you have any questions, feel free to reach out to us: [julian.cremer@pfizer.com](julian.cremer@pfizer.com), [tuan.le@pfizer.com](tuan.le@pfizer.com).\n\n![header ](images/pilot.png)\n\u003c/details\u003e\n\n\n# Installation\nInstall the main environment via mamba\n```bash\nmamba env create -f environment.yml\n```\n\nFor preparing pdbqt files, install a new environment\n```bash\nconda create -n mgltools -c bioconda mgltools\n```\n\nWe also recommend installing a separate environment for running the docking\n```bash\nmamba env create -f environment_vina.yml\n```\n\n# Data\n\nActivate the main environment\n```bash\nconda activate e3mol\n```\n\n## CrossDocked\nDownload the CrossDocked data as described in https://github.com/pengxingang/Pocket2Mol/tree/main/data\n\nCreate the CrossDocked data\n```bash\npython experiments/data/ligand/process_crossdocked.py --basedir /path/to/crossdocked_pocket10-folder --outdir /your/data/folder --no-H --dist-cutoff 7 \n```\n\n## Kinodata-3D\nDownload the Kinodata-3D dataset here (only kinodata_docked_with_rmsd.sdf.gz needed) https://zenodo.org/records/10410259\n\nCreate Kinodata-3D dataset\n```bash\npython experiments/data/ligand/process_kinodata.py --basedir /path/to/kinodata_folder --outdir /your/data/folder --no-H --dist-cutoff 5 \n```\n\n## PDBQT files for docking\nCreate the pdbqt files for the test complexes\nActivate the mgltools environment\n```bash\nconda activate mgltools\n```\n\n```bash\npython experiments/docking_mgl.py path/to/test_dir /where/to/store/pdbqt_files dataset\n```\n(replace dataset with \"crossdocked\" or \"kinodata\")\n\n# Training\n\nActivate the main environment\n```bash\nconda activate e3mol\n```\n\n## Pocket-conditioned diffusion training\n\nTrain PILOT from scratch on CrossDocked\n```bash\npython experiments/run_train.py --conf configs/diffusion_crossdocked.yaml --save-dir /your/save/dir\n```\n\nTrain PILOT from scratch on Kinodata-3D\n```bash\npython experiments/run_train.py --conf configs/diffusion_kinodata.yaml --save-dir /your/save/dir\n```\n\n# Sampling\n\n## Model checkpoints\n\nCurrently, we provide the model weights upon request. Please contact us via email.\n\n## Test set (on multiple nodes using SLURM's job array)\n\nSample de novo ligands given the CrossDocked (Kinodata-3D) test set, the sampling can be started on multiple GPU nodes:\n\nModify scripts/generate_ligands_multi.sl (scripts/generate_ligands_multi_kinodata.sl):\n\n    - num-gpus: Number of GPU nodes you want to use (number of test files divided by num-gpus)\n    - model-path: Set the path to the trained model (normally save_dir/best_valid.ckpt)\n    - save-dir: Where the sampled molecules as SDF files shall be saved\n    - test-dir: Path to test directory containing .pdb, .sdf and .txt files\n    - pdb-dir: Path to the pre-processed pdb files (see above: experiments/data/ligand/fetch_pdb_files.py)\n    - dataset-root: Main path to the dataset\n    - batch-size: Batch size (40-50 on a V100 GPU)\n    - n-nodes-bias: The ligand sizes are sampled from the ligand size distribution extracted from the training data. With n-nodes-bias an additional number of atoms is added (for crossdocked: 10)\n    - num-ligands-per-pocket-to-sample: 100 [default on CrossDocked 100]\n    - num-ligands-per-pocket-to-save: 100 [default on CrossDocked 100]\n    - max-sample-iter: 50 [max. number of iterations to fulfill num-ligands-per-pocket-to-sample]\n    - batch-size: 40 \n    - n-nodes-bias: 0 [increase sampled/fixed ligand size by the number provided]\n    - vary-n-nodes: [0, n-nodes-bias] is added randomly (uniform)\n    - fix-n-nodes [whether or not to use the ground truth ligand size for number of atoms (hence no sampling of ligand sizes)]\n    - prior-n-atoms: targetdiff [conditional or targetdiff - sample ligand size from pocket conditional ligand size distribution]\n    - property-importance-sampling [whether or not to use property importance sampling]\n    - property-importance-sampling-start: 200 [when on the diffusion trajectory to start importance sampling]\n    - property-importance-sampling-end: 300 [when on the diffusion trajectory to end importance sampling]\n    - property-every-importance-t: 5 [every n-th step perform importance sampling]\n    - property-tau 0.1 [temperature for importance sampling]\n    - sa-importance-sampling [whether or not to use SA importance sampling]\n    - sa-importance-sampling-start: 0 [when on the diffusion trajectory to start importance sampling]\n    - sa-importance-sampling-end: 300 [when on the diffusion trajectory to start importance sampling]\n    - sa-every-importance-t: 5 [every n-th step perform importance sampling]\n    - sa-tau: 0.1 [temperature for importance sampling]\n\n```bash\nsbatch scripts/generate_ligands_multi.sl\n```\n\nAfter sampling is finished, aggregate the results from all jobs to print the full evaluation\n```bash\npython experiments/aggregate_results.py --files-dir /your/sampling/save_dir\n```\n\nAll ligands per target are saved in sdf files. The molecules in the sdf files contain all properties as well.\n\n## Docking of generated ligands (on multiple nodes using SLURM's job array)\n\nAs soon ligands are generated for the respective pockets, we can start docking.\n\nModify scripts/docking_multi.sl (scripts/docking_multi_kinodata.sl):\n\n    - num-cpus: Number of CPU nodes you want to use (number of generated sdf files divided by num-cpus; see IMPORTANT note below)\n     -sdf-dir: Path to the generated ligands \n     -save-dir Path where all evaluations are saved at\n     -pdbqt-dir Path where all pdbqt files are stored (see above: experiments/docking_mgl.py)\n     -pdb-dir: Path to the pre-processed pdb files (see above: experiments/data/ligand/fetch_pdb_files.py)\n     -dataset: Which dataset, e.g., crossdocked\n     -docking-mode: vina_dock or qvina2 (default)\n\n```bash\nsbatch scripts/docking_multi.sl\n```\n\nAfter docking is finished, aggregate the results from all jobs to print the full evaluation\n```bash\npython experiments/aggregate_results.py --files-dir /your/docking/save_dir --docked --docking-mode qvina2\n```\n\n\n\n## Single PDB file\n\nActivate the main environment\n```bash\nconda activate e3mol\n```\n\nIn general, we assume a ground truth ligand docked to a protein, from which the binding site can be extracted. Otherwise the binding site must be found first.\n\nTo get all necessary files for sampling, run\n\n```bash\npython experiments/data/ligand/process_pdb.py --main-path /path/to/main_folder --pdb-id PDB_ID --ligand-id LIGAND_ID --no-H --dist-cutoff 7\n```\n\nActivate the mgltools environment and create the pdbqt file\n```bash\nconda activate mgltools\n```\n\n```bash\npython experiments/docking_mgl.py path/to/pdb_dir /where/to/store/pdbqt_file dataset\n```\n(replace dataset with \"pdb_file\")\n\n\nThen for sampling run\n\n```bash\nsbatch scripts/generate_ligands_multi_pdb_file.sl\n```\n(specify all arguments to your needs as before)\n\n\nAfterwards, for docking run\n\n```bash\nsbatch scripts/docking_multi_pdb_file.sl\n```\n(again, specify the arguments; the docking mode can be set to \"vina_dock\", \"vina_score\", \"qvina2\". Default is \"qvina2\".)\n\n\n## Acknowledgement\nThis study was partially funded by the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie Actions grant agreement “Advanced machine learning for Innovative Drug Discovery (AIDD)” No. 956832.\n\nIf you make use of this code in your research, please also consider citing the following works:\n\n\n## Citation\n\nIf you make use of this code in your research, please also consider citing the following works:\n\n```\n@inproceedings{\nle2024navigating,\ntitle={Navigating the Design Space of Equivariant Diffusion-Based Generative Models for De Novo 3D Molecule Generation},\nauthor={Tuan Le and Julian Cremer and Frank Noe and Djork-Arn{\\'e} Clevert and Kristof T Sch{\\\"u}tt},\nbooktitle={The Twelfth International Conference on Learning Representations},\nyear={2024},\nurl={https://openreview.net/forum?id=kzGuiRXZrQ}\n}\n\n\n@Article{cremer2024pilotequivariantdiffusionpocket,\nauthor =\"Cremer, Julian and Le, Tuan and Noé, Frank and Clevert, Djork-Arné and Schütt, Kristof T.\",\ntitle  =\"PILOT: equivariant diffusion for pocket-conditioned de novo ligand generation with multi-objective guidance via importance sampling\",\njournal  =\"Chem. Sci.\",\nyear  =\"2024\",\nvolume  =\"15\",\nissue  =\"36\",\npages  =\"14954-14967\",\npublisher  =\"The Royal Society of Chemistry\",\ndoi  =\"10.1039/D4SC03523B\",\nurl  =\"http://dx.doi.org/10.1039/D4SC03523B\",\nabstract  =\"The generation of ligands that both are tailored to a given protein pocket and exhibit a range of desired chemical properties is a major challenge in structure-based drug design. Here{,} we propose an in silico approach for the de novo generation of 3D ligand structures using the equivariant diffusion model PILOT{,} combining pocket conditioning with a large-scale pre-training and property guidance. Its multi-objective trajectory-based importance sampling strategy is designed to direct the model towards molecules that not only exhibit desired characteristics such as increased binding affinity for a given protein pocket but also maintains high synthetic accessibility. This ensures the practicality of sampled molecules{,} thus maximizing their potential for the drug discovery pipeline. PILOT significantly outperforms existing methods across various metrics on the common benchmark dataset CrossDocked2020. Moreover{,} we employ PILOT to generate novel ligands for unseen protein pockets from the Kinodata-3D dataset{,} which encompasses a substantial portion of the human kinome. The generated structures exhibit predicted IC50 values indicative of potent biological activity{,} which highlights the potential of PILOT as a powerful tool for structure-based drug design.\"}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfizer-opensource%2Fe3moldiffusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfizer-opensource%2Fe3moldiffusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfizer-opensource%2Fe3moldiffusion/lists"}