Skip to content

guess_TopologyAttrs guesses incorrect bonds for DMS lipids in MDAnalysis > 2.7.0 #5102

@ricard1997

Description

@ricard1997

Expected Behavior

When using guess_TopologyAttrs to generate bonds for DSM lipids, the bonds around atom C3S (or any C*S) should be guessed correctly. For example:

("C3S", "C4S"), ("C3S", "C2S"), ("C3S", "H3S"), ("C3S", "H3T")

Actual Behavior

In MDAnalysis versions > 2.7.0, guess_TopologyAttrs produces incorrect extra bonds, e.g.:

[('C3S', 'C5S'), ('C3S', 'H4T'), ('C3S', 'H4S'),
('C3S', 'C4S'), ('C3S', 'HO3'), ('C3S', 'O3'),
('C3S', 'H3S'), ('C3S', 'H2S'), ('C3S', 'C2S'),
('C3S', 'NF'), ('C3S', 'C1S')]

This only happens for the lipid tail with atoms labeled CS. The other tail with CT behaves as expected.

Code to Reproduce
import MDAnalysis as mda

Load structure with DMS lipid (minimal example)

u = mda.Universe("lipid_dms.pdb")
structure = u.select_atoms("resname DSM")

Guess bonds

structure.guess_TopologyAttrs(to_guess=["bonds"], fudge_factor=0.5)

for b in structure.bonds:
print(b)

Version Information

MDAnalysis: 2.7.0 → works as expected

MDAnalysis: > 2.7.0 → produces incorrect bonds

Python: 3.12

OS:Linux

Additional Notes

It seems that atom names like C3S may be misinterpreted as the element cesium (Cs), which has a much larger van der Waals radius, leading to spurious bonds.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions