pybilt.lipid_grid package¶
Submodules¶
pybilt.lipid_grid.lipid_grid module¶
Build lipid grids derived from COMFrame objects. Classes and functions to implement lipid COM gridding and analysis for lipid bilayers. This module defines version that build grids off of COMFrame objects and is meant primarily for internal use by the BilayerAnalyzer class. The gridding and anlaysis procedures are based on the descriptions given in Gapsys et al. J Comput Aided Mol Des (2013) 27:845858, which is itself a modified version of the GridMATMD method by Allen et al. Vol. 30, No. 12 Journal of Computational Chemistry. However, I have currently left out bits of the extra functionality like the handling of an embedded proteins.

class
pybilt.lipid_grid.lipid_grid.
LipidGrid2d
(com_frame, com_frame_indices, plane, nxbins=50, nybins=50)[source]¶ Bases:
object
A 2d lipid grid object.
This object is used by the LipidGrids object to construct a 2d grid for a bilayer leaflet and assign lipids to it using the coordinates derived from a COMFrame representation object.

frame
¶ Stores a local copy of the COMFrame object from which the the coordinate data and lipid type data is derived from.
 Type
COMFrame

x_nbins
¶ The number of grid bins in the ‘x’ dimension.
 Type
int

y_nbins
¶ The number of grid bins in the ‘y’ dimension.
 Type
int

x_min
¶ The lower boundary of the grid range in the ‘x’ dimension.
 Type
float

x_max
¶ The upper boundary of the grid range in the ‘x’ dimension.
 Type
float

x_incr
¶ The size of grid boxes (or spacing between grid points) in the ‘x’ dimension.
 Type
float

x_centers
¶ The center points of the grid boxes in the ‘x’ dimension.
 Type
np.array

x_edges
¶ The edges of the grid boxes in the ‘x’ dimension.
 Type
np.array

x_centers
The centers of the grid boxes in the ‘x’ dimension.
 Type
np.array

y_min
¶ The lower boundary of the grid range in the ‘y’ dimension.
 Type
float

y_max
¶ The upper boundary of the grid range in the ‘y’ dimension.
 Type
float

y_incr
¶ The size of grid boxes (or spacing between grid points) in the ‘y’ dimension.
 Type
float

y_centers
¶ The center points of the grid boxes in the ‘y’ dimension.
 Type
np.array

y_edges
¶ The edges of the grid boxes in the ‘y’ dimension.
 Type
np.array

y_centers
The centers of the grid boxes in the ‘y’ dimension.
 Type
np.array

lipid_grid
¶ A 2d array of size x_nbins*y_nbins that stores the index of lipids from the COMFrame that are assigned to each grid box.
 Type
np.array

lipid_grid_z
¶ A 2d array of size x_nbins*y_nbins that stores the z coordinate of the lipids assigned to each grid box.
 Type
np.array
Initialize the LipidGrid2d object.
 Parameters
com_frame (COMFrame) – The instance of COMFrame from which to pull the coordinates for lipids to use when building the grid.
com_frame_indices (list) – A list COMFrame lipid indices to include when building the grid.
plane (list) – The indices from the 3d coordinates for the coordinates that correspond to the bilayer lateral plane.
nxbins (Optional[int]) – The number of bins along the ‘x’ dimension, i.e. along the dimension corresponding to plane[0]. Defaults to 50.
nybins (Optional[int) – The number of bins along the ‘y’ dimension, i.e. along the dimension corresponding to plane[1]. Defaults to 50.

get_index_at
(ix, iy)[source]¶ Returns the COMFrame index of the lipid at the specified position in the lipid_grid.
 Parameters
ix (int) – The ‘x’ index in the lipid_grid.
iy () – The ‘y’ index in the lipid_grid.
 Returns
The index of the lipid.
 Return type
int

get_z_at
(ix, iy)[source]¶ Returns the z coordinate of the lipid at the specified position in the lipid_grid.
 Parameters
ix (int) – The ‘x’ index in the lipid_grid.
iy () – The ‘y’ index in the lipid_grid.
 Returns
The z coordinate of the lipid.
 Return type
float


class
pybilt.lipid_grid.lipid_grid.
LipidGrids
(com_frame, leaflets, plane, nxbins=50, nybins=50)[source]¶ Bases:
object

get_xyzc
(leaflet='both', zvalue_dict=None, color_dict=None, color_grid=None, color_type_dict=None)[source]¶

write_pdb
(pdb_name, leaflet='both', z_grid_upper=None, z_grid_lower=None, beta_grid_upper=None, beta_grid_lower=None, use_gaussian_filter=False, filter_sigma=10.0, filter_mode='nearest')[source]¶ Write out the lipid grid as an PDB coordinate file.
 Parameters
pdb_name (str) – File path and name for the output file.
leaflet (Optional[str]) – Specify which leaflets to write to the PDB file. The options are ‘both’, ‘upper’, or ‘lower’. Defaults to ‘both’.
z_grid_upper (Optional[np.array]) – A 2d grid of values corresponding to the elements of the upper leaflet of the lipid grid that are to be written as the zcoordinate in the PDB file for upper leaflet members. Defaults to None.
z_grid_lower (Optional[np.array]) – A 2d grid of values corresponding to the elements of the lower leaflet of the lipid grid that are to be written as the zcoordinate in the PDB file for lower leaflet members. Defaults to None.
beta_grid_upper (Optional[np.array]) – A 2d grid of values corresponding to the elements of the upper leaflet of the lipid grid that are to be written in the Beta column of the PDB file for upper leaflet members. Defaults to None.
beta_grid_lower (Optional[np.array]) – A 2d grid of values corresponding to the elements of the lower leaflet of the lipid grid that are to be written in the Beta column of the PDB file for upper leaflet members. Defaults to None.
use_gaussian_filter (Optional[bool]) – Use SciPy’s Gaussian filter to filter the zcoordinates before outputting the PDB file. Defaults to False. This option overrides inputs for z_grid_upper and z_grid_lower.
filter_sigma (Optional[bool]) – Set the sigma value for the Gaussian filter. Defaults to 10.0
filter_mode (Optional[‘str’]) – Set the mode for Gaussian filter. Defaults to ‘nearest’


pybilt.lipid_grid.lipid_grid.
grid_curvature
(x_vals, y_vals, zgrid)[source]¶ Compute the Mean and Gaussian curvature across a grid. :Parameters: * x_vals (np.array) – The bin labels along the xaxis of the gridded data.
y_vals (np.arrray) – The bin labels along the yaxis of the gridded data.
zgrid (np.array) – The 2d grid of bin values.
 Returns
 Returns a 2 item tuple with the 2d numpy arrays of the curvatures with
format (mean curvature, Gaussian curvature).
 Return type
tuple

pybilt.lipid_grid.lipid_grid.
grid_surface_area
(x_vals, y_vals, zgrid)[source]¶ Compute the surface area across a regular 2d grid. :Parameters: * x_vals (np.array) – The bin labels along the xaxis of the gridded data.
y_vals (np.arrray) – The bin labels along the yaxis of the gridded data.
zgrid (np.array) – The 2d grid of bin values.
 Returns
Returns a the surface area estimate.
 Return type
float
pybilt.lipid_grid.lipid_grid_curv module¶
clustering of lipid molecules” of Koldso H, Shorthouse D, He lie J, Sansom MSP (2014) Lipid Clustering Correlates with Membrane Curvature as Revealed by Molecular Simulations of Complex Lipid Bilayers. PLoS Comput Biol 10(10): e1003911. doi:10.1371/journal.pcbi.1003911 However, this implementation currently uses the z position (or normal position) of the lipids’ centers of mass, while their implementaion uses “the z coordinate of the interface between the head groups of the lipids (excluding the current species being calculated and tails in that box.”
pybilt.lipid_grid.lipid_grid_mda module¶
Classes and functions to implement lipid COM gridding and analysis for lipid bilayers. Acts on MemSys objects. The gridding and anlaysis procedures are based on the decriptions given in Gapsys et al. J Comput Aided Mol Des (2013) 27:845858, which is itself a modified version of the GridMATMD method by Allen et al. Vol. 30, No. 12 Journal of Computational Chemistry. However, I have currently left out several bits of the extra functionality, e.g. the handling of an embedded protein.

class
pybilt.lipid_grid.lipid_grid_mda.
LipidGrid_2d
(mda_frame, mda_universe, mda_frame_resids, plane, nxbins=50, nybins=50)[source]¶ Bases:
object