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
Copy file name to clipboardExpand all lines: README.md
+67-12Lines changed: 67 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,36 @@ 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.
<sub><sup>1</sup> **ShEPhERD**: **S**hape, **E**lectrostatics, and **Ph**armacophores **E**xplicit **R**epresentation **D**iffusion</sub>
19
13
14
+
### **Important** notice for current repository status
15
+
16
+
#### UPDATE: June 6, 2025
17
+
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 `ec510b2` 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>`.
18
+
Slight changes have also been made to the training code to adhere to Pytorch Lightning >2.0 and new versions of PyTorch Geometric.
19
+
20
+
We would like to acknowledge Matthew Cox for his contributions in updating this codebase.
21
+
22
+
#### UPDATE: Sept. 3, 2025
23
+
To reduce the size of the repository, git-filter-repo was used to remove model weights from git history. You can use the new [loading functions](##model-loading) (recommended) to automatically download model weights from our [HuggingFace repo](https://huggingface.co/kabeywar/shepherd) for *ShEPhERD***>0.2.4**. For older versions, please manually download and place the relevant weights in the `./data/shepherd_chkpts` folder from our [Dropbox](https://www.dropbox.com/scl/fo/rgn33g9kwthnjt27bsc3m/ADGt-CplyEXSU7u5MKc0aTo?rlkey=fhi74vkktpoj1irl84ehnw95h&e=1&st=wn46d6o2&dl=0) or the same HuggingFace repo. More details can be found at `./data/shepherd_chkpts/README.md`.
24
+
25
+
If you have cloned this repo before, please **re-clone** this repo:
**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.
90
101
91
102
```
92
-
conda create -n shepherd python=3.9
103
+
conda create -n shepherd python=3.11
93
104
conda activate shepherd
94
105
pip install uv
95
106
@@ -110,6 +121,47 @@ conda install xtb
110
121
pip install -e .
111
122
```
112
123
124
+
## Model Loading
125
+
126
+
*ShEPhERD* provides pre-trained model checkpoints that are automatically downloaded from HuggingFace and cached locally. The model weights are compatible with PyTorch Lightning >2.0 and have been converted from the original model weights using `python -m pytorch_lightning.utilities.upgrade_checkpoint <chkpt_path>`. The original model weights can be found at the [Dropbox link](https://www.dropbox.com/scl/fo/rgn33g9kwthnjt27bsc3m/ADGt-CplyEXSU7u5MKc0aTo?rlkey=fhi74vkktpoj1irl84ehnw95h&e=1&st=wn46d6o2&dl=0).
127
+
128
+
### Available Models
129
+
130
+
| Model Type | Description | Training Dataset |
131
+
|------------|-------------|------------------|
132
+
|`mosesaq`| Shape, electrostatics, and pharmacophores | MOSES-aq |
133
+
|`gdb_x2`| Shape conditioning only | GDB17 |
134
+
|`gdb_x3`| Shape and electrostatics | GDB17 |
135
+
|`gdb_x4`| Pharmacophores only | GDB17 |
136
+
137
+
### Basic Usage
138
+
139
+
```python
140
+
from shepherd import load_shepherd_model
141
+
142
+
# Load the default MOSES-aq model (downloads automatically if needed)
143
+
model = load_shepherd_model()
144
+
145
+
# Load a specific model type
146
+
model = load_shepherd_model('gdb_x3')
147
+
```
148
+
149
+
### Advanced Usage
150
+
```python
151
+
from shepherd import load_model, clear_model_cache
152
+
153
+
# Use custom cache directory
154
+
model = load_model(cache_dir='./data/shepherd_chkpts')
155
+
156
+
# Check for local checkpoints first
157
+
model = load_model(local_data_dir='./data/shepherd_chkpts')
158
+
159
+
# Clear cached models
160
+
clear_model_cache('mosesaq') # Clear specific model
161
+
clear_model_cache() # Clear all models
162
+
```
163
+
164
+
**Note:** Model weights are downloaded from HuggingFace to the cache directory unless you specify a local directory path (`data/shepherd_chkpts`). The models are automatically cached to avoid repeated downloads.
113
165
114
166
## Training and inference data
115
167
`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.
@@ -145,6 +197,9 @@ The inference script now supports conditional generation of molecules that conta
145
197
This repository does *not* contain the code to evaluate samples from *ShEPhERD* (e.g., evaluate their validity, RMSD upon relaxation, 3D similarity to a target structure, etc). All such evaluations can be found in the sister repository: https://github.com/coleygroup/shepherd-score. These repositories were made separate so that the functions within [shepherd-score](https://github.com/coleygroup/shepherd-score) can be used for more general-purpose applications in ligand-based drug design. We also encourage others to use [shepherd-score](https://github.com/coleygroup/shepherd-score) to evaluate other 3D generative models besides *ShEPhERD*.
146
198
147
199
200
+
## App
201
+
There is an easy-to-use app found in `app/`. Please follow the instructions there for local deployment.
202
+
148
203
## License
149
204
150
205
This project is licensed under the MIT License -- see [LICENSE](./LICENSE) file for details.
0 commit comments