MembraneCurvature
- Author:
Estefania Barreto-Ojeda
- Year:
2021
- Copyright:
GNU Public License v3
MembraneCurvature calculates the mean and Gaussian curvature of surfaces derived from a selection of reference.
Mean curvature is calculated in units of Å -1 and Gaussian curvature in units of Å -2.
- class membrane_curvature.base.MembraneCurvature(universe, select='all', n_x_bins=100, n_y_bins=100, x_range=None, y_range=None, wrap=True, **kwargs)[source]
MembraneCurvature is a tool to calculate membrane curvature.
- Parameters:
universe (Universe or AtomGroup) – An MDAnalysis Universe object.
select (str or iterable of str, optional.) – The selection string of an atom selection to use as a reference to derive a surface.
wrap (bool, optional) – Apply coordinate wrapping to pack atoms into the primary unit cell.
n_x_bins (int, optional, default: ‘100’) – Number of bins in grid in the x dimension.
n_y_bins (int, optional, default: ‘100’) – Number of bins in grid in the y dimension.
x_range (tuple of (float, float), optional, default: (0, universe.dimensions[0])) – Range of coordinates (min, max) in the x dimension.
y_range (tuple of (float, float), optional, default: (0, universe.dimensions[1])) – Range of coordinates (min, max) in the y dimension.
- Variables:
results.z_surface (ndarray) – Surface derived from atom selection in every frame. Array of shape (n_frames, n_x_bins, n_y_bins)
results.mean (ndarray) – Mean curvature associated to the surface. Array of shape (n_frames, n_x_bins, n_y_bins)
results.gaussian (ndarray) – Gaussian curvature associated to the surface. Arrays of shape (n_frames, n_x_bins, n_y_bins)
results.average_z_surface (ndarray) – Average of the array elements in z_surface. Each array has shape (n_x_bins, n_y_bins)
results.average_mean (ndarray) – Average of the array elements in mean_curvature. Each array has shape (n_x_bins, n_y_bins)
results.average_gaussian (ndarray) – Average of the array elements in gaussian_curvature. Each array has shape (n_x_bins, n_y_bins)
See also
wrap
Wrap/unwrap the atoms of a given AtomGroup in the unit cell.
Notes
Use wrap=True to translates the atoms of your mda.Universe back in the unit cell. Use wrap=False for processed trajectories where rotational/translational fit is performed.
For more details on when to use wrap=True, check the Usage page.
The derived surface and calculated curvatures are available in the
results
attributes.The attribute
average_z_surface
contains the derived surface averaged over the n_frames of the trajectory.The attributes
average_mean_curvature
andaverage_gaussian_curvature
contain the computed values of mean and Gaussian curvature averaged over the n_frames of the trajectory.Example
You can pass a universe containing your selection of reference:
import MDAnalysis as mda from membrane_curvature.base import MembraneCurvature u = mda.Universe(coordinates, trajectory) mc = MembraneCurvature(u).run() surface = mc.results.average_z_surface mean_curvature = mc.results.average_mean gaussian_curvature = mc.results.average_gaussian
The respective 2D curvature plots can be obtained using the matplotlib package for data visualization via
contourf()
orimshow()
.For specific examples visit the Usage page. Check the Visualization page for more examples to plot MembraneCurvature results using
contourf()
andimshow()
.