Skip to main content

MDAnalysis tool to calculate membrane curvature from MD simulations.

Project description

Membrane Curvature

Powered by MDAnalysis GitHub Actions Status codecov docs PyPI

MembraneCurvature is an MDAnalysis tool to calculate membrane curvature from Molecular Dynamics simulations.

Interested in becoming a maintainer? We welcome your passion and expertise to help shape and grow this open-source project! Please contact for more details.


With MembraneCurvature you can:

  • Calculate mean and Gaussian curvature from MD simulations.
  • Derive 2D curvature profiles.
  • Live a happier life.


The main dependency in MembraneCurvature is MDAnalysis. You can find instructions to install the latest stable version of MDAnalysis via conda in the UserGuide.

MembraneCurvature is available via pip:

pip install membrane-curvature

To install from source:

git clone
cd membrane-curvature
conda env create -f devtools/conda-envs/environment.yaml
conda activate membrane-curvature
python install

Some of the examples included in the MembraneCurvature documentation use test cases from MDAnalysisTests. To install the unit tests via conda:

conda install -c conda-forge MDAnalysisTests

or via pip:

pip install --upgrade MDAnalysisTests

⚠️ In comparison to the previous version, membrane-curvature==0.0.3 shows a significant improvement in performance, particularly notable for membrane-protein systems. Installing the last available version is highly encouraged.


This is a quick example on how to run MembraneCurvature:

import MDAnalysis as mda
from membrane_curvature.base import MembraneCurvature
from MDAnalysis.tests.datafiles import Martini_membrane_gro

universe = mda.Universe(Martini_membrane_gro)

curvature_upper_leaflet = MembraneCurvature(universe,
                                            select='resid 1-225 and name PO4',

# extract mean curvature
mean_upper_leaflet = curvature_upper_leaflet.results.z_surface

# extract mean curvature
mean_upper_leaflet = curvature_upper_leaflet.results.mean

# extract Gaussian
gaussian_upper_leaflet = curvature_upper_leaflet.results.gaussian

In this example, we use the PO4 beads in the upper leaflet as reference to derive a surface and calculate its respective mean and Gaussian curvature.

You can find more examples on how to run MembraneCurvature in the Usage page. To plot results from MembraneCurvature please check the Visualization page.


To help you get the most out MembraneCurvature, we have documentation available where you can find:

  • The standard API documentation.
  • Quick examples of how to run Membrane Curvature in the Usage page.
  • Detailed explanation of the Algorithm implemented in MembraneCurvature.
  • Examples on how to plot the results obtained from MembraneCurvature in the Visualization page.


Source code included in this project is available in the GitHub repository under the GNU Public License v3 , version 3 (see LICENSE).

MembraneCurvature was developed as a Google Summer of Code 2021 project with MDAnalysis and it is linked to a Code of Conduct.

Copyright (c) 2021-2022, Estefania Barreto-Ojeda

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

membrane_curvature-1.1.1.tar.gz (4.2 MB view hashes)

Uploaded Source

Built Distribution

membrane_curvature-1.1.1-py3-none-any.whl (4.2 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page