You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Updated `src/shepherd/datasets.py` for higher versions of PyG. Required changes to the batching functionality for edges (still backwards compatible).
11
+
- Slight changes to `training/train.py` for upgraded versions of PyTorch Lightning.
12
+
- Model checkpoints have been UPDATED for PyTorch Lightning v2.5.1
13
+
- The original checkpoints for PyTorch Lightning v1.2 can be found in previous commits (`c3d5ec0` or before), the original publication Release, or at the Dropbox data link: https://www.dropbox.com/scl/fo/rgn33g9kwthnjt27bsc3m/ADGt-CplyEXSU7u5MKc0aTo?rlkey=fhi74vkktpoj1irl84ehnw95h&e=1&st=wn46d6o2&dl=0
14
+
- Created a basic unconditional generation test script
15
+
- Updated the environment and relevant files to be compatible with PyTorch >= v2.5.1
16
+
- Bug fix for `shepherd.datasets.HeteroDataset.__getitem__` where x3 point extraction should use `get_x2_data`
17
+
18
+
#### Additional notes
19
+
Thank you to Matthew Cox for his contributions in the updated code.
20
+
21
+
22
+
# January 13, 2025
23
+
- Added the ability to do partial inpainting for pharmacophores at inference.
Copy file name to clipboardExpand all lines: README.md
+81-55Lines changed: 81 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,14 @@ Note that *ShEPhERD* has a sister repository, [shepherd-score](https://github.co
5
5
6
6
The preprint can be found on arXiv: [ShEPhERD: Diffusing shape, electrostatics, and pharmacophores for bioisosteric drug design](https://arxiv.org/abs/2411.04130)
7
7
8
+
### **Important** notice for current repository
9
+
This repository has undergone a major refactor to accommodate inference with PyTorch 2.5, primarily for ease-of-use. To maintain reproducibility for training and inference, the original code can be found under commit `c3d5ec0` or the Release titled "Publication code v0.1.0". The model checkpoints used for publication can be found in those binaries or at the following Dropbox [link](https://www.dropbox.com/scl/fo/rgn33g9kwthnjt27bsc3m/ADGt-CplyEXSU7u5MKc0aTo?rlkey=fhi74vkktpoj1irl84ehnw95h&e=1&st=wn46d6o2&dl=0) where training data can also be found. The checkpoints were converted with `python -m pytorch_lightning.utilities.upgrade_checkpoint <chkpt_path>`
10
+
Slight changes have also been made to the training code to adhere to Pytorch Lightning >2.0 and new versions of PyTorch Geometric.
11
+
12
+
We would like to acknowledge Matthew Cox for his contributions in updating this codebase.
`environment.yml` contains the conda environment that we used for training and running *ShEPhERD*.
54
-
55
-
**We** followed these steps to create a suitable conda environment, which worked on our Linux system. Please note that this exact installation procedure may depend on your system, particularly your cuda version.
56
-
74
+
### Requirements
75
+
```
76
+
python>=3.9
77
+
rdkit>=2023.03,<2025.03
78
+
torch>=2.5.1
79
+
numpy>1.2,<2.0
80
+
open3d>=0.18
81
+
xtb>=6.6
82
+
pandas==2.2.3
57
83
```
58
-
conda create --name shepherd python=3.8.13
59
-
source activate shepherd
60
-
conda install merv::envvar-pythonnousersite-true
61
-
source deactivate
62
-
63
-
source activate shepherd
64
84
65
-
conda config --append channels conda-forge
85
+
### Example Environment set-up
66
86
67
-
pip cache purge
68
-
pip3 cache purge
69
-
export TMPDIR='/var/tmp'
87
+
`environment.yml` contains the updated conda environment for *ShEPhERD* and compatibility with PyTorch >=2.5.
**We** followed these steps to create a suitable conda environment, which worked on our Linux system. Please note that this exact installation procedure may depend on your system, particularly your cuda version.
# There may be issues the environment does not set up xTB properly.
105
+
# If this is the case, please install from source.
83
106
conda install xtb
84
-
pip install open3d
85
-
conda install h5py
86
107
87
-
pip install numpy --upgrade
108
+
# cd to this repo and do a developer install
109
+
# This will install additional requirements found in .toml and not covered above
110
+
pip install -e .
88
111
```
89
112
90
113
91
114
## Training and inference data
92
-
`conformers/` contains the 3D structures of the natural products, PDB ligands, and fragments that we used in our experiments in the preprint. It also includes the 100 test-set structures from GDB-17 that we used in our conditional generation evaluations.
115
+
`data/conformers/` contains the 3D structures of the natural products, PDB ligands, and fragments that we used in our experiments in the preprint. It also includes the 100 test-set structures from GDB-17 that we used in our conditional generation evaluations.
93
116
94
-
`conformers/gdb/example_molblock_charges.pkl` contains *sample* training data from our *ShEPhERD*-GDB-17 training dataset.
95
-
`conformers/moses_aq/example_molblock_charges.pkl` contains *sample* training data from our *ShEPhERD*-MOSES_aq training dataset.
117
+
`data/conformers/gdb/example_molblock_charges.pkl` contains *sample* training data from our *ShEPhERD*-GDB-17 training dataset.
118
+
`data/conformers/moses_aq/example_molblock_charges.pkl` contains *sample* training data from our *ShEPhERD*-MOSES_aq training dataset.
96
119
97
-
The full training data for both datasets (<10GB each) can be accessed from this Dropbox link: https://www.dropbox.com/scl/fo/rgn33g9kwthnjt27bsc3m/ADGt-CplyEXSU7u5MKc0aTo?rlkey=fhi74vkktpoj1irl84ehnw95h&e=1&st=wn46d6o2&dl=0
120
+
The full training data for both datasets (<10GB each) can be accessed from this Dropbox link: [https://www.dropbox.com/scl/fo/rgn33g9kwthnjt27bsc3m/ADGt-CplyEXSU7u5MKc0aTo?rlkey=fhi74vkktpoj1irl84ehnw95h&e=1&st=wn46d6o2&dl=0](https://www.dropbox.com/scl/fo/rgn33g9kwthnjt27bsc3m/ADGt-CplyEXSU7u5MKc0aTo?rlkey=fhi74vkktpoj1irl84ehnw95h&e=1&st=wn46d6o2&dl=0)
98
121
99
122
100
123
## Training
101
-
`train.py` is our main training script. It can be run from the command line by specifying a parameter file and a seed. All of our parameter files are held in `parameters/`. As an example, one may re-train the P(x1,x3,x4) model on ShEPhERD-MOSES-aq by calling:
124
+
`training/train.py` is our main training script. It can be run from the command line by specifying a parameter file and a seed. All of our parameter files are held in `training/parameters/`. To run training, first `cd` into the `training` directory. As an example, one may re-train the P(x1,x3,x4) model on ShEPhERD-MOSES-aq by calling:
Note that the trained checkpoints in `shepherd_chkpts/` were obtained after training each model for ~2 weeks on 2 V100 gpus.
131
+
The trained checkpoints in `data/shepherd_chkpts/` were obtained after training each model for ~2 weeks on 2 V100 gpus. Note that the checkpoints found in this folder have been converted for PyTorch Lightning v2.5. The original, unmodified checkpoints can be found in the original "Publication" release binaries or at the aforementioned data Dropbox link.
106
132
107
133
108
134
## Inference
109
135
110
-
The simplest way to run inference is to follow the Jupyter notebooks `RUNME_unconditional_generation_MOSESaq.ipynb` and `RUNME_conditional_generation_MOSESaq.ipynb`.
136
+
The simplest way to run inference is to follow the Jupyter notebooks `examples/RUNME_unconditional_generation.ipynb` and `examples/RUNME_conditional_generation_MOSESaq.ipynb`.
111
137
112
-
`paper_experiments/` also contain scripts that we used to run the experiments in our preprint. Each of these scripts should be copied into the parent directory (same directory as this README) before being called from the command line. Some of the scripts (`paper_experiments/run_inference_*_unconditional_*_.py`) take a few additional command-line arguments, which are detailed in those corresponding scripts by argparse commands.
138
+
`examples/paper_experiments/` also contain scripts that we used to run the experiments in our preprint. Some of the scripts (`examples/paper_experiments/run_inference_*_unconditional_*_.py`) take a few additional command-line arguments, which are detailed in those corresponding scripts by argparse commands.
113
139
114
140
The inference script now supports conditional generation of molecules that contain a superset of the target profile's pharmacophores via partial inpainting. [1/13/2025]
0 commit comments