MDAnalysis tool to calculate membrane curvature.

Overview

Membrane Curvature

Powered by NumFOCUS Powered by MDAnalysis GitHub Actions Status codecov docs

This is an MDAnalysis module to calculate membrane curvature from molecular dynamics simulations.

The MDAkit for membrane curvature analysis is part of the Google Summer of Code program and it is linked to a Code of Conduct.

Copyright (c) 2021, Estefania Barreto-Ojeda

Abstract

Elements of differential geometry enable us to quantify the curvature of a surface. The core elements of biological membranes, phospholipids, provide tridimensional configurations from which a surface can be derived to calculate curvature descriptors. We would like to integrate to MDAnalysis an analysis module to calculate average mean and Gaussian curvature from Molecular Dynamics simulations. By integrating a membrane curvature analysis module in MDAnalysis, users will benefit from a tool that enables rapid extraction of relevant properties of lipid bilayers in biomolecular systems. Our approach extracts key elements of the membrane using phospholipid head groups to define a surface, followed by a transformation into NumPy arrays. In this way, the functionality offered by NumPy and SciPy can be used to derive values of mean and gaussian curvature of biological membranes. Since MDAnalysis already works very well to explore data interactively, visualization of the membrane curvature analysis outputs in 2D-maps can be easily performed.

Disclaimer:

Code in this repository is under active developmentand is NOT guaranteed to be bug free. Use it at your own risk.

