Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2core.py 

3MDAkit for Membrane Curvature 

4 

5Handles the primary functions 

6""" 

7 

8from membrane_curvature.surface import normalized_grid, derive_surface, get_z_surface 

9from membrane_curvature.curvature import mean_curvature, gaussian_curvature 

10import time 

11import MDAnalysis as mda 

12import math 

13from pathlib import Path 

14__author__ = "Estefania Barreto-Ojeda" 

15version = 0.1 

16 

17 

18def main(): 

19 

20 

21 

22 # 1. Populate universe with coordinates and trajectory 

23 u = mda.Universe(topology, trajectory) 

24 

25 # 2 Set grid: Extract box dimension from MD sim, 

26 # set grid max width, set number of unit cells 

27 box_size = u.dimensions[0] 

28 max_width = box_size * 0.1 

29 n_cells = math.ceil(max_width / unit_width * 10) 

30 

31 # 3. Assign lipids in upper and lower leaflet 

32 selection = u.select_atoms(atoms_upper, atoms_lower) 

33 

34 # 4. Save pickles zpo4 

35 z_Ref = np.zeros([n_cells, n_cells]) 

36 z_coords = derive_surface(n_cells, selection, max_width) 

37 

38 # 5. Calculate curvature 

39 K = gaussian_curvature(z_coords) 

40 H = mean_curvature(z_coords) 

41 

42 return 

43 

44 

45if __name__ == '__main__': 

46 main()