HydrogenBonds

Classes

class HydrogenBonds.HydrogenBonds(data, acceptors='hbacceptors', donors='hbdonors', hydrogens=None, maxTime=50, nbrTimeOri=20, step=1, maxR=2.5, minAngle=130)

This class defines methods to compute hydrogen bonds auto-correlation functions.

Some plotting methods are also available to quicly check the results.

Parameters:
  • data – a Dataset class instance containing trajectories data
  • acceptors – selection of acceptors atoms for hydrogen bonds
  • donors – selection of donors atoms for hydrogen bonds
  • hydrogens

    selection of hydrogens bound to donors (optional, if None, hydrogens

    will be guessed from donors list)
  • maxTime – maximum time interval to be used for correlation in number of frames (optional, default 100)
  • step – number of frames between each time interval points (optional, default 1)
  • nbrTimeOri – number of time origins to be averaged over (optional, default 25)
  • maxR – maximum distance to allow for hydrogen bonding, angström (optional, default 2.8)
  • minAngle – minimum angle to allow for hydrogen bonding (optional, default 130)
References:
  • D.C. Rapaport (1983): Hydrogen bonds in water, Molecular Physics: An International Journal at the Interface Between Chemistry and Physics, 50:5, 1151-1162
compAutoCorrel(continuous=1)

Computes the hydrogen bonds autocorrelation function.

Both distances and angles are computed exactly, without any approximation, to single-point precision.

Parameters:continuous – set to 1, continuous correlation is computed set to 0 for intermittent case

The result, a 1D array containing correlations for all time intervals is stored in cc or ic attributes variable for continuous or intermittent types respectively.

compHBNumber(frames=None)

Computes the number of hydrogen bonds for each selected frame.

Both distances and angles are computed exactly, without any approximation, to single-point precision.

Parameters:frames – the frames from which the number of hydrogen bonds will be determined.

The result, a 1D array containing the number of hydrogen bonds for each frame is stored in the nbrHB class attribute.

plotAutoCorrel(corrType='continuous')

Used to quickly plot autocorrelation function, either continuous or intermittent depending on the value of corrType parameter.

Parameters:corrType (str) – type of correlation to plot