Skip to content

Recommended practice of finding bonded hydrogen from hydrogen bond donor #2521

@xiki-tempula

Description

@xiki-tempula

Currently, in the water bridge analysis module, the user needs to give the name for the hydrogen bond donor heavy atom and the hydrogens were found via a simple distance search. I'm interested in using the bonded information if possible for this step. However, I'm a man of gro and xtc and I'm not quite sure of how much information a topology file can provide.

I have checked @p-j-smith 's implementation and found that it is done by finding the bonded atom associated with the hydrogens. However, in water bridge analysis, the name of hydrogen bond donor heavy atom is provided instead of the hydrogen bond donor hydrogens. Thus, I need to find the hydrogen atoms associated with the atom and exclude the non-hydrogen atoms.

I can think of two implementations.

hydrogens = [atom for atom in heavy_atom.bonded_atoms if atom.name[0] == 'H']

or

hydrogens = [atom for atom in heavy_atom.bonded_atoms if atom.type == 'H']

Technically, the two implementations should be the same. Since I'm not very familiar with the universe where topology information is available and the type of files where the user might supply, I'm wondering if one implementation might be more robust and less error-prone than the other?

This issue is related to #2120.

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