Binning Nearest Surface

Added in version 2.0.0.

With surface_method='binning_nearest', MembraneCurvature builds a grid to derive a surface by assigning each grid point the z of the nearest lipid in the xy plane following the minimum-image convention. Grid points sit at bin corners (left + i * bin_size). This is the same algorithm used in g_lomepro to derive surfaces from lipid centers as described in [CAG2009].

This height field is then used to calculate mean and Gaussian curvature using finite differences.

Note that this method is different from the binning and fourier methods, which evaluate the surface on bin centres. For the same bin counts and box extent, the binning_nearest method’s maps are offset by half a bin relative to the binning and fourier methods.

[CAG2009] (1,2)

Vytautas Gapsys, Bert L. de Groot, Rodolfo Briones, Computational analysis of local membrane properties, Journal of Computer-Aided Molecular Design (2013), doi: 10.1007/s10822-013-9684-0.

Warning

Running with surface_method='binning_nearest' does NOT mean that MembraneCurvature reproduces the results from g_lomepro. The binning_nearest method reproduces the grid construction and nearest-lipid assignment as implemented in [CAG2009].

Note

The binning nearest method supports a brick-wall filter to remove high-frequency noise from the height field. The filter is applied to the height field before calculating curvature. For more details, check the API documentation for the FFT filtering module.

Functions

membrane_curvature.binning_nearest_surface._z_surface_from_nearest(refs_xy, lipid_centers, box, grid_shape)[source]

Assign each grid point the z of the nearest lipid in the xy plane.

membrane_curvature.binning_nearest_surface.get_z_surface_nearest(atomgroup, n_x_bins=10, n_y_bins=10, box=None, grid_origin='box', x_range=None, y_range=None)[source]

Derive surface by assigning each grid corner the z of the nearest lipid in xy.

The atomgroup should contain reference atoms for a single leaflet. The height field is sampled at bin corners (left + i * bin_size), not bin centres. Minimum-image distances use distance_array().

Parameters:
  • atomgroup (MDAnalysis.core.groups.AtomGroup) – Reference atoms for one leaflet (typically one atom per lipid).

  • n_x_bins (int) – Number of bins along x.

  • n_y_bins (int) – Number of bins along y.

  • box (array-like, optional) – Unit cell in MDAnalysis format [lx, ly, lz, alpha, beta, gamma]. Required for periodic minimum-image distances.

  • grid_origin ({‘box’, ‘lipid_bbox’}) – How to set the xy grid extent. box uses [0, lx] and [0, ly].

  • x_range (tuple of (float, float), optional) – Override grid extent along x as (left_x, right_x).

  • y_range (tuple of (float, float), optional) – Override grid extent along y as (left_y, right_y).

Returns:

  • z_surface (numpy.ndarray) – Height field of shape (n_x_bins, n_y_bins).

  • grid_axes (dict) – Per-frame grid metadata: left_x, left_y, dx, dy.

membrane_curvature.binning_nearest_surface.lipid_center_positions(atomgroup)[source]

One reference point per lipid: the center of the selected atoms in each residue.

Note

Only atoms in atomgroup contribute. Same selection as the surface method, not the full residue. For a one-atom reference such as name PO4 the point is that bead’s position. This is the same reference used by the binning and fourier surface methods. When several atoms per residue are selected they are reduced to their mass weighted center. Geometric center when masses are unavailable or all zero.

Parameters:

atomgroup (MDAnalysis.core.groups.AtomGroup) – AtomGroup of reference selection (one leaflet) that defines the surface.

Returns:

centers – One (x, y, z) reference point per residue, shape (n_residues, 3).

Return type:

numpy.ndarray