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 100% python file organizer. Keep your computer always organized!

PythonOrganizer A 100% python file organizer. Keep your computer always organized! To run the project, just clone the folder and run the installation

3 Dec 02, 2022
sfgp is a package that aggregates individual scripts and notebooks, primarily written for the basic analysis tasks of genetics and pharmacogenomics data.

sfgp is a package that aggregates individual scripts and notebooks, primarily written for the basic analysis tasks of genetics and pharmacogenomics data.

Vishal Sarsani 1 Mar 31, 2022
Convert ldapdomaindump to Bloodhound

ldd2bh Usage usage: ldd2bh.py [-h] [-i INPUT_FOLDER] [-o OUTPUT_FOLDER] [-a] [-u] [-c] [-g] [-d] Convert ldapdomaindump to Bloodhoun

64 Oct 30, 2022
ERPNext Easy Letterhead

ERPNext Easy Letterhead Intro Quality letterheads are a problem for non-technical users. So we've built (really hacked together) a slightly easier sol

Bantoo 3 Jan 02, 2023
Tools for collecting social media data around focal events

Social Media Focal Events The focalevents codebase provides tools for organizing data collected around focal events on social media. It is often diffi

Ryan Gallagher 80 Nov 28, 2022
Python module used to generate random facts

Randfacts is a python library that generates random facts. You can use randfacts.get_fact() to return a random fun fact. Disclaimer: Facts are not gua

Tabulate 14 Dec 14, 2022
ColabFold / AlphaFold2_advanced on your local PC (or macOS)

LocalColabFold ColabFold / AlphaFold2_advanced on your local PC (or macOS) Installation For Linux Make sure curl and wget commands are already install

Yoshitaka Moriwaki 207 Dec 22, 2022
Meower a social media platform written in Scratch 3.0 and Python

Meower Meower is a social media platform written in Scratch 3.0 and Python, ported to HTML for self-hosting. Try Beta 4.6 Changelog for 4.6 Start impl

Meower Media Co. 23 Dec 02, 2022
A simple watcher for the XTZ/kUSD pool on Quipuswap

Kolibri Quipuswap Watcher This repo holds the source code for the QuipuBot bot deployed to the #quipuswap-updates channel in the Kolibri Discord Setup

Hover Labs 1 Nov 18, 2021
Structured, dependable legos for Starknet development.

cairomate • Structured, dependable legos for starknet development. Directory Structure contracts ├─ defi │ ├─ ChainlinkPriceOracle — "Simple price or

andreas 127 Nov 23, 2022
Python script for the radio in the Junior float.

hoco radio 2021 Python script for the radio in the Junior float. Populate the ./music directory with 2 or more .wav files and run radio2.py. On the Ra

Kevin Yu 2 Jan 18, 2022
0xFalcon - 0xFalcon Tool For Python

0xFalcone Installation Install 0xFalcone Tool: apt install git git clone https:/

Alharb7 6 Sep 24, 2022
A topology optimization framework written in Taichi programming language, which is embedded in Python.

Taichi TopOpt (Under Active Development) Intro A topology optimization framework written in Taichi programming language, which is embedded in Python.

Li Zhehao 41 Nov 17, 2022
laTEX is awesome but we are lazy -> groff with markdown syntax and inline code execution

pyGroff A wrapper for groff using python to have a nicer syntax for groff documents DOCUMENTATION Very similar to markdown. So if you know what that i

Subhaditya Mukherjee 27 Jul 23, 2022
Web3 Solidity Connector

With this project, you can compile your sol files and create new transactions including creating contract and calling the state changer functions. You can integrate integrate your sol files with Pyth

Fethi Tekyaygil 3 Oct 09, 2022
Todos os exercícios do Curso de Python, do canal Curso em Vídeo, resolvidos em Python, Javascript, Java, C++, C# e mais...

Exercícios - CeV Oferecido por Linguagens utilizadas atualmente O que vai encontrar aqui? 👀 Esse repositório é dedicado a armazenar todos os enunciad

Coding in Community 43 Nov 10, 2022
token vesting escrow with cliff and clawback

Yearn Vesting Escrow A modified version of Curve Vesting Escrow contracts with added functionality: An escrow can have a start_date in the past.

62 Dec 08, 2022
Repository for my Monika Assistant project

Monika_Assistant Repository for my Monika Assistant project Major changes: Added face tracker Added manual daily log to see how long it takes me to fi

3 Jan 10, 2022
Comprehensive Python Cheatsheet

Comprehensive Python Cheatsheet

Jure Šorn 31.3k Dec 30, 2022
A dashboard for your code. A build system.

NOTICE: THIS REPO IS NO LONGER UPDATED Changes Changes is a build coordinator and reporting solution written in Python. The project is primarily built

Dropbox 763 Sep 09, 2022