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
Strawberry Benchmark With Python

Strawberry benchmarks these benchmarks have been made to compare the performance of dataloaders and joined database queries. How to use You can run th

Doctor 4 Feb 23, 2022
carrier.py is a Python package/module that's used to save time when programming

carrier.py is a Python package/module that's used to save time when programming, it helps with functions such as 24 and 12 hour time, Discord webhooks, etc

Zacky2613 2 Mar 20, 2022
Simple cash register system made with guizero

Eje-Casher なにこれ guizeroで作った簡易レジシステムです。実際にコミケで使う予定です。 これを誰かがそのまま使うかどうかというよりは、guiz

Akira Ouchi 4 Nov 07, 2022
Expression interpreter written in Python

Calc Interpreter An interpreter modeled after a calculator implemented in Python 3. The program currently only supports basic mathematical expressions

1 Oct 17, 2021
A dead-simple service that notifies you when something goes down.

Totmannschalter Totmannschalter (German for dead man's switch) is a simple service that notifies you when it has not received any message from a servi

1 Dec 20, 2021
A little tool that uses LLVM to extract simple "what does this do" level instruction information from all architectures.

moirai: MOre InstRuctions and Information Backcronym. Anyway, this is a small project to extract useful instruction definitions from LLVM's platform d

2 Jul 30, 2022
A Python library that helps data scientists to infer causation rather than observing correlation.

A Python library that helps data scientists to infer causation rather than observing correlation.

QuantumBlack Labs 1.7k Jan 04, 2023
Small tool to use hero .json files created with Optolith for The Dark Eye/ Das Schwarze Auge 5 to perform talent probes.

DSA5-ProbeMaker A little tool for The Dark Eye 5th Edition (Das Schwarze Auge 5) to load .json from Optolith character generation and easily perform t

2 Jan 06, 2022
ThnoolBox - A thneed is a multi-use versatile object

ThnoolBox Have you ever wanted a collection of bodged desktop apps that are Lorax themed ? No ? Sucks to suck I guess Apps & their downsides CalculaTh

pocoyo 1 Jan 21, 2022
Course materials for a 3-day seminar "Machine Learning and NLP: Advances and Applications" at New College of Florida

Machine Learning and NLP: Advances and Applications This repository hosts the course materials used for a 3-day seminar "Machine Learning and NLP: Adv

Yoshi Suhara 11 Jun 22, 2022
Mata kuliah Bahasa Pemrograman

praktikum2 MENGHITUNG LUAS DAN KELILING LINGKARAN FLOWCHART : OUTPUT PROGRAM : PENJELASAN : Tetapkan nilai pada variabel sesuai inputan dari user :

2 Nov 09, 2021
Adds a Bake node to Blender's shader node system

Bake to Target This Blender Addon adds a new shader node type capable of reducing the texture-bake step to a single button press. Please note that thi

Thomas 8 Oct 04, 2022
a really simple bot that send you memes from reddit to whatsapp

a really simple bot that send you memes from reddit to whatsapp want to use use it? install the dependencies with pip3 install -r requirements.txt the

pai 10 Nov 28, 2021
An osu! cheat made in c++ rewritten in python and currently undetected.

megumi-python An osu! cheat made in c++ rewritten in python and currently undetected. Installation Guide Download python 3.9 from https://python.org C

Elaina 2 Nov 18, 2022
Bootstraparse is a personal project started with a specific goal in mind: creating static html pages for direct display from a markdown-like file

Bootstraparse is a personal project started with a specific goal in mind: creating static html pages for direct display from a markdown-like file

1 Jun 15, 2022
Object-data mapper and advanced query manager for non relational databases

Object data mapper and advanced query manager for non relational databases. The data is owned by different, configurable back-end databases and it is

Luca Sbardella 121 Aug 11, 2022
A web application (with multiple API project options) that uses MariaDB HTAP!

Bookings Bookings is a web application that, backed by the power of the MariaDB Connectors and the MariaDB X4 Platform, unleashes the power of smart t

MariaDB Corporation 4 Dec 28, 2022
Odoo modules related to website/webshop

Website Apps related to Odoo it's website/webshop features: webshop_public_prices: allow configuring to hide or show product prices and add to cart bu

Yenthe Van Ginneken 9 Nov 04, 2022
Superset custom path for python

It is a common requirement to have superset running under a base url, (https://mydomain.at/analytics/ instead of https://mydomain.at/). I created the

9 Dec 14, 2022
Plugin to manage site, circuit and device diagrams and documents in Netbox

Netbox Documents Plugin A plugin designed to faciliate the storage of site, circuit and device specific documents within NetBox Note: Netbox v3.2+ is

Jason Yates 38 Dec 24, 2022