Skip to content

Topology readers are not aware of virtual sites #1954

@jbarnoud

Description

@jbarnoud

Virtual sites are atoms the coordinates of which are built frame by frame from the coordinates of other atoms. MDAnalysis reads the coordinates of these atoms as for any other ones. Yet, it does not read the connection between the virtual sites and the atoms they are built from. Therefore, the virtual sites appear as not connected to the rest of the molecule which breaks the expected behaviour of ag.fragments and make_whole.

A solution would be to have a VirtualSites topology attribute that connects the relevant atoms. With the relationship described, the appropriate edges can be added to the graph used by ag.fragments and make_whole can translate the virtual sites with the building atoms. The difficulty is that virtual sites can be built from any number of atoms, yet from my tests, TopologyGroups store the indices as an array of ints. I do not know if it is possible to make a TopologyGroup with an array of lists (dtype=object) instead.

Note that virtual sites are especially used by gromacs, and I have the TPR reader in mind, but they seem to exist in other simulation engines.

See #1949 and #588.

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