Closed wenchangzhou-qtx closed 2 months ago
Yes, the checkpoint (500.pt) could be found in Zenodo.
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
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!
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'
It could work now.
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
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)
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.
Thanks! @Layne-Huang
Hey @Layne-Huang,
Great work!
I'm trying to follow by testing a few example commands in the repo, for example the first command under "Inference",
python -u sample_batch.py --ckpt <checkpoint> --num_samples <number of samples> --sampling_type generalized
, is there a checkpoint file I need to provide?I tried without it but I got error here below: