Giter Club home page Giter Club logo

Comments (8)

Layne-Huang avatar Layne-Huang commented on September 11, 2024 1

Yes, the checkpoint (500.pt) could be found in Zenodo.

from pmdm.

Layne-Huang avatar Layne-Huang commented on September 11, 2024 1

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.

Layne-Huang avatar Layne-Huang commented on September 11, 2024 1

It could work now.

from pmdm.

Layne-Huang avatar Layne-Huang commented on September 11, 2024 1

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.

wenchangzhou-qtx avatar wenchangzhou-qtx commented on September 11, 2024

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.

wenchangzhou-qtx avatar wenchangzhou-qtx commented on September 11, 2024

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.

FeilongWuHaa avatar FeilongWuHaa commented on September 11, 2024

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.

FeilongWuHaa avatar FeilongWuHaa commented on September 11, 2024

Thanks! @Layne-Huang

from pmdm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.