MembraneCurvature’s API Documentation

The MembraneCurvature API is built around the MembraneCurvature class, which loads trajectory and coordinate data, and provides routines to derive a surface from atom positions. The resulting surface is then used to compute mean and Gaussian curvature, either for individual frames or averaged across multiple frames of an MD trajectory.

To use MembraneCurvature, users must provide at least two inputs: an MDAnalysis Universe, and an AtomGroup used as the reference to derive the surface and calculate curvature.

MembraneCurvature supports two different methods to derive surfaces from reference atoms:

The height coordinates from the selected AtomGroup are extracted, and then used to reconstruct the surface using the specified surface derivation method. Once the surface has been generated, mean and Gaussian curvature are calculated.

This page provides the API documentation for the MembraneCurvature class, the available surface derivation methods and their validators, and the curvature calculation functions.

For practical examples, refer to the Usage and Tutorials page.

MembraneCurvature class

The MembraneCurvature class provides the main entrypoint to calculate mean and Gaussian curvature from a surface derived from a reference atom selection. See the API docs for

Given a Universe and an AtomGroup, MembraneCurvature reconstructs a surface from the heights of the atoms in the selected AtomGroup of reference.

Note

The method selected by the user in the surface_method parameter defines:

  • The set of required parameters to run MembraneCurvature.

  • The specific operations to derive the surface.

See the API documentation in MembraneCurvature for more details.

Surface Methods

MembraneCurvature supports two different methods to derive a surface from the selected reference atoms:

fourier_surface fits a periodic 2D Fourier sum to atom heights by linear least squares at each frame, evaluates the fitted surface, and obtains partial derivatives analytically from that sum.

binning_surface assigns atoms to a regular grid, stores the mean height per cell, and estimates partial derivatives using the physical bin spacing with finite differences.

The binning 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. fft_filtering provides the functions to apply the filter and to resolve the pass-band limits.

Curvature

The functions in curvature include both analytical and numerical methods to estimate curvature from surface derivatives.

Note

The calculation of mean and Gaussian curvature differs between the two methods:

  • With fourier_surface, curvature is calculated analytically from the fitted surface.

  • With binning_surface, curvature is calculated numerically from the discrete height field using finite differences.

In both cases, the derivatives are then used to calculate mean and Gaussian curvature using the Monge-gauge formulas.

Validators

The fourier_validators are helper functions used to verify that input parameters provided by the user are valid and compatible with the MembraneCurvature class and the surface derivation methods. They are called automatically by the high-level entry points when MembraneCurvature runs with surface_method="fourier".

Warning

Validators are not considered a public API, should not be called directly, and are subject to change. API documentation is provided for reference only.