3.6.2. Water dynamics analysis — MDAnalysis.analysis.waterdynamics
¶
Author: | Alejandro Bernardin |
---|---|
Year: | 2014-2015 |
Copyright: | GNU Public License v3 |
New in version 0.11.0.
This module provides functions to analize water dynamics trajectories and water interactions with other molecules. The functions in this module are: water orientational relaxation (WOR) [Yeh1999], hydrogen bond lifetimes (HBL) [Rapaport1983], angular distribution (AD) [Grigera1995], mean square displacement (MSD) [Brodka1994] and survival probability (SP) [Liu2004].
For more information about this type of analysis please refer to [Araya-Secchi2014] (water in a protein cavity) and [Milischuk2011] (water in a nanopore).
References
[Rapaport1983] | (1, 2) D.C. Rapaport (1983): Hydrogen bonds in water, Molecular Physics: An International Journal at the Interface Between Chemistry and Physics, 50:5, 1151-1162. |
[Yeh1999] | Yu-ling Yeh and Chung-Yuan Mou (1999). Orientational Relaxation Dynamics of Liquid Water Studied by Molecular Dynamics Simulation, J. Phys. Chem. B 1999, 103, 3699-3705. |
[Grigera1995] | Raul Grigera, Susana G. Kalko and Jorge Fischbarg (1995). Wall-Water Interface. A Molecular Dynamics Study, Langmuir 1996,12,154-158 |
[Liu2004] | Pu Liu, Edward Harder, and B. J. Berne (2004).On the Calculation of Diffusion Coefficients in Confined Fluids and Interfaces with an Application to the Liquid-Vapor Interface of Water, J. Phys. Chem. B 2004, 108, 6595-6602. |
[Brodka1994] | Aleksander Brodka (1994). Diffusion in restricted volume, Molecular Physics, 1994, Vol. 82, No. 5, 1075-1078. |
[Araya-Secchi2014] | Araya-Secchi, R., Tomas Perez-Acle, Seung-gu Kang, Tien Huynh, Alejandro Bernardin, Yerko Escalona, Jose-Antonio Garate, Agustin D. Martinez, Isaac E. Garcia, Juan C. Saez, Ruhong Zhou (2014). Characterization of a novel water pocket inside the human Cx26 hemichannel structure. Biophysical journal, 107(3), 599-612. |
[Milischuk2011] | Anatoli A. Milischuk and Branka M. Ladanyi. Structure and dynamics of water confined in silica nanopores. J. Chem. Phys. 135, 174709 (2011); doi: 10.1063/1.3657408 |
3.6.2.1. Examples¶
3.6.2.1.1. HydrogenBondLifetimes¶
Analyzing hydrogen bond lifetimes (HBL) HydrogenBondLifetimes
, both continuos and intermittent. In this case we are analyzing
how residue 38 interact with a water sphere of radius 6.0 centered on the geometric center of protein and
residue 42. If the hydrogen bond lifetimes are very stable, we can assume that residue 38 is hydrophilic, on the other
hand, if the are very unstable, we can assume that residue 38 is hydrophobic:
import MDAnalysis
from MDAnalysis.analysis.waterdynamics import HydrogenBondLifetimes as HBL
u = MDAnalysis.Universe(pdb, trajectory)
selection1 = "byres name OH2 and sphzone 6.0 protein and resid 42"
selection2 = "resid 38"
HBL_analysis = HBL(universe, selection1, selection2, 0, 2000, 30)
HBL_analysis.run()
i=0
#now we print the data ready to graph. The first two columns are the HBLc vs t graph and
#the second two columns are the HBLi vs t graph
for HBLc, HBLi in HBL_analysis.timeseries:
print i +" "+ HBLc +" "+ i +" "+ HBLi
i+=1
where HBLc is the value for the continuos hydrogen bond lifetimes and HBLi is the value for the intermittent hydrogen bond lifetime, t0 = 0, tf = 2000 and dtmax = 30. In this way we create 30 windows timestep (30 values in x axis). The continuos hydrogen bond lifetimes should decay faster than intermittent.
3.6.2.1.2. WaterOrientationalRelaxation¶
Analyzing water orientational relaxation (WOR) WaterOrientationalRelaxation
. In this case we are analyzing “how fast” water molecules are rotating/changing direction. If WOR is very stable we can assume that water molecules are rotating/changing direction very slow, on the other hand, if WOR decay very fast, we can assume that water molecules are rotating/changing direction very fast:
import MDAnalysis
from MDAnalysis.analysis.waterdynamics import WaterOrientationalRelaxation as WOR
u = MDAnalysis.Universe(pdb, trajectory)
selection = "byres name OH2 and sphzone 6.0 protein and resid 42"
WOR_analysis = WOR(universe, selection, 0, 1000, 20)
WOR_analysis.run()
i=0
#now we print the data ready to graph. The first two columns are WOR_OH vs t graph,
#the second two columns are WOR_HH vs t graph and the third two columns are WOR_dip vs t graph
for WOR_OH, WOR_HH, WOR_dip in WOR_analysis.timeseries:
print i +" "+ WOR_OH +" "+ i +" "+ WOR_HH +" "+ i +" "+ WOR_dip
where t0 = 0, tf = 1000 and dtmax = 20. In this way we create 20 windows timesteps (20 values in the x axis), the first window is created with 1000 timestep average (1000/1), the second window is created with 500 timestep average(1000/2), the third window is created with 333 timestep average (1000/3) and so on.
3.6.2.1.3. AngularDistribution¶
Analyzing angular distribution (AD) AngularDistribution
for OH vector, HH vector and dipole vector. It returns
a line histogram with vector orientation preference. A straight line in the output graphic means no preferential
orientation in water molecules. In this case we are analyzing if water molecules have some orientational
preference, in this way we can see if water molecules are under an electric field or if they are interacting
with something (residue, protein, etc):
import MDAnalysis
from MDAnalysis.analysis.waterdynamics import AngularDistribution as AD
u = MDAnalysis.Universe(pdb, trajectory)
selection = "byres name OH2 and sphzone 6.0 (protein and (resid 42 or resid 26) )"
bins = 30
AD_analysis = AD(universe,selection,bins)
AD_analysis.run()
#now we print data ready to graph. The first two columns are P(cos(theta)) vs cos(theta) for OH vector ,
#the seconds two columns are P(cos(theta)) vs cos(theta) for HH vector and thirds two columns
#are P(cos(theta)) vs cos(theta) for dipole vector
for i in range(bins):
print AD_analysis.graph[0][i] +" "+ AD_analysis.graph[1][i] +" "+ AD_analysis.graph[2][i]
where P(cos(theta)) is the angular distribution or angular probabilities.
3.6.2.1.4. MeanSquareDisplacement¶
Analyzing mean square displacement (MSD):class:MeanSquareDisplacement for water molecules. In this case we are analyzing the average distance that water molecules travels inside protein in XYZ direction (cylindric zone of radius 11[nm], Zmax 4.0[nm] and Zmin -8.0[nm]). A strong rise mean a fast movement of water molecules, a weak rise mean slow movement of particles:
import MDAnalysis
from MDAnalysis.analysis.waterdynamics import MeanSquareDisplacement as MSD
u = MDAnalysis.Universe(pdb, trajectory)
selection = "byres name OH2 and cyzone 11.0 4.0 -8.0 protein"
MSD_analysis = MSD(universe, selection, 0, 1000, 20)
MSD_analysis.run()
#now we print data ready to graph. The graph
#represents MSD vs t
i=0
for msd in MSD_analysis.timeseries:
print i +" "+ msd
i += 1
3.6.2.1.5. SurvivalProbability¶
Analyzing survival probability (SP) SurvivalProbability
for water molecules. In this case we are analyzing how long water
molecules remain in a sphere of radius 12.3 centered in the geometrical center of resid 42, 26, 34 and 80.
A slow decay of SP means a long permanence time of water molecules in the zone, on the
other hand, a fast decay means a short permanence time:
import MDAnalysis
from MDAnalysis.analysis.waterdynamics import SurvivalProbability as SP
u = MDAnalysis.Universe(pdb, trajectory)
selection = "byres name OH2 and sphzone 12.3 (resid 42 or resid 26 or resid 34 or resid 80) "
SP_analysis = SP(universe, selection, 0, 100, 20)
SP_analysis.run()
#now we print data ready to graph. The graph
#represents SP vs t
i=0
for sp in SP_analysis.timeseries:
print i +" "+ sp
i += 1
3.6.2.2. Output¶
3.6.2.2.1. HydrogenBondLifetimes¶
Hydrogen bond lifetimes (HBL) data is returned per window timestep, which is stored in
HydrogenBondLifetimes.timeseries
(in all the following descriptions, # indicates comments that are not part of the output):
results = [
[ # time t0
<HBL_c>, <HBL_i>
],
[ # time t1
<HBL_c>, <HBL_i>
],
...
]
3.6.2.2.2. WaterOrientationalRelaxation¶
Water orientational relaxation (WOR) data is returned per window timestep, which is stored in
WaterOrientationalRelaxation.timeseries
:
results = [
[ # time t0
<WOR_OH>, <WOR_HH>, <WOR_dip>
],
[ # time t1
<WOR_OH>, <WOR_HH>, <WOR_dip>
],
...
]
3.6.2.2.3. AngularDistribution¶
Angular distribution (AD) data is returned per vector, which is stored in
AngularDistribution.graph
. In fact, AngularDistribution returns a histogram:
results = [
[ # OH vector values
# the values are order in this way: <x_axis y_axis>
<cos_theta0 ang_distr0>, <cos_theta1 ang_distr1>, ...
],
[ # HH vector values
<cos_theta0 ang_distr0>, <cos_theta1 ang_distr1>, ...
],
[ # dip vector values
<cos_theta0 ang_distr0>, <cos_theta1 ang_distr1>, ...
],
]
3.6.2.2.4. MeanSquareDisplacement¶
Mean Square Displacement (MSD) data is returned in a list, which each element represents a MSD value in its respective
window timestep. Data is stored in MeanSquareDisplacement.timeseries
:
results = [
#MSD values orders by window timestep
<MSD_t0>, <MSD_t1>, ...
]
3.6.2.2.5. SurvivalProbability¶
Survival Probability (SP) data is returned in a list, which each element represents a SP value in its respective
window timestep. Data is stored in SurvivalProbability.timeseries
:
results = [
# SP values order by window timestep
<SP_t0>, <SP_t1>, ...
]
3.6.2.3. Classes¶
-
class
MDAnalysis.analysis.waterdynamics.
HydrogenBondLifetimes
(universe, selection1, selection2, t0, tf, dtmax, nproc=1)[source]¶ This is a autocorrelation function that gives the “Hydrogen Bond Lifetimes” (HBL) proposed by D.C. Rapaport [Rapaport1983]. From this function we can obtain the continuos and intermittent behavior of hydrogen bonds in time. A fast decay in these parameters indicate a fast change in HBs connectivity. A slow decay indicate very stables hydrogen bonds, like in ice. The HBL is also know as “Hydrogen Bond Population Relaxation” (HBPR). In the continuos case we have:
\[C_{HB}^c(\tau) = \frac{\sum_{ij}h_{ij}(t_0)h'_{ij}(t_0+\tau)}{\sum_{ij}h_{ij}(t_0)}\]where \(h'_{ij}(t_0+\tau)=1\) if there is a H-bond between a pair \(ij\) during time interval \(t_0+\tau\) (continuos) and \(h'_{ij}(t_0+\tau)=0\) otherwise. In the intermittent case we have:
\[C_{HB}^i(\tau) = \frac{\sum_{ij}h_{ij}(t_0)h_{ij}(t_0+\tau)}{\sum_{ij}h_{ij}(t_0)}\]where \(h_{ij}(t_0+\tau)=1\) if there is a H-bond between a pair \(ij\) at time \(t_0+\tau\) (intermittent) and \(h_{ij}(t_0+\tau)=0\) otherwise.
New in version 0.11.0.
Arguments: - universe
Universe object
- selection1
Selection string for first selection [‘byres name OH2’] It could be any selection available in MDAnalysis, not just water.
- selection2
Selection string to analize its HBL against selection1
- t0
Time where analysis begin
- tf
Time where analysis end
- dtmax
Maximum dt size, dtmax < tf or it will crash.
- nproc
Number of processors to use, by default is 1.
-
class
MDAnalysis.analysis.waterdynamics.
WaterOrientationalRelaxation
(universe, selection, t0, tf, dtmax, nproc=1)[source]¶ Function to evaluate the Water Orientational Relaxation proposed by Yu-ling Yeh and Chung-Yuan Mou [Yeh1999]. WaterOrientationalRelaxation indicates “how fast” water molecules are rotating or changing direction. This is a time correlation function given by:
\[C_{\hat u}(\tau)=\langle \mathit{P}_2[\mathbf{\hat{u}}(t_0)\cdot\mathbf{\hat{u}}(t_0+\tau)]\rangle\]where \(P_2=(3x^2-1)/2\) is the second-order Legendre polynomial and \(\hat{u}\) is a unit vector along HH, OH or dipole vector.
New in version 0.11.0.
Arguments: - universe
Universe object
- selection
Selection string, only models with 3 atoms molecules are allowed (TIP3, TIP3P, etc)
- t0
Time where analysis begin
- tf
Time where analysis end
- dtmax
Maximum dt size window, dtmax < tf or it will crash.
-
class
MDAnalysis.analysis.waterdynamics.
AngularDistribution
(universe, selection_str, bins=40, nproc=1, axis='z')[source]¶ The angular distribution function (AD) is defined as the distribution probability of the cosine of the \(\theta\) angle formed by the OH vector, HH vector or dipolar vector of water molecules and a vector \(\hat n\) parallel to chosen axis (z is the default value). The cosine is define as \(\cos \theta = \hat u \cdot \hat n\), where \(\hat u\) is OH, HH or dipole vector. It creates a histogram and returns a list of lists, see Output. The AD is also know as Angular Probability (AP).
New in version 0.11.0.
Arguments: - universe
Universe object
- selection
Selection string to evaluate its angular distribution [‘byres name OH2’]
- bins
Number of bins to create the histogram by means of numpy.histogram [40]
- axis
Axis to create angle with the vector (HH, OH or dipole) and calculate cosine theta [‘z’]. Options: ‘x’, ‘y’, ‘z’
-
class
MDAnalysis.analysis.waterdynamics.
MeanSquareDisplacement
(universe, selection, t0, tf, dtmax, nproc=1)[source]¶ Function to evaluate the Mean Square Displacement (MSD). The MSD gives the average distance that particles travels. The MSD is given by:
\[\langle\Delta r(t)^2\rangle = 2nDt\]where \(r(t)\) is the position of particle in time \(t\), \(\Delta r(t)\) is the displacement after time lag \(t\), \(n\) is the dimensionality, in this case \(n=3\), \(D\) is the diffusion coefficient and \(t\) is the time.
New in version 0.11.0.
Arguments: - universe
Universe object
- selection
Selection string
- t0
Time where analysis begin
- tf
Time where analysis end
- dtmax
Maximum dt size window, dtmax < tf or it will crash.
-
class
MDAnalysis.analysis.waterdynamics.
SurvivalProbability
(universe, selection, t0, tf, dtmax, nproc=1)[source]¶ Function to evaluate the Survival Probability (SP). The SP gives the probability for a group of particles to remain in certain region. The SP is given by:
\[P(\tau) = \frac1T \sum_{t=1}^T \frac{N(t,t+\tau)}{N(t)}\]where \(T\) is the maximum time of simulation, \(\tau\) is the timestep and \(N\) the number of particles in certain time.
New in version 0.11.0.
Arguments: - universe
Universe object
- selection
Selection string, any selection is allowed, with this selection you define the region/zone where to analize, i.e.: “selection_a” and “zone” (see SP examples )
- t0
Time where analysis begin
- tf
Time where analysis end
- dtmax
Maximum dt size window, dtmax < tf or it will crash