Skip to content

Commit

Permalink
Hydrogen Bonding: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclark5 committed Sep 27, 2022
1 parent d1a7182 commit f7f8bf5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
26 changes: 25 additions & 1 deletion package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@
protein-water and protein-protein hydrogen bonds will be found, but
no water-water hydrogen bonds.
One can now also define hydrogen bonds with atom types::
import MDAnalysis
from MDAnalysis.analysis.hydrogenbonds.hbond_analysis import HydrogenBondAnalysis as HBA
hbonds = HBA(
universe=u,
donors_sel='type 2',
hydrogens_sel='type 1',
acceptors_sel='type 2',
)
In order to compute the hydrogen bond lifetime, after finding hydrogen bonds
one can use the :attr:`lifetime` function::
Expand Down Expand Up @@ -261,6 +272,9 @@ def __init__(self, universe,
"""Set up atom selections and geometric criteria for finding hydrogen
bonds in a Universe.
Hydrogen bond selections may be achieved with either a resname, atom
name combination, or when those are absent, atom types.
Parameters
----------
universe : Universe
Expand Down Expand Up @@ -311,6 +325,8 @@ def __init__(self, universe,
information is used, as this is the only way that guarantees the
correct identification of donor-hydrogen pairs.
.. versionchanged:: 2.4.0
Added use of atom types
.. versionadded:: 2.0.0
Added `between` keyword
"""
Expand Down Expand Up @@ -368,6 +384,9 @@ def guess_hydrogens(self,
):
"""Guesses which hydrogen atoms should be used in the analysis.
Hydrogen selections may be achieved with either a resname, atom
name combination, or when those are absent, atom types.
Parameters
----------
select: str (optional)
Expand Down Expand Up @@ -428,6 +447,9 @@ def guess_donors(self, select='all', max_charge=-0.5):
"""Guesses which atoms could be considered donors in the analysis. Only use if the universe topology does not
contain bonding information, otherwise donor-hydrogen pairs may be incorrectly assigned.
Donor selections may be achieved with either a resname, atom
name combination, or when those are absent, atom types.
Parameters
----------
select: str (optional)
Expand Down Expand Up @@ -466,7 +488,6 @@ def guess_donors(self, select='all', max_charge=-0.5):

if hasattr(hydrogens_ag[0],"bonded_atoms") and hydrogens_ag[0].bonded_atoms:
donors_ag = find_hydrogen_donors(hydrogens_ag)
# donors_ag = self.u.atoms[[x.bonded_atoms[0].ix for x in hydrogens_ag]]
else:
ag = hydrogens_ag.residues.atoms.select_atoms(
"({donors_sel}) and around {d_h_cutoff} {hydrogens_sel}".format(
Expand Down Expand Up @@ -495,6 +516,9 @@ def guess_donors(self, select='all', max_charge=-0.5):
def guess_acceptors(self, select='all', max_charge=-0.5):
"""Guesses which atoms could be considered acceptors in the analysis.
Acceptor selections may be achieved with either a resname, atom
name combination, or when those are absent, atom types.
Parameters
----------
select: str (optional)
Expand Down
4 changes: 0 additions & 4 deletions package/doc/sphinx/source/documentation_pages/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ If you use the Mean Squared Displacement analysis code in
.. _`10.21105/joss.00877`: https://doi.org/10.21105/joss.00877

For additional information on non-gaussian parameter, consider [Fuchs1998]_.

.. [Fuchs1998] Fuchs M., Gotze W., and Mayr M. R. Asymptotic laws for tagged-particle motion in glassy systems. *Phys. Rev. E*, 58(3), 3384-3399. doi:`10.1103/PhysRevE.58.3384 <https://doi.org/10.1103/PhysRevE.58.3384>`_
If you calculate shape parameters using
:meth:`~MDAnalysis.core.group.AtomGroup.shape_parameter`,
:meth:`~MDAnalysis.core.group.ResidueGroup.shape_parameter`,
Expand Down

0 comments on commit f7f8bf5

Please sign in to comment.