Closed peastman closed 1 year ago
Unfortunately, just specifying proximityBonding=False
doesn't work either due to another flaw in the RDKit PDB reader: it doesn't fill in bonds for standard residues. I don't think RDKit is capable of reading PDB files correctly.
Thanks for the report. I think that Molecule.from_pdb_and_smiles(pdbfile, smiles)
is now completely superseded by Topology.from_pdb(pdbfile, unique_molecules=[Molecule.from_smiles(smiles)])
(which uses OpenMM to correctly read the PDB).
Does using Topology.from_pdb
give you a workaround for the immediate problem?
I didn't know there were two different functions for loading PDB files. The workaround I came up with was to copy the logic from RDKitToolkitWrapper.from_pdb_and_smiles()
: create a molecule with Molecule.from_smiles()
, load the PDB with OpenMM, construct another Molecule based on it, and call Molecule.are_isomorphic()
to find a mapping between them.
Describe the bug
I am trying to load a valid PDB file. OpenFF Toolkit throws an exception and fails to load it.
This happens because the PDB file describes a strained conformation. By default, RDKit tries to infer bonds based on the distance between atoms. That leads it to incorrectly think there is an extra bond. That is not standard behavior: a correct PDB file lists bonds explicitly with CONECT records, as this one does. To disable that, you need to specify
proximityBonding=False
when callingMolFromPDBFile()
.To Reproduce
Put the following into a file called
error.pdb
.Then load it with the command
Output
Computing environment (please complete the following information):
conda list