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 project to find out all the words in a crossword.

A project to find out all the words in a crossword.

Kalpesh Dhoundiyal 1 Feb 06, 2022
Python library for datamining glitch information from Gen 1 Pokémon GameBoy ROMs

g1utils This is a Python library for datamining information about various glitches (glitch Pokémon, glitch maps, etc.) from Gen 1 Pokémon ROMs. TODO A

1 Jan 13, 2022
Graveyard is an attempt at open-source reimplementation of DraciDoupe.cz

Graveyard: Place for Dead (and Undead) Graveyard is an attempt at open-source reimplementation of DraciDoupe.cz (referred to as DDCZ in this text). De

DraciDoupe.cz 5 Mar 17, 2022
Run Python code right in your Telegram messages

Run Python code right in your Telegram messages Made with Telethon library, TGPy is a tool for evaluating expressions and Telegram API scripts. Instal

29 Nov 22, 2022
A C-like hardware description language (HDL) adding high level synthesis(HLS)-like automatic pipelining as a language construct/compiler feature.

██████╗ ██╗██████╗ ███████╗██╗ ██╗███╗ ██╗███████╗ ██████╗ ██╔══██╗██║██╔══██╗██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝ ██████╔╝██║██████╔╝█

Julian Kemmerer 391 Jan 01, 2023
Artificial intelligence based on 5-dimensional quantum selection

Deep Thought An artificial intelligence based on 5-dimensional quantum selection. Algorithm The payload Make an random bit array (e.g. 1101...) Conver

Larry Holst 3 Dec 14, 2022
NGEBUG is a tool that sends viruses to victims

Ngebug NGEBUG adalah tools pengirim virus ke korban NGEBUG adalah tools virus terbaru yang berasal dari rusia Informasi lengkap ada didalam tools Run

Profesor Acc 3 Dec 13, 2021
Demo content - Automate your automation!

Automate-AAP2 Demo Content - Automate your automation! A fully automated Ansible Automation Platform. Context Installing and configuring Ansible Autom

0 Oct 27, 2022
The Python Achievements Framework!

Pychievements: The Python Achievements Framework! Pychievements is a framework for creating and tracking achievements within a Python application. It

Brian 114 Jul 21, 2022
a package that provides a marketstrategy for whitelisting on golem

filterms a package that provides a marketstrategy for whitelisting on golem watching requestor logs distribute 10 tasks asynchronously is fun. but you

KJM 3 Aug 03, 2022
Send notifications created in Frappe or ERPNext as push notication via Firebase Cloud Message(FCM)

FCM Notification for ERPNext Send notifications created in Frappe or ERPNext as push notication via Firebase Cloud Message(FCM) Steps to use the app:

Tridz 9 Nov 14, 2022
Make pack up python files easier.

python-easy-pack make pack up python files easier. 目前只提供了中文环境 如何使用? 将index.py复制到你的项目文件夹,或者把.py文件拷贝到这个文件夹。 打开你的cmd或者powershell 切换到程序所在目录,输入python index

2 Dec 15, 2021
Minecraft Multi-Server Pinger Discord Embed

Minecraft Network Pinger Minecraft Multi-Server Pinger Discord Embed What does this bot do? It sends an embed and uses mcsrvstat API and checks if the

YungHub 2 Jan 05, 2022
OB_Template is a vault template reference for using Obsidian.

Obsidian Template OB_Template is a vault template reference for using Obsidian. If you've tested out Obsidian. and worked through the "Obsidian Help"

323 Dec 27, 2022
Assignment for python course, BUPT 2021.

pyFuujinrokuDestiny Assignment for python course, BUPT 2021. Notice username and password must be ASCII encoding. If username exists in database, syst

Ellias Kiri Stuart 3 Jun 18, 2021
A python library what works with numbers.

pynum A python library what works with numbers. Prime Prime class have everithing you want about prime numbers. check_prime The check_prime method is

Mohammad Mahdi Paydar Puya 1 Jan 07, 2022
Addon to give a keybind to automatically enable contact shadows on all lights in a scene

3-2-1 Contact(Shadow) An easy way to let you enable contact shadows on all your lights, because Blender doesn't enable it by default, and doesn't give

TDV Alinsa 3 Feb 02, 2022
Konomi: Kind and Optimized Next brOadcast watching systeM Infrastructure

Konomi 備考・注意事項 現在 α 版で、まだ実験的なプロダクトです。通常利用には耐えないでしょうし、サポートもできません。 安定しているとは到底言いがたい品質ですが、それでも構わない方のみ導入してください。 使い方などの説明も用意できていないため、自力でトラブルに対処できるエンジニアの方以外に

tsukumi 243 Dec 30, 2022
Another Provably Rare Gem Miner 💎 (for Raritygems)

Provably Rare Gem Miner Go (for Rarity) Pull Request is strongly welcome as I don't know anything about Golang/Python/Web3. Usage Install Python 3.x i

朱里 6 Apr 22, 2022
Simple AoC helper program you can use to develop your own solutions in python.

AoC-Compabion Simple AoC helper program you can use to develop your own solutions in python. Simply install it in your python environment using pip fr

Alexander Vollmer 1 Dec 20, 2021