Comments
  • Added ipynb tutorial

    Added ipynb tutorial

    This PR fixes #63

    • [x] Added tutorial for membrane-only systems.

    I would appreciate some feedback for this tutorial while I finish the other two notebooks. @lilyminium @orbeckst @richardjgowers @IAlibay

    Thanks!
    Edit: I forgot to mention I couldn't manage to make the NGLwidget render, so I ended up adding the png files of the widgets. Hope that works as an alternative.

    opened by ojeda-e 20
  • Updated tutorial membrane-only system.

    Updated tutorial membrane-only system.

    After fixing #70 , the tutorial of the membrane-only system needed some updates. This version should close #74.

    Changes in this PR:

    • [x] Updated interpretation of mean curvature plots.
    • [x] Changed units in H and K plots (from nm to Å).
    • [x] Added ticks to color bars in curvature plots.

    I'm tagging @lilyminium and @orbeckst who usually review my PRs, but more reviewers are welcome. :) Thanks.

    opened by ojeda-e 18
  • AnalysisBase

    AnalysisBase

    This PR is an initial suggestion to fix #41

    • Methods included in the initial analysis base:

    • [x] __init__

    • [x] _prepare

    • [x] _single_frame

    • [x] _conclude

    • Some additional comments

    This first AnalysisBase was build under the following assumptions:

    1. The atoms of reference in AtomGroup remain the same during the n_frames of the trajectory.
    2. lipid translocation does not occur during the trajectory. (Although I am not considering bilayers, this reinforces 1)
    3. By introducing a grid of bigger size than the simulation box, the calculation of H and K may be jeopardized by the introduction of np.nans. This selection will certainly generate np.nans in the calculation of the gradient, which ultimately will affect the averaged grids. Hence, the attempt of warning the user (in __init__).
    4. The overall result is the averaged np.array of surface, K, and H over frames. (in _conclude)
    5. The calculation of surface, H, and K, is performed in every frame (in _single_frame).
    6. The respective values of surface, H and K and their normalized grids are initialized (in _prepare). They are a tuple of np.arrays where the first element contains the respective values, and the second element counts the elements when defined.
    7. To sum and normalize values, the _output function was introduced. (But I am not sure this is something people would agree with)

    As discussed in #21 with @lilyminium, this analysis base will potentially replace core.py.

    opened by ojeda-e 17
  • Add pbc conditions to in mapping coordinates to grid.

    Add pbc conditions to in mapping coordinates to grid.

    Periodic Boundary Conditions (PBC) are not applied when mapping coordinates to grid (grid_map).

    To fix this issue:

    • [ ] Add PBC conditions to map coordinates.
    • [ ] Add test using dummy coordinates to map values that exceed by defect or excess the boundaries of the grid.

    For example:

    • System with 9 beads with coordinates of x -1, 0, 1 and y -1, 0 ,1
    • System with 16 beads with coordinates of x -2, -1, 0, 1, and y -2, -1, 0 ,1, 2.
    testing refactoring 
    opened by ojeda-e 17
  • Add coordinate wrapping

    Add coordinate wrapping

    In this PR I added PBC conditions. Changes in this PR fix #36 and possibly #22

    • [x] self.ag.wrap() added to__init__ and _single_frame.
    • [x] Added tests for coordinate wrapping, including negative coordinates in x, y, and z, as suggested in #22
    • [x] Since PBC has an effect on the overall results, respective tests for results.z_surface and results.mean were updated.
    • [x] I am not sure mentors would be interested in keeping previous tests, so I didn't delete but marked them as xfail(reason="PBC conditions not applied.") (See line 276 is tests_membrane_curvature.py.

    @orbeckst @lilyminium @IAlibay are there any other relevant tests I am missing here? Thanks

    opened by ojeda-e 13
  • Added installation via pip

    Added installation via pip

    Changes here included fixes #66

    While I was here I changed other minor things

    • [x] Added pip in README.
    • [x] Fixed installation instructions for MDATests and added link.
    • [x] Fixed typos in Usage page in docs.
    opened by ojeda-e 8
  • MDA>=2.0.0 version added to `install_requires`

    MDA>=2.0.0 version added to `install_requires`

    This PR fixes #46

    • [x] In setup.py, three packages were added to install requires:

    • 'numpy>=1.20.2',

    • 'mdanalysis>=2.0.0',

    • 'mdanalysistests>=2.0.0'.

    • [x] For NumPy:

    • Check if installed.

    • Check Python>=3.6

    @IAlibay, would you please confirm no more changes are needed here at the moment?

    opened by ojeda-e 8
  • Updated docs pages

    Updated docs pages

    Changes in this PR fixes #58

    Changes include:

    • [x] Updated algorithm page.
    • [x] Update Usage page for three cases
    • Membrane-only
    • Membrane-protein with posres.
    • Membrane-protein with no posres.
    • [x] Updated visualization page.

    Pending:

    • [x] Add real data file to the test suite.
    • [x] Add real plots to the Visualization page.

    Question: I left the usage page as if I were going to use a different test data file for each case.

    • Is it a good idea to add a dataset for each one of the cases I have or better to reuse some MDA tests?

    Happy to receive any other suggestions. Thanks!

    @lilyminium @orbeckst @IAlibay @fiona-naughton

    opened by ojeda-e 6
  • Possible CI solution [PR #49 target]

    Possible CI solution [PR #49 target]

    Description

    As discussed here is my solution (assuming CI doesn't complain) to the CI issues in PR #49

    To do

    • [ ] Remove extra branch in PR (currently used to test)

    Status

    • [ ] Ready to go
    opened by IAlibay 6
  • Added `derive_surface` and `get_positions` with tests.

    Added `derive_surface` and `get_positions` with tests.

    Function core_fast_leaflets split into three functions:

    • [x] get positions for each atom in the atom group for each frame.
    • [x] identify the grid cell for each coordinate.
    • [x] calculate the average z for the atom group.

    Tests added:

    • [x] test_get_positions using dummy coordinates for beads 0 to 8, all of them with z=10:
    o ______ o _____ o _______ |
    |   (6)  |  (7)   |   (8)  |
    o ______ o _____ o _______ |
    |   (3)  |  (4)   |   (5)  |
    o _______o ______ o ______ |
    |   (0)  |  (1)   |   (2)  |
    o ______ o ______ o ______ |
    

    Using the same number of beads in grids,

    • [x] test_avg_unit_cell added for two systems.
    1. z values of z=10
    2. z values as below:
    o ______ o _____ o _______ |
    | (z=10) | (z=20) | (z=30) |
    o ______ o _____ o _______ |
    | (z=10) | (z=20) | (z=30) |
    o _______o ______ o ______ |
    | (z=10) | (z=20) | (z=30) |
    o ______ o ______ o ______ |
    
    1. z values of z=10 and number of beads per unit cell as shown below:
    o ____ o ____ o ___ |
    |   2  |  1   |  1  |
    o ____ o ____ o ___ |
    |   1  |  2   |  1  |
    o ____ o ____ o ___ |
    |   1  |  1   |  2  |
    o ____ o ____ o ___ |
    
    • [x] test_derive_surface added for same dummy_coordinates as in test_get_positions.
    opened by ojeda-e 6
  • Requested changes to initial refactor

    Requested changes to initial refactor

    This PR fixes #33.

    Changes included:

    • [x] pytest.mark.xfail test of negative coordinates in grid_map.
    • [x] 9- and 25-grid combined into one function with pytest.parametrize.
    • [x] Test_mapper changed by adding assertion of dummy coordinates.
    • [x] Test with grid_map using 6 unit cells in grid of 9 lipids as shown below:
    ^   o ___ o ___ o ___ o ___ o ___ o ___ |
    |   | (6) |     | (7) |     | (8) |     |
    |   o ___ o ___ o ___ o ___ o ___ o ___ |
    |   |     |     |     |     |     |     |
    |   o ___ o ___ o ___ o ___ o ___ o ___ |
    y   | (3) |     | (4) |     | (5) |     | 
    |   o ___ o ___ o ___ o ___ o ___ o ___ |
    |   |     |     |     |     |     |     |
    |   o ___ o ___ o ___ o ___ o ___ o ___ |
    |   | (0) |     | (1) |     | (2) |
    v   o ___ o ___ o ___ o ___ o ___ o ___ |
        0.   0.5    1.   1.5.   2.   2.5.   3.
        <----------------- x --------------->
    

    For grid with 9 lipid types: Bead 0 mapped to [ 0 0 ], with Coordinates ( 0 , 0 ) Bead 1 mapped to [ 2 0 ], with Coordinates ( 1 , 0 ) Bead 2 mapped to [ 4 0 ], with Coordinates ( 2 , 0 ) Bead 3 mapped to [ 0 2 ], with Coordinates ( 0 , 1 ) Bead 4 mapped to [ 2 2 ], with Coordinates ( 1 , 1 ) Bead 5 mapped to [ 2 2 ], with Coordinates ( 1 , 1 ) Bead 6 mapped to [ 0 4 ], with Coordinates ( 0 , 2 ) Bead 7 mapped to [ 2 4 ], with Coordinates ( 1 , 2 ) Bead 8 mapped to [ 4 4 ], with Coordinates ( 2 , 2 )

    and the equivalent to the grid of 25 lipids.

    This PR may also fix: #27 since function def_all_beads was deleted after replacing MDtraj by MDAnalysis. #28 since function core_fast was deleted after refactoring. #32 since function def_all_beads was deleted after refactoring and replaced by direct selection using MDAnalysis. and #16

    Questions: (possible minor change)

    • In line 172 and 177, I could simplify to factor = 1 and then in lines 174 and 179, respectively. assert grid_map(dummy_coord, 1) == dummy_coord assert grid_map(dummy_coord, 2) == (dummy_coord[0]*2, dummy_coord[1]*2)
    opened by ojeda-e 6
  • Conda release?

    Conda release?

    @ojeda-e with the amazing new release of membrane-curvature perhaps we can think about putting up a package on conda-forge?

    I would be happy to help you set it up, let me know. :)

    Release Task 
    opened by hmacdope 4
  • Modernize setup to comply with PEP518

    Modernize setup to comply with PEP518

    Although still functional, installation with setup.py is deprecated. According to PEP518:

    The build system dependencies will be stored in a file named pyproject.toml that is written in the TOML format [6].

    Additionally, there are two files that can be deleted in the root directory: .lgtm.yml and _config.yml

    To fix this issue:

    • [ ] Add pyproject.toml.
    • [ ] If necessary, modify setup.cfg.
    • [ ] Remove .lgtm.yml and _config.yml in root.
    Maintainability 
    opened by ojeda-e 0
  • Work towards MDAKit integration

    Work towards MDAKit integration

    Now that MDAKits are live to roll we should work towards registering membrane-curvature as an MDAKit!

    See the blog post for more info.

    AFAIK membrane-curvature already meets all the requirements listed in the white paper.

    opened by hmacdope 2
  • Added initial AVS benchmark

    Added initial AVS benchmark

    Description

    This PR fixes #84 by adding AVS benchmarks to the project.

    Changes

    • [x] Addedn config json file
    • [x] Added benchmarks/__init__.py
    • [x] Added membranecurvature.py benchmark file.

    Status

    • [ ] Ready to go
    Performance 
    opened by ojeda-e 1
  • Benchmark performance

    Benchmark performance

    Currently, there is no information about the performance of membrane curvature. It would be nice to have a page in the documentation that addresses this matter. Although the idea is not very well defined yet, some guidelines for an initial version of the benchmark are:

    • Performance over number of lipids in single-frame systems.
    • Performance over number of frames with a fixed number of lipids.
    • Keep the list of assumptions regardless of the approach.
    • Consider dummy Universes.
    • MDAnalysis uses ASV (Check code here)

    Thanks @hmacdope, @lilyminium and @richardjgowers for the suggestions.

    Performance 
    opened by ojeda-e 0
Releases(v1.0.0)
  • v1.0.0(Nov 3, 2022)

    Release 1.0.0 of MembraneCurvature

    In this new version, we comply with NEP29 by:

    • Raising the minimum NumPy version to 1.20.0.
    • Dropping support for Python 3.6 and 3.7

    In this release, we extended support to Python 3.10 and 3.11 and removed redundant warning messages when atoms fall out of boundaries (PR #95). Removing redundant messages significantly improves the performance of MembraneCurvature, particularly for membrane-protein systems.

    Minimum requirements: Python>=3.8 and MDAnalysis>=2.0.0.

    Source code(tar.gz)
    Source code(zip)
Owner
MDAnalysis
MDAnalysis is an object-oriented Python library to analyze molecular dynamics trajectories.
MDAnalysis
A tool to allow New World players to calculate the best place to put their Attribute Points for their build and level

New World Damage Simulator A tool designed to take a characters base stats including armor and weapons, level, and base damage of their items (slash d

Joseph P Langford 31 Nov 1, 2022
A tool to help calculate how to split conveyors in Satisfactory into specific ratios.

Satisfactory Splitter Calculator A tool to help calculate how to split conveyors in Satisfactory into specific ratios. Dependencies Python 3.9 PyYAML

RobotiCat 5 Dec 22, 2022
This program goes thru reddit, finds the most mentioned tickers and uses Vader SentimentIntensityAnalyzer to calculate the ticker compound value.

This program goes thru reddit, finds the most mentioned tickers and uses Vader SentimentIntensityAnalyzer to calculate the ticker compound value.

null 195 Dec 13, 2022
Calculate the efficient frontier

关于 代码主要参考Fábio Neves的文章,你可以在他的文章中找到一些细节性的解释

Wyman Lin 104 Nov 11, 2022
Custom component to calculate estimated power consumption of lights and other appliances

Custom component to calculate estimated power consumption of lights and other appliances. Provides easy configuration to get virtual power consumption sensors in Home Assistant for all your devices which don't have a build in power meter.

Bram Gerritsen 552 Dec 28, 2022
peace-performance (Rust) binding for python. To calculate star ratings and performance points for all osu! gamemodes

peace-performance-python Fast, To calculate star ratings and performance points for all osu! gamemodes peace-performance (Rust) binding for python bas

null 9 Sep 19, 2022
Tindicators is a Python library to calculate the values of various technical indicators

Tindicators is a Python library to calculate the values of various technical indicators

omar 3 Mar 3, 2022
Flames Calculater App used to calculate flames status between two names created using python's Flask web framework.

Flames Finder Web App Flames Calculater App used to calculate flames status between two names created using python's Flask web framework. First, App g

Siva Prakash 4 Jan 2, 2022
A program to calculate the are of a triangle. made with Python.

Area-Calculator What is Area-Calculator? Area-Calculator is a program to find out the area of a triangle easily. fully made with Python. Needed a pyth

Chandula Janith 0 Nov 27, 2021
Script to calculate the italian fiscal code of a person.

fiscal_code Hi! This is my first public repository, so please be kind if it is not well formatted or it contains errors. I started learning Python abo

FrancescoDiMuro 1 Nov 20, 2021
Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero.

Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with places after the decimal.

Shruti Dhave 2 Nov 29, 2021
Script to calculate delegator epoch returns for all pillars

znn_delegator_calculator Script to calculate estimated delegator epoch returns for all Pillars, so you can delegate to the best one. You can find me o

null 2 Dec 3, 2021
This program can calculate the Aerial Distance between two cities.

Aerial_Distance_Calculator This program can calculate the Aerial Distance between two cities. This repository include both Jupyter notebook and Python

InvisiblePro 1 Apr 8, 2022
BMI-Calculator: Program to Calculate Body Mass Index (BMI)

The Body Mass Index (BMI) or Quetelet index is a value derived from the mass (weight) and height of an individual, male or female.

PyLaboratory 0 Feb 7, 2022
A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme tool

Oppo/Realme Flash .OFP File on Bootloader A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme to

Italo Almeida 70 Jan 2, 2023
A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.

deep-translator Translation for humans A flexible FREE and UNLIMITED tool to translate between different languages in a simple way using multiple tran

Nidhal Baccouri 806 Jan 4, 2023
HPomb Is Socail Engineering Tool , Used For Bombing , Spoofing and Anonymity Available For Linux And Android(Termux)

HPomb v2020.02 Coming Soon Created By Secanonm HPomb Is Socail Engineering Tool , Used For Bombing , Spoofing and Anonymity Available For Linux And An

Secanonm 10 Jul 25, 2022
Tool to generate wrappers for Linux libraries allowing for dlopen()ing them without writing any boilerplate

Dynload wrapper This program will generate a wrapper to make it easy to dlopen() shared objects on Linux without writing a ton of boilerplate code. Th

Hein-Pieter van Braam 25 Oct 24, 2022
A Sophisticated And Beautiful Doxing Tool

Garuda V1.1 A Sophisticated And Beautiful Doxing Tool Works on Android[Termux] | Linux | Windows Don't Forget to give it a star ❗ How to use ❓ First o

The Cryptonian 67 Jan 10, 2022