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
The code submitted for the Analytics Vidhya Jobathon - February 2022

Introduction On February 11th, 2022, Analytics Vidhya conducted a 3-day hackathon in data science. The top candidates had the chance to be selected by

11 Nov 21, 2022
PyDy, short for Python Dynamics, is a tool kit written in the Python

PyDy, short for Python Dynamics, is a tool kit written in the Python programming language that utilizes an array of scientific programs to enable the study of multibody dynamics. The goal is to have

PyDy 307 Jan 01, 2023
Program to send ROM files to Turbo Everdrive; reverse-engineered and designed to be platform-independent

PCE_TurboEverdrive_USB What is this "TurboEverdrive USB" thing ? For those who have a TurboEverdrive v2.x from krikzz.com, there was originally an opt

David Shadoff 10 Sep 18, 2022
validation for pre-commit.ci configuration

pre-commit-ci-config validation for pre-commit.ci configuration installation pip install pre-commit-ci-config api pre_commit_ci_config.SCHEMA a cfgv s

pre-commit.ci 17 Jul 11, 2022
Zeus is an open source flight intellingence tool which supports more than 13,000+ airlines and 250+ countries.

Zeus Zeus is an open source flight intellingence tool which supports more than 13,000+ airlines and 250+ countries. Any flight worldwide, at your fing

DeVickey 1 Oct 22, 2021
🛠️ Learn a technology X by doing a project - Search engine of project-based learning

Learn X by doing Y 🛠️ Learn a technology X by doing a project Y Website You can contribute by adding projects to the CSV file.

William 408 Dec 20, 2022
Your self-hosted bookmark archive. Free and open source.

Your self-hosted bookmark archive. Free and open source. Contents About LinkAce Support Setup Contribution About LinkAce LinkAce is a self-hosted arch

Kevin Woblick 1.7k Jan 03, 2023
Implementation of the MDMC method to search for magnetic ground state using VASP

Implementation of MDMC method ( by Olga Vekilova ) to search for magnetic ground state using VASP

Utkarsh Singh 1 Nov 27, 2021
With the initiation of the COVID vaccination drive across India for all individuals above the age of 18, I wrote a python script which alerts the user regarding open slots in the vicinity!

cowin_notifier With the initiation of the COVID vaccination drive across India for all individuals above the age of 18, I wrote a python script which

13 Aug 01, 2021
This tool for beginner and help those people they gather information about Email Header Analysis, Instagram Information, Instagram Username Check, Ip Information, Phone Number Information, Port Scan

This tool for beginner and help those people they gather information about Email Header Analysis, Instagram Information, Instagram Username Check, Ip Information, Phone Number Information, Port Scan.

cb-kali 5 Feb 18, 2022
A simple script that shows important photography times. written in python.

A simple script that shows important photography times. written in python.

John Evans 13 Oct 16, 2022
High-level bindings to the Valhalla framework.

Valhalla for Python This spin-off project simply offers improved Python bindings to the fantastic Valhalla project. Installation pip install valhalla

GIS • OPS 20 Dec 13, 2022
Translation patch for Hololive ERROR

Translation patch for Hololive ERROR How do I install the patch? Grab the Translation.zip file for the latest version from the releases page, and unzi

18 Jul 20, 2022
pvaPy provides Python bindings for EPICS pvAccess

PvaPy - PvAccess for Python The PvaPy package is a Python API for EPICS7. It supports both PVA and CA providers, all standard EPICS7 types (structures

EPICS Base 25 Dec 05, 2022
Cash in on Expressed Barcode Tags (EBTs) from NGS Sequencing Data with Python

Cash in on Expressed Barcode Tags (EBTs) from NGS Sequencing Data with Python Cashier is a tool developed by Russell Durrett for the analysis and extr

3 Sep 11, 2022
A Python3 script to decode an encoded VBScript file, often seen with a .vbe file extension

vbe-decoder.py Decode one or multiple encoded VBScript files, often seen with a .vbe file extension. Usage usage: vbe-decoder.py [-h] [-o output] file

John Hammond 147 Nov 15, 2022
Entitlement AND Hardened Runtime Check

Python3 script for macOS to recursively check /Applications and also check /usr/local/bin, /usr/bin, and /usr/sbin for binaries with problematic/interesting entitlements. Also checks for hardened run

Cedric Owens 79 Nov 16, 2022
A basic ticketing software.

Ticketer A basic ticketing software. Screenshots Program Launched Issuing Ticket Show your Ticket Entry Done Program Exited Code Features to implement

Samyak Jain 2 Feb 10, 2022
Block fingerprinting for the beacon chain, for client identification & client diversity metrics

blockprint This is a repository for discussion and development of tools for Ethereum block fingerprinting. The primary aim is to measure beacon chain

Sigma Prime 49 Dec 08, 2022
Got-book-6 - LSTM trained on the first five ASOIAF/GOT books

GOT Book 6 Generator Are you tired of waiting for the next GOT book to come out? I know that I am, which is why I decided to train a RNN on the first

Zack Thoutt 974 Oct 27, 2022