Closed noahharrison64 closed 2 years ago
Hi Noah,
This is due to the code that guesses bonds from coordinates in MDAnalysis. You can see which atoms are causing the problem with the following snippet:
u = mda.Universe("prot.pdb", guess_bonds=True)
for atom in u.atoms:
# find hydrogens with more than one bond
if atom.element == "H" and len(atom.bonds) > 1:
neighbours = set([i for i in atom.bonds.indices.flatten() if i != atom.index])
for i in neighbours:
neighbour = u.atoms[i]
# find neighbour to H from different residue
if neighbour.resid != atom.resid:
print(f"{atom.resname}{atom.resid}:{atom.name}",
f"{neighbour.resname}{neighbour.resid}:{neighbour.name}")
Then visualize the problematic residues with PyMOL to make sure there's no actual clash.
If there's none you'll have to modify the van der Waals radii used by MDAnalysis to determine which atoms are connected by covalent bonds:
# radii used by MDAnalysis
print(mda.topology.guessers.tables.vdwradii)
# modify the radii for problematic atom types
u = mda.Universe("prot.pdb", guess_bonds=True, vdwradii={"H": 0.95, "O": ...})
It's a bit of a tedious process but unless you can directly have bonds in your PDB file, that's the only way I can think of.
Good luck! Cedric
Hi Cédric,
Thanks for pointing this out. The error now makes more sense and has provided some means to fixing this issue.
I'm using prolif for docking solutions, so as I'm only interested in static structures of the ligand in the binding site I might restrict my atom selection to just binding site residues before creating a prolif mol. Hopefully this will reduce the impact of the issue.
Thanks, Noah
Hi Cédric,
I've been encountering an issue when creating a prolif molecule from a PDB file. I run
u = mda.Universe(filename) prolif.Molecule.from_mda(u)
And the debug shows the error arises when using the RDKitConverter from MDAnalysis. I noticed you contributed to this module so thought it'd be fine posting here.I see no issues with this atom or its valences. This problem has arisen multiple times with multiple different PDBs, and I'm sure the atoms are fine. For example, atom 337 belongs to Ile1071. Here is the atom info from the PDB file.
Furthermore, looking at this residue in 3D doesn't identify any errors.
Do you have any suggestions as to what might be causing this issue and how it might be fixed?
Many thanks, Noah