Comments (8)
Yes, the checkpoint (500.pt) could be found in Zenodo.
from pmdm.
If you do not have the reference molecule for comparison, you could ignore them by commenting the relevant code.
I have also updated the sample_for_pdb
file which I convert the sdf_file as an argument. You could also utilize the newest file.
Thank you very much for the feedback. It indeed helps improves this project!
from pmdm.
It could work now.
from pmdm.
Hi,
I have uploaded sample_for_pdb.py
with the related files models/encoders/egnn.py
and utils/sample.py
to support generation without reference ligand.
For this error: the "self.propagate(edge_index, x=feats, edge_attr=edge_attr_feats,)", please degrade your torch_geometry version to 2.4.0.
Please let me know if there is any other issue.
from pmdm.
Thnaks! @Layne-Huang
I continued the test on sample_for_pdb.py, the command I used is (which is the same as in the repo)
python -u sample_for_pdb.py --ckpt data/500.pt --pdb_path receptor.4amber.pdb --num_atom 50 --num_samples 2 --sampling_type generalized
Somehow I need to provide another sdf file, which I did not find from the python -u sample_for_pdb.py -h
, can you explain what this file should be? Thanks!
The error I got is down below:
Traceback (most recent call last):
File "~/softwares/PMDM/sample_for_pdb.py", line 292, in <module>
data = pdb_to_pocket_data(args.pdb_path, sdf_file)
File "~/softwares/PMDM/sample_for_pdb.py", line 186, in pdb_to_pocket_data
ligand_data = torchify_dict(parse_sdf_file(sdf_path))
File "~/softwares/PMDM/sample_for_pdb.py", line 55, in parse_sdf_file
rdmol = next(iter(Chem.SDMolSupplier(path, removeHs=False, sanitize=False)))
OSError: File error: Bad input file ./ref_1.sdf
from pmdm.
Thanks! @Layne-Huang I tried the newest file, seems there is still one more place to modify, see the error message I got below:
Traceback (most recent call last):
File "~/softwares/PMDM/sample_for_pdb.py", line 294, in <module>
data = pdb_to_pocket_data(args.pdb_path, args.sdf_file)
AttributeError: 'Namespace' object has no attribute 'sdf_file'
from pmdm.
If you do not have the reference molecule for comparison, you could ignore them by commenting the relevant code.
I have also updated the
sample_for_pdb
file which I convert the sdf_file as an argument. You could also utilize the newest file.Thank you very much for the feedback. It indeed helps improves this project!
Hi, author.
when I used command:
"python -u sample_for_pdb.py
--ckpt ./500.pt
--pdb_path 3WZE/pocket.pdb
--num_atom 32
--num_samples 100
--sampling_type generalized"
to generate molecules for custom pocket,
But, I got a error, "pocket_pos_center = pocket_pos - scatter_mean(ligand_pos, ligand_batch, dim=0)[pocket_batch]
IndexError: index is out of bounds for dimension with size 0".
It seems like that the "sdf_path" argument is necessary.
Beside, even with "sdf_path" argument, a new error was shown:
Traceback (most recent call last):
File "/home/PMDM/PMDM/sample_for_pdb.py", line 345, in
pos_gen, pos_gen_traj, atom_type, atom_traj = model.langevin_dynamics_sample(
File "/home/PMDM/PMDM/models/epsnet/MDM_pocket_coor_shared.py", line 790, in langevin_dynamics_sample
net_out = self.net(
File "/home/PMDM/PMDM/models/epsnet/MDM_pocket_coor_shared.py", line 478, in net
node_attr_global, pos_attr_global = self.encoder_global(
File "/home/anaconda3/envs/PMDM/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/anaconda3/envs/PMDM/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/PMDM/PMDM/models/encoders/egnn.py", line 478, in forward
x = layer(x, edge_index, edge_attr, batch=batch, ligand_batch=ligand_batch, size=bsize, linker_mask=linker_mask)
File "/home/PMDM/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/home/anaconda3/envs/PMDM/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "/home/PMDM/PMDM/models/encoders/egnn.py", line 215, in forward
hidden_out, coors_out = self.propagate(edge_index, x=feats, edge_attr=edge_attr_feats,
ValueError: too many values to unpack (expected 2)
I have check the code, and I found the code have error:
the "self.propagate(edge_index, x=feats, edge_attr=edge_attr_feats,)" fuction return a tensor with shape of torch.Size([10432, 128])
could you help us to fix code ?
ps: I use the lastest version code ( updated in 2024.04.02)
from pmdm.
Thanks! @Layne-Huang
from pmdm.
Related Issues (20)
- fail to run sample_for_pdb.py HOT 16
- Bugs in sample_linker.py HOT 4
- ValueError: too many values to unpack (expected 2) HOT 7
- Some packages in mol.yml are incorrect, such as cudatoolkit, geometric, scatter, etc HOT 1
- Training loss does not decrease
- Training loss does not decrease HOT 6
- sample_frag.py doesn't keep the seed frag fixed HOT 9
- Code Issue HOT 1
- Inquiry on Utilizing Your Trained Model for Molecule Generation in Protein Pockets HOT 7
- No matching distribution found for mkl==2017.0.3 HOT 1
- Unexpected Results in Sampling for Custom Pockets HOT 4
- sample_for_pdb.py error HOT 3
- sample_linker doesn't add atoms totally in the broken site HOT 1
- How to generate .lmdb and .pt file before training? HOT 1
- How to sample small molecules for a specific pocket in a PDB file๏ผ HOT 2
- How to generate bond HOT 2
- Missing File for training HOT 2
- generate novel molecules from a seed fragment using sample_frag.py HOT 13
- Inquiry about GPU Memory Requirements for Running Pre-trained Model HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pmdm.