Source code
Contributors
Latest commits

Membrane Defect Mapping and Analysis (MemDMA)

  • Geometry-preserving membrane defect mapping for flat and curved membranes
  • Currently only suitable for Martini systems

Repository structure

│── main/                           # where main MemDMA code lives                    
│   ├──trajectory_prep/             # preparing the simulation files for mapping and analysis
│  
│── input/                          # where your add your trajectory files (.gro and .xtc) that will be analyzed               
│
│── tests/                          # Folder where all test cases and their outputs live 
│   ├──output/                      # output of all tests 
│      ├──defect_analysis/          # output of the defect_analysis code  
│      ├──defect_mapping/           # output of the defect_mapping code  
│   ├── .gro                        # .gro file for test cases of buckled and flat membranes 
│   ├── .xtc                        # .xtc file for test cases of buckled and flat membranes 
│
│── output/                         # General outputs from executions
│   ├──curvature_analysis/          # Curvature analysis outputs
│   ├──defect_mapping/              # Defect analysis outputs
│   ├──defect_analysis/  
│
│── toppar/                         # Martini3 topology files
│ 
│── README.md                       # Project documentation
│── .gitignore                      # Files ignored by Git

Requirements

  • All packages should be present in the pixi environment

Set-up

Set-up pixi

Install pixi:

curl -fsSL https://pixi.sh/install.sh | sh

Enter to pixi environment

pixi shell

Test cases

pixi r test-defect-mapping-flat 
pixi r test-defect-mapping-strain2
pixi r test-curvature 
pixi r test-radii-calculation 

Exit pixi environment

exit

Setup for your lipids of interest

Currently, this can only analyze membranes composed of the following lipids:

  • DOPC, DPPC, DOPA, DPPA, DOPS, DPPS

If your lipids are not in the list they must be added. To do so, complete the following for each unique bead type in the lipid. 1) Calculate the radii of each of the bead by completing the following.

  • In the pixi.toml file change the “lipid_name”, “atom_type”, “sigma_value”, and “polarity” for your choosen bead. The polarity value is n if the bead is polar and a if the bead is not polar.
  • The sigma value is determined between two of the same bead types. And can be found in the martini_v3.0.0.itp file.
      Q1    Q1  1 4.700000e-01    3.980000e+00
    

    2) Then run the following:

    pixi r radii-calculation 
    

    3) Copy the ouputted text which will represent the “RESNAME ATOMTYPE RADIUS_ANGSTROM ALIPHATIC” and place directly into the “vdw_radii_CGMartini3_openbeta2_updated.txt” file.

Formating .gro and .xtc files prior to analysis

If the your system contains lipids that are not in the list above you will have to add them. In the util.py file add your lipids to the string “lipids”. 1) Strip the membrane of ions and waters.

  • In the command, “strip-lipid-filename” in the pixi.toml file change each instance of your_filename with the name of your file of interest.
  • Then run the following:
       pixi r strip-lipid-filename
    

    2) After stripping the membrane, center the buckled membranes. This makes visualization and analysis of defects easier.

  • In the command, “center-membrane-filename” in the pixi.toml file change each instance of your_filename with the name of your file of interest.
  • Then run the following:
       pixi r center-membrane-filename
    

    The stripped_centered or strippedx files should be used for all further analysis.

Running your own analysis

Defect Mapping

This determines the defects present in the membrane throughout the simulation.

In the pixi.toml replace the “your_file_name” for the file name of your .gro and .xtc

defect-mapping-filename = "python main/packmem.py -i input/your_file_name.gro -t input/your_file_name.xtc -o output/defect_mapping/your_file_name"

Then execute the following in the terminal

pixi r defect-mapping-filename

Output 1) A .png file of the defect map for the last frame of the trajectory. 2) A .npy array of defects, centroids, vertices for the upper and lower leaflet 3) A .npy array of shape, Xshape, and Yshape

Defect Analysis

Takes the data from the defect mapping and creates visualizations for the lower and upper leaflet independently. You must choose which leaflet you are analyzing, and denote it with the -l flag.

1) A plot of height vs defect probability for all defect types (i.e shallow, deep, all) 2) A plot of defect size probability. 3) A plot of defect coverage across the simulation. 4) A plot of the defect map that represents the average defect coverage of the simulation. 5) .csv file for the average defect coverage and average defect size.

defect-analysis-filename = "python main/aggregate_map_defects_plt.py -i output/defect_mapping/your_file_name -o output/defect_analysis/your_file_name -l leaflet -s your_file_name"

Then execute the following in the terminal

pixi r defect-analysis-filename

Curvature analysis

This determines the curvature of the buckled membrane throughout the simulations by fitting a circle to the peak of the membrane.

In the pixi.toml replace the “your_file_name” for the file name of your .gro and .xtc

curvature-analysis-filename = "python curvature-analysis-filename = "main/curvature.py -gro input/your_file_name.gro -xtc input/your_file_name.xtc -s your_file_name -out output/curvature_analysis/your_file_name"

Then execute the following in the terminal

pixi r curvature-analysis-filename

Output 1) A .png file of the circle of best fit for each frame of the trajectory. 2) A .npy file that describes the radius, curvature of the perfect fit circle for each frame. 3) A .csv file that contains a summary of the curvature values.