Skip to content

Report ligand ID & continue on batch ligand preparation error #362

@Billsfriend

Description

@Billsfriend

I was preparing batch ligand pdbqt using mk_prepare_ligand.py from scrub.py output sdf file, and I encountered an error:

Traceback (most recent call last):
  File "/home/gjsx/micromamba/envs/ringtail/bin/mk_prepare_ligand.py", line 10, in <module>
    sys.exit(main())
  File "/home/gjsx/micromamba/envs/ringtail/lib/python3.10/site-packages/meeko/cli/mk_prepare_ligand.py", line 613, in main
    molsetups = preparator.prepare(mol)
  File "/home/gjsx/micromamba/envs/ringtail/lib/python3.10/site-packages/meeko/preparation.py", line 489, in prepare
    setup = setup_class.from_mol(
  File "/home/gjsx/micromamba/envs/ringtail/lib/python3.10/site-packages/meeko/molsetup.py", line 1607, in from_mol
    raise ValueError(f"RDKit molecule has {len(Chem.GetMolFrags(mol))} fragments. Must have 1.")
ValueError: RDKit molecule has 2 fragments. Must have 1.

The reason was clear, but I did not get to know which SMILES and ligand ID caused this error in my ligand batch.
It will be helpful if the SMILES and ID are printed like warnings I got from mk_prepare_ligand.py:

warning: found the maximum nr of matches (17) in RDKitMolSetup.get_symmetries_for_rmsd
Maybe this molecule is "too" symmetric? ZINC000001667248 CC(C)(c1ccccc1)C(C)(C)c1ccccc1

Also, it will be better if we can treat fragment error as a warning and continue to prepare other ligands in batch mode.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions