-
Notifications
You must be signed in to change notification settings - Fork 815
Closed
Description
Expected behavior
mdanalysis/package/MDAnalysis/core/groups.py
Lines 2918 to 2926 in 971248a
| def guess_bonds(self, vdwradii=None): | |
| """Guess bonds that exist within this :class:`AtomGroup` and add them to | |
| the underlying :attr:`~AtomGroup.universe`. | |
| Parameters | |
| ---------- | |
| vdwradii : dict, optional | |
| Dict relating atom types: vdw radii | |
AtomGroup.guess_bonds guesses bonds, only.
Actual behavior
It guesses bonds, angles, and dihedrals.
If the method is going to guess angles, it could guess improper dihedrals too from the angles.
Code to reproduce the behavior
Show us how to reproduce the failiure. If you can, use trajectory files from the test data.
mdanalysis/package/MDAnalysis/core/groups.py
Lines 2937 to 2961 in 971248a
| from ..topology.core import guess_bonds, guess_angles, guess_dihedrals | |
| from .topologyattrs import Bonds, Angles, Dihedrals | |
| def get_TopAttr(u, name, cls): | |
| """either get *name* or create one from *cls*""" | |
| try: | |
| return getattr(u._topology, name) | |
| except AttributeError: | |
| attr = cls([]) | |
| u.add_TopologyAttr(attr) | |
| return attr | |
| # indices of bonds | |
| box = self.dimensions if self.dimensions.all() else None | |
| b = guess_bonds(self.atoms, self.atoms.positions, vdwradii=vdwradii, box=box) | |
| bondattr = get_TopAttr(self.universe, 'bonds', Bonds) | |
| bondattr.add_bonds(b, guessed=True) | |
| a = guess_angles(self.bonds) | |
| angleattr = get_TopAttr(self.universe, 'angles', Angles) | |
| angleattr.add_bonds(a, guessed=True) | |
| d = guess_dihedrals(self.angles) | |
| diheattr = get_TopAttr(self.universe, 'dihedrals', Dihedrals) | |
| diheattr.add_bonds(d) |
Currently version of MDAnalysis
- Which version are you using? current develop branch
Also
It would be useful to be able to pass in fudge_factor and lower_bound kwargs to this method (to pass onto guessers.guess_bonds)
Reactions are currently unavailable