pybilt.bilayer_analyzer package¶
Submodules¶
pybilt.bilayer_analyzer.analysis_protocols module¶
Analysis Protocols
This is a support module that defines a set of classes used to contruct the ‘analysis protocol’ and the ‘analysis’ used in the anlysis implemented by the pybilt.bilayer_analyzer.bilayer_anlayzer.BilayerAnalyzer class. The AnalysisProtocol is the class used to organize and initial the the individual analysis functions/protocols. The individual analysis functions/protocols are derived classes of AnalysisProtocol, and the availabel analysis can be extended by simply defining a new protocol. .. rubric:: Example
# define a new analysis ‘my_analysis’ # add it to the valid_analysis list valid_analysis.append(‘my_analysis’) #add it to analysis_obj_name_dict dictionary with the buildable object (e.g. mda_frame) needed for the analysis. #The buildables are built by the bilayer analyzer and can accessed from it for the analysisanalysis. analysis_obj_name_dict[‘my_analysis’] = ‘mda_frame’ class MyAnalysisProtocol(AnalysisFunctionProtocol):
#minimal def the __init__ and run_analysisfuncions def __init__(self, args):
#define the initialization#The run_analysis function should always take three inputs # of data that is passed in from the BilayerAnalayzer instance # that owns this instance of an analysis protocol. The values are: # ba_settings = BilayerAnalyzer.settings –> The adjustable # settings dictionary which contains data like ‘lateral’, and # ‘norm’. # ba_reps = BilayerAnalyzer.reps –> The dictionary container of # frame representations. e.g. ‘com_frame’ and ‘lipid_grid’ # ba_mda_data = BilayerAnalyzer.mda_data –> An MDAData instance # that contains data like the MDAnalysis universe, trajectory, # bilayer_selection, etc. def run_analysis(self, ba_settings, ba_reps, ba_mda_data):
#…………. #doing my analysis #……………. return#redefine any other functions from AnalysisProtocol or add new ones.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
ALDProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the average lateral displacement of lipids.
This protocol is identified by the analysis key: ‘ald’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, includes all lipid types.
References
- Kenichiro Koshiyama, Tetsuya Kodama, Takeru Yano, Shigeo
- Fujikawa, “Molecular dynamics simulation of structural changes of lipid bilayers induced by shock waves: Effects of incident angles”, Biochimica et Biophysica Acta (BBA) - Biomembranes, Volume 1778, Issue 6, June 2008, Pages 1423-1428
Initialize an instance of ALDProtocol.
-
analysis_key
= 'ald'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
APLBoxProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the area per lipid using the lateral area.
This analysis is used to estimate the area per lipid (APL) using the lateral box dimensions,
A_l = 2<A_xy>/N_l ,where A_xy is area of the lateral box dimensions (used to approximate the surface area of the bilayer) and N_l is the number of lipids in the bilayer. As a molar quantity this approach is only accurate for homogenous lipid bilayers. If the bilayer is inhomogenous then this estimate represents a composite average of the area per lipid.
This protocol is identified by the analysis key: ‘apl_box’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- None
References
- Preston B. Moore, Carlos F. Lopez, Michael L. Klein, Dynamical Properties of a Hydrated Lipid Bilayer
- from a Multinanosecond Molecular Dynamics Simulation, Biophysical Journal, Volume 81, Issue 5, 2001, Pages 2484-2494, ISSN 0006-3495, http://dx.doi.org/10.1016/S0006-3495(01)75894-8. (http://www.sciencedirect.com/science/article/pii/S0006349501758948)
Initialize an instance of APLBoxProtocol.
-
analysis_key
= 'apl_box'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
APLGridProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the indvidual area per lipid for each lipid type using a gridding procedure.
This protocol is identified by the analysis key: ‘apl_grid’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- None
References
- Allen et al. Vol. 30, No. 12 Journal of Computational Chemistry
- Gapsys et al. J Comput Aided Mol Des (2013) 27:845-858
Initialize an instance of APLGridProtocol.
-
analysis_key
= 'apl_grid'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
Analyses
(analysis_commands)[source]¶ Bases:
future.types.newobject.newobject
A class to facilitate analysis of the bilayers via the BilayerAnalyzer
This object stores all the analyses that are being performed by the BilayerAnalyzer class, and it provides functionality to add and remove analyses.
-
use_objects
¶ A dictionary of buildable objects that need to be contructed in the BilayerAnalyzer for the analysis defined in this protocol.
Type: dict
-
in_commands
¶ A list of the input strings for the analysis to be used.
Type: list
-
arguments
¶ A list of the arguments for analysis.
Type: list
-
analysis_keys
¶ A list of the keys assigned to analysis.
Type: list
-
command_protocol
¶ A dictionary of the analysis objects.
Type: dict
-
analysis_ids
¶ A list of the ids assigned to analysis.
Type: list
-
n_commands
¶ The number of initialized analysis.
Type: int
Inits Analyses with input analysis_commands
Parameters: analysis_commands (list) – A list of the input strings for the analyses to be used. This is internally parsed together by the calling BilayerAnalyzer class object. -
add_analysis
(inputs)[source]¶ Used to add a new analysis to the internal set of analyses
Parameters: inputs (str, list, tuple, or dict) – The input to parsed for the type of analysis and its settings to be added to set of analyses.
-
dump_data
(path=None)[source]¶ Calls the individual save_data functions of each AnalysisProtocol.
Parameters: path (str, Optional) – The string path where output files should be dumped to disc.
-
-
class
pybilt.bilayer_analyzer.analysis_protocols.
AnalysisProtocol
(args)[source]¶ Bases:
future.types.newobject.newobject
Base class for analysis protocols.
-
analysis_key
¶ The key name of this analysis.
Type: str
-
analysis_id
¶ The unique id assigned to this analyisis.
Type: str
-
save_file_name
¶ The path and filename for the pickle file output of this analysis’ results.
Type: str
-
settings
¶ A dict of the internal settings of the analysis.
Type: dict
-
analysis_output
¶ Used to store the ouptut of this analysis during the frame loop.
Type: list or list like
Inits the AnalysisProtocol using the input args.
Parameters: args (list) – list of argument keys and values. -
analysis_key
= 'none'
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
-
class
pybilt.bilayer_analyzer.analysis_protocols.
AreaCompressibilityModulusProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the isothermal area compressibility modulus.
- This protocol is used to estimate the area compressibility modulus,
- K_A = (kT) / var(A),
where A is the area in the lateal dimension of the bilayer.
This protocol is identified by the analysis key: ‘acm’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- temperature (float): The absolute temperature that the simulation
- was run at (i.e. in Kelvin). Default: 298.15 K
References
- Christofer Hofsab, Erik Lindahl, and Olle Edholm, “Molecular
Dynamics Simulations of Phospholipid Bilayers with Cholesterol”, Biophys J. 2003 Apr; 84(4): 2192-2206. doi: 10.1016/S0006-3495(03)75025-5
- Janosi and A. A. Gorfe, J. Chem. Theory Comput. 2010, 6,
3267-3273
- Aguayo, F. D. Gonzalez-Nilo, and C. Chipot, J. Chem. Theory
Comput. 2012, 8, 1765-1773
Initialize an instance of AreaCompressibilityModulusProtocol.
-
analysis_key
= 'acm'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
AreaCompressibilityProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the isothermal area compressibility.
- This protocol is used to estimate the area compressibility modulus,
- K_A^-1 = [(kT) / var(A)]^-1 ,
where A is the area in the lateal dimension of the bilayer.
This protocol is identified by the analysis key: ‘ac’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- temperature (float): The absolute temperature that the simulation
- was run at (i.e. in Kelvin). Default: 298.15 K
Note
Area compressibility is the inverse of area compressibility modulus (see Ref.1).
References
- Yoshimichi Andoha, Susumu Okazakia, Ryuichi Ueokab, “Molecular
- dynamics study of lipid bilayers modeling the plasma membranes of normal murine thymocytes and leukemic GRSL cells”, Biochimica et Biophysica Acta (BBA) - Biomembranes, Volume 1828, Issue 4, April 2013, Pages 1259-1270. https://doi.org/10.1016/j.bbamem.2013.01.005
Initialize an instance of AreaCompressibilityProtocol.
-
analysis_key
= 'ac'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
AreaFluctuationProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the area fluctuation in the box along the bilayer laterals.
This protocol is identified by the analysis key: ‘area_fluctuation’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- None
References
None
Initialize an instance of AreaFluctuationProtocol.
-
analysis_key
= 'area_fluctuation'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
BTGridProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the bilayer thickness using a gridding procedure.
This analysis uses a lipid grid representation (lipid positions are mapped to 2-D grids, one grid per leaflet) of the bilayer to estimate the bilayer thickness. This is done by measuring the difference in ‘z’ position between corresponding grid points of opposing bilayer leaflets.
This protocol is identified by the analysis key: ‘bilayer_thickness’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- None
Note
The P-P distance can be estimated for phospholipid by assigning positions of the phosphorous atoms to the lipid grid.
References
- Allen et al. Vol. 30, No. 12 Journal of Computational Chemistry
- Gapsys et al. J Comput Aided Mol Des (2013) 27:845-858
Initialize an instance of BTGridProtocol.
-
analysis_key
= 'bilayer_thickness'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
COMLateralRDFProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the 2-d radial pair distribution function in the bilayer lateral plane using the lipid centers of mass.
This analysis protocol uses the ‘com_frame’ representation.
This protocol is identified by the analysis key: ‘com_lateral_rdf’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname_1 (str): Specify the resname of the reference lipid type to
- include in this analysis. Default: ‘first’, the first lipid in the list pulled from the com_frame representation.
- resname_2 (str): Specify the resname of the target lipid type to
- include in this analysis. Default: ‘first’, the first lipid in the list pulled from the com_frame representation.
- n_bins (int): Specifies the number of bins to use when estimating
- the RDF. Default: 25
- range_inner (float): Specify the inner distance cutoff for the RDF.
- Default: 0.0
- range_outer (float): Specify the outer distance cutoff for the RDF.
- Default: 25.0
References
- Microsecond Molecular Dynamics Simulations of Lipid Mixing
- Chunkit Hong, D. Peter Tieleman, and Yi Wang Langmuir 2014 30 (40), 11993-12001 DOI: 10.1021/la502363b http://pubs.acs.org/doi/abs/10.1021/la502363b
Initialize an instance of COMLateralRDFProtocol.
-
analysis_key
= 'com_lateral_rdf'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
DCClusterProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Compute lipid clusters using a hiearchical distance based method.
This analysis uses a type of hiearchical clustering where points (lipid centers of mass) are are added to a cluster if they are within a specified distance of any other point within the cluster.
This protocol is identified by the analysis key: ‘dc_cluster’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, includes all lipid types.
- cutoff (float): The cutoff distance to use for the clustering.
- Default: 12.0
Note
Only finds the self clusters for a single lipid type as specified by the
`resname`
setting.References
None
Initialize an instance of DCClusterProtocol.
-
analysis_key
= 'dc_cluster'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
DispVecCorrelationAverageProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Compute the pair-wise cross correlation between pairs of the displacement vectors for each lipid in the specified leaflet(s) of bilayer and do a inverse-distance weighted averaging.
This analysis computes the displacement vectors as in DispVecProtocol, but then continues to compute the pair-wise cross correlations between each vector (i.e. the cos(theta) for the angle theta between the vectors) and averages the values using the inverse of the distance between the vector starting points as a weight.
This protocol is identified by the analysis key: ‘disp_vec_corr_avg’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, includes all lipid types.
- wrapped (bool): Specify whether to use the wrapped (‘True’) or
- un-wrapped (‘False’) coordintes for the base of the vectors. Default: False
- interval (int): Sets the frame interval over which to compute the
- displacement vectors.
References
None
Initialize an instance of DispVecCorrelationAverageProtocol.
-
analysis_key
= 'disp_vec_corr_avg'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
DispVecCorrelationProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Comute the pair-wise cross correlation matrix for the displacement vectors for each lipid in the specified leaflet(s) of bilayer.
This analysis computes the displacement vectors as in ‘disp_vec’ analysis (DispVecProtocol), but then continues to compute the pair-wise cross correlation matrix between each vector. i.e. the cos(theta) for the angle theta between the vectors.
This protocol is identified by the analysis key: ‘disp_vec_corr’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, includes all lipid types.
- wrapped (bool): Specify whether to use the wrapped (‘True’) or
- un-wrapped (‘False’) coordintes for the base of the vectors. Default: False
- interval (int): Sets the frame interval over which to compute the
- displacement vectors. f
References
None
Initialize an instance of DispVecCorrelationProtocol.
-
analysis_key
= 'disp_vec_corr'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
DispVecNNCorrelationProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Comute the pair-wise cross correlations for the displacement vectors for each lipid in the specified leaflet(s) of bilayer and its nearest neighbor.
This analysis computes the displacement vectors as in the ‘disp_vec’ analysis (DispVecProtocol), but then continues to compute the pair-wise cross correlation between each vector and its nearest neighbor. i.e. the cos(theta) for the angle theta between the vectors.
This protocol is identified by the analysis key: ‘disp_vec_nncorr’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, includes all lipid types.
- wrapped (bool): Specify whether to use the wrapped (‘True’) or
- un-wrapped (‘False’) coordintes for the base of the vectors. Default: False
- interval (int): Sets the frame interval over which to compute the
- displacement vectors. f
References
None
Initialize an instance of DispVecNNCorrelationProtocol.
-
analysis_key
= 'disp_vec_nncorr'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
DispVecProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Comute displacement vectors for each lipid in the specified leaflet(s) of bilayer.
This protocol is identified by the analysis key: ‘disp_vec’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, includes all lipid types.
- wrapped (bool): Specify whether to use the wrapped (‘True’) or
- un-wrapped (‘False’) coordintes for the base of the vectors. Default: False
- interval (int): Sets the frame interval over which to compute the
- displacement vectors.
- scale (bool): Specify whether to scale the coordinates by the box
- dimensions of the reference frame. Default: False
- scale_to_max (bool): Specify whether to scale the coordinates by the
- box dimensions of the maximum box size in the anlysis. Default: False.
Note
The real frame
`interval`
setting needs to be a multiple of the frame looping interval set within the BilayerAnalyzer instance (i.e., analyzer.frame_range[2]) for this analysis to work properly.References
- Emma Falck, Tomasz Rog, Mikko Karttunen, and Ilpo Vattulainen,
- Lateral Diffusion in Lipid Membranes through Collective Flows, Journal of the American Chemical Society, 2008 130 (1), 44-45 DOI: 10.1021/ja7103558
Initialize an instance of DispVecProtocol.
-
analysis_key
= 'disp_vec'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
FlipFlopProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Count any lipid flips flops between the leaflets.
This protocol is identified by the analysis key: ‘flip_flop’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- None
References
- Andrey A. Gurtovenko, and Ilpo Vattulainen, Molecular Mechanism
- for Lipid Flip-Flops, The Journal of Physical Chemistry B, 2007 111 (48), 13554-13559, DOI: 10.1021/jp077094k http://pubs.acs.org/doi/abs/10.1021/jp077094k?journalCode=jpcbfk
- Nicolas Sapay, W. F. Drew Bennett, and D. Peter Tieleman,
- Molecular Simulations of Lipid Flip-Flop in the Presence of Model Transmembrane Helices, Biochemistry, 2010 49 (35), 7665-7673, DOI: 10.1021/bi100878q http://pubs.acs.org/doi/abs/10.1021/bi100878q
Initialize an instance of FlipFlopProtocol.
-
analysis_key
= 'flip_flop'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
HalperinNelsonProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the mean hexagonal packing orientation parameter.
This analysis implements Halperin and Nelson’s rotational invariant to estimate the hexagonal packing orientation parameter. The value for lipid l is given by
phi_l = | (1/6) * sum_{j element nn(l)} exp(6i*theta_{lj}) |^2 ,where i is complex and nn(l) are the 6 nearest neighbors of lipid l; theta_{lj} is the angle between the vector formed by beads representing lipid l and j and an arbitrary axis. The value is unity for perfect hexagonal packing, and it is zero to the extent that hexagonal packing is entirely absent. This protocol uses the ‘com_frame’ representation of the bilayer.
This protocol is identified by the analysis key: ‘halperin_nelson’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘upper’
References
- Shachi Katira, Kranthi K. Mandadapu, Suriyanarayanan
- Vaikuntanathan, Berend Smit, and David Chandler, The order-disorder transition in model lipid bilayers is a first-order hexatic to liquid phase transition, arXiv preprint [cond-mat.soft] 2015, arXiv:1506.04310. https://arxiv.org/pdf/1506.04310.pdf
Initialize an instance of HalperinNelsonProtocol.
-
analysis_key
= 'halperin_nelson'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
LateralOrientationAngleProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the angle for lipid orientation vectors relative to the bilayer normal.
This analysis is based on the P-N vector-normal angle analysis discussed in Ref. 1. Using two reference atoms from the specified lipid type a vector for each lipid is computed and the orientation relative to the bilayer normal is computed, i.e. theta, or the angle between the two vectors.
This protocol is identified by the analysis key: ‘loa’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘first’, the first lipid type as stored in the com_frame.
- ref_atom_1 (str): The atom name of the reference atom to use as the
- base of the lipid orientation vector.
- ref_atom_2 (str): The atom name of the reference atom to use as the
- head of the lipid orientation vector.
Note
The lipid orientation vector is defined as
`ref_atom_1`
->```ref_atom_2```. This analysis is only performed for one lipid type, so a new intance of this analysis must be added to the BilayerAnalyzer for each lipid type that is to be analyzed.References
- Zheng Li, Richard M. Venable, Laura A. Rogers, Diana Murray,
and Richard W. Pastor, “Molecular Dynamics Simulations of PIP2 and PIP3 in Lipid Bilayers: Determination of Ring Orientation, and the Effects of Surface Roughness on a Poisson-Boltzmann Description”, Biophys J. 2009 Jul 8; 97(1): 155-163. doi: 10.1016/j.bpj.2009.04.037Initialize an instance of LateralOrientationAngleProtocol.
-
analysis_key
= 'loa'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
LateralOrientationParameterProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the order parameter for lipid orientation vectors relative to the bilayer normal.
This analysis is based on the P-N vector-normal angle analysis discussed in Ref. 1. Using two reference atoms from the specified lipid type a vector for each lipid is computed and the orientation relative to the bilayer normal is computed, i.e. cos(theta), for the angle between the two vectors.
This protocol is identified by the analysis key: ‘lop’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘first’, the first lipid type as stored in the com_frame.
- ref_atom_1 (str): The atom name of the reference atom to use as the
- base of the lipid orientation vector.
- ref_atom_2 (str): The atom name of the reference atom to use as the
- head of the lipid orientation vector.
Note
The lipid orientation vector is defined as
`ref_atom_1`
->```ref_atom_2```. This analysis is only performed for one lipid type, so a new intance of this analysis must be added to the BilayerAnalyzer for each lipid type that is to be analyzed.References
- Zheng Li, Richard M. Venable, Laura A. Rogers, Diana Murray,
and Richard W. Pastor, “Molecular Dynamics Simulations of PIP2 and PIP3 in Lipid Bilayers: Determination of Ring Orientation, and the Effects of Surface Roughness on a Poisson-Boltzmann Description”, Biophys J. 2009 Jul 8; 97(1): 155-163. doi: 10.1016/j.bpj.2009.04.037Initialize an instance of LateralOrientationParameterProtocol.
-
analysis_key
= 'lop'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
LipidCollinearityProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the lipid-lipid collinearity angles.
This analysis computes the mean lipid-lipid collinearity angle (or order parameter) using the vector represetation of the specified lipids.
This protocol is identified by the analysis key: ‘lipid_collinearity’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘upper’
- resname_1 (str): Specify the resname of the reference lipid type to
- include in this analysis. Default: ‘first’, the first lipid in the list pulled from the com_frame representation.
- resname_2 (str): Specify the resname of the target lipid type to
- include in this analysis. Default: ‘first’, the first lipid in the list pulled from the com_frame representation.
- style (str: ‘angle’, ‘order’): Specify whether to compute the
- tilt angle (‘angle’) or the tilt angle order parameter (‘order’). Default: ‘angle’
References
- Anton O. Chugunov, Pavel E. Volynsky, Nikolay A. Krylov,
- Ivan A. Boldyrev, and Roman G. Efremov, Liquid but Durable: Molecular Dynamics Simulations Explain the Unique Properties of Archaeal-Like Membranes, Scientific Reports, 4:7462, 2014, doi:10.1038/srep07462 (https://www.nature.com/articles/srep07462)
Initialize an instance of LipidCollinearityProtocol.
-
analysis_key
= 'lipid_collinearity'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
LipidLengthProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the lipids length using the defined lipid vector.
This analysis is used to compute the mean lipid length using the vector represetation of the specified lipids.
This protocol is identified by the analysis key: ‘lipid_length’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, averages over all lipid types.
References
- Anton O. Chugunov, Pavel E. Volynsky, Nikolay A. Krylov,
- Ivan A. Boldyrev, and Roman G. Efremov, Liquid but Durable: Molecular Dynamics Simulations Explain the Unique Properties of Archaeal-Like Membranes, Scientific Reports, 4:7462, 2014, doi:10.1038/srep07462 (https://www.nature.com/articles/srep07462)
Initialize an instance of LipidLengthProtocol.
-
analysis_key
= 'lipid_length'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
LipidTiltProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the lipids tilt angles using the defined lipid vector.
This analyis estimates the mean lipid tilt using the vector represetation of the specified lipids in reference to a particular axis, typically the bilayer normal.
This protocol is identified by the analysis key: ‘lipid_tilt’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘upper’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, averages over all lipid types.
- style (str: ‘angle’, ‘order’): Specify whether to compute the
- tilt angle (‘angle’) or the tilt angle order parameter (‘order’). Default: ‘angle’
- ref_axis (str: ‘x’, ‘y’, or ‘z’): Specify the reference axis that
- should be used to estimate the tilt. This is typically the axis along the bilayer normal. Default: ‘z’
References
- Anton O. Chugunov, Pavel E. Volynsky, Nikolay A. Krylov,
- Ivan A. Boldyrev, and Roman G. Efremov, Liquid but Durable: Molecular Dynamics Simulations Explain the Unique Properties of Archaeal-Like Membranes, Scientific Reports, 4:7462, 2014, doi:10.1038/srep07462 (https://www.nature.com/articles/srep07462)
Initialize an instance of LipidTiltProtocol.
-
analysis_key
= 'lipid_tilt'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
MSDMultiProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the mean squared displacement using multiple time origins.
This analysis computes the average mean squared displacement (MSD) of the centers of mass of the specified lipids using multiple time origins and thus multiple time blocks:
MSD = <<(r(tau) - r_0)^2>_i>_tauwhere the inner angle brackets denote averaging over all lipids i and the outer brackets denote averaging over all time origins tau. The diffusion coefficient is estimated from the MSD using a simplified version Einstein’s relation:
D_i ~ MSD_i/(4.0*tau)This protocol is identified by the analysis key: ‘msd_multi’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, averages over all lipid types.
- n_tau (int): Specify the time block size in number of frames.
- Default: 50 ( 1000 picoseconds for timestep of 2 fs and frame output ever 100 timesteps).
- n_sigma (int): Specify the time between origins in number of frames.
- Default: 50.
Note
According to results in Ref 3 the time blocks used to estimate the MSD should not be overlapping. Therefore, it is recommended to use n_sigma >= n_tau.
References
- Christofer Hofsab, Erik Lindahl, and Olle Edholm, “Molecular
- Dynamics Simulations of Phospholipid Bilayers with Cholesterol”, Biophys J. 2003 Apr; 84(4): 2192-2206. doi: 10.1016/S0006-3495(03)75025-5
- Orsi, Mario, Julien Michel, and Jonathan W. Essex.
- “Coarse-grain modelling of DMPC and DOPC lipid bilayers.” Journal of Physics: Condensed Matter 22.15 (2010): 155106. http://iopscience.iop.org/article/10.1088/0953-8984/22/15/155106/meta
- Gaurav Pranami and Monica H. Lamm, Estimating Error in Diffusion
- Coefficients Derived from Molecular Dynamics Simulations, Journal of Chemical Theory and Computation 2015 11 (10), 4586-4592, DOI: 10.1021/acs.jctc.5b00574, http://pubs.acs.org/doi/full/10.1021/acs.jctc.5b00574
Initialize an instance of MSDMultiProtocol.
-
analysis_key
= 'msd_multi'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
MSDProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the mean squared displacement from a single time origin.
This analysis computes the mean squared displacement (MSD) versus time of the centers of mass of the specified lipids for a single time origin (i.e. the first frame in the trajectory analysis):
MSD(t) = <(r(t) - r_0)^2>_iwhere the angle brackets denote averaging over all lipids of type i; the lipid type used for the analysis is controlled by the
`leaflet`
setting.This protocol is identified by the analysis key: ‘msd’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname (str): Specify the resname of the lipid type to include in
- this analysis. Default: ‘all’, averages over all lipid types.
References
- Preston B. Moore, Carlos F. Lopez, Michael L. Klein, Dynamical
- Properties of a Hydrated Lipid Bilayer from a Multinanosecond Molecular Dynamics Simulation, Biophysical Journal, Volume 81, Issue 5, 2001, Pages 2484-2494, ISSN 0006-3495, http://dx.doi.org/10.1016/S0006-3495(01)75894-8. (http://www.sciencedirect.com/science/article/pii/S0006349501758948)
- Yoshimichi Andoh, Susumu Okazaki, Ryuichi Ueoka, Molecular
- dynamics study of lipid bilayers modeling the plasma membranes of normal murine thymocytes and leukemic GRSL cells, Biochimica et Biophysica Acta (BBA) - Biomembranes, Volume 1828, Issue 4, April 2013, Pages 1259-1270, ISSN 0005-2736, https://doi.org/10.1016/j.bbamem.2013.01.005. (http://www.sciencedirect.com/science/article/pii/S0005273613000096)
Initialize an instance of MSDProtocol.
-
analysis_key
= 'msd'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
MassDensProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the mass density profile for the specified selection.
This protocol is used to estimate the 1-dimensional mass density profile for a selection of atoms along the bilayer normal. The profile is automatically centered on the bilayer’s center of mass along the bilayer normal.
This protocol is identified by the analysis key: ‘mass_dens’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- selection_string (str): Provide the MDAnalysis compatible selection
- for the atoms to include in this analysis. Default: ‘BILAYER’, use all the lipids of the bilayer as recovered from the selection given to the external BilayerAnalyzer.
- n_bins (int): Set the number of bins to divide the normal dimensions
- into for binning. Defalt: 25
References
None
Initialize an instance of MassDensProtocol.
-
analysis_key
= 'mass_dens'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
NDCorrProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Correlation between bilayer surfucace curvature and the clustering of lipid molecules.
This protocol is used to estimate the cross correlation between the normal dimension deflection of lipids and the lipid types in local blocks of the bilayer. This serves as a measure of the correlation between the local curvature and composition of the bilayer.
This protocol is identified by the analysis key: ‘ndcorr’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- None
Note
Automatically estimates the correlations with each lipid type in the bilayer selection provided to the external BilayerAnalyzer object.
References
- Koldso H, Shorthouse D, He Lie 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
Initialize an instance of NDCorrProtocol.
-
analysis_key
= 'ndcorr'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
NNFProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the nearest neighbor fraction for one lipid type with another.
This analysis picks a specified number (n_neighbors) of nearest neighbors centered on a lipid of reference lipid type and then counts the number of lipids (M) of target lipid type and estimates the fraction,
nnf = <M/n_neighbors> ,where angle brackets denote averaging over lipids of specified by settings resname_1. This metric is also referred to as ‘fractional interations’.
This protocol is identified by the analysis key: ‘nnf’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- n_neighbors (int): Specifies the number of nearest neighbors to
- to include in computation. Default: 5
- resname_1 (str): Specify the resname of the reference lipid type to
- include in this analysis. Default: ‘first’, the first lipid in the list pulled from the com_frame representation.
- resname_2 (str): Specify the resname of the target lipid type to
- include in this analysis. Default: ‘first’, the first lipid in the list pulled from the com_frame representation.
Note
The anlysis in centered on lipids of the type specified by the
`resname_1`
setting and returns the fraction of lipids of the type specified by the`resname_2`
setting within the`n_neighbors`
nearest neighbors.References
- de Vries, A. E. Mark and S. J. Marrink, J. Phys. Chem. B,
2004, 108, 2454-2463
- Orsi and J. W. Essex, Faraday Discuss., 2013, 161, 249-272
- Koldso H, Shorthouse D, He Lie 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
Initialize an instance of NNFProtocol.
-
analysis_key
= 'nnf'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
SpatialVelocityCorrelationFunctionProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Compute spatial correlation function between lipid displacements/pseudo-velocities.
This analysis computes the displacement vectors as in the ‘disp_vec’ analysis, and uses those to estimated a spatial correlation function between the displacments/pseudo-velocities; the function is of the radial separation between the base of each vector in the bilayers lateral plane. The correlation is the cos(theta) value for the angle theta between the vectors.
This protocol is identified by the analysis key: ‘spatial_velocity_corr’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- leaflet (str: ‘both’, ‘upper’, or ‘lower’): Specifies the bilayer
- leaflet to include in the estimate. Default: ‘both’
- resname_1 (str): Specify the resname of the reference lipid type to
- include in this analysis. Special names are ‘first’ and ‘all’, which use the first and all lipid types respectively. Default: ‘first’, the first lipid in the list pulled from the com_frame representation.
- resname_2 (str): Specify the resname of the target lipid type to
- include in this analysis. Special names are ‘first’ and ‘all’, which use the first and all lipid types respectively. Default: ‘first’, the first lipid in the list pulled from the com_frame representation.
- n_bins (int): Specifies the number of bins to use when estimating
- the RDF. Default: 25
- range_inner (float): Specify the inner distance cutoff for the RDF.
- Default: 0.0
- range_outer (float): Specify the outer distance cutoff for the RDF.
- Default: 25.0
- interval (int): Sets the frame interval over which to compute the
- displacement vectors.
Note
The radial distance is centered on lipids of type resname_1 and averaging is taken over the pair-wise interactions of lipids of type
`resname_1`
with lipids of type`resname_2`
.References
None
Initialize an instance of SpatialVelocityCorrelationFunctionProtocol.
-
analysis_key
= 'spatial_velocity_corr'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
class
pybilt.bilayer_analyzer.analysis_protocols.
VolumeCompressibilityModulusProtocol
(args)[source]¶ Bases:
pybilt.bilayer_analyzer.analysis_protocols.AnalysisProtocol
Estimate the isothermal volume compressibility modulus.
- This protocol is used to estimate the volume compressibility modulus,
- K_V = (<V>kT) / var(V),
where V is the volume.
This protocol is identified by the analysis key: ‘vcm’
Parameters: args (list) – list of string keys and arguments - Settings (parsed from args to settings dict):
- temperature (float): The absolute temperature that the simulation
- was run at (i.e. in Kelvin). Default: 298.15 K
References
- Christofer Hofsab, Erik Lindahl, and Olle Edholm, “Molecular
- Dynamics Simulations of Phospholipid Bilayers with Cholesterol”, Biophys J. 2003 Apr; 84(4): 2192-2206. doi: 10.1016/S0006-3495(03)75025-5
Initialize an instance of VolumeCompressibilityModulusProtocol.
-
analysis_key
= 'vcm'¶
-
run_analysis
(ba_settings, ba_reps, ba_mda_data)[source]¶ Performs the analysis that this protocol represents for the current frame in the external BilayerAnalyzer’s run_analysis function.
Parameters: - ba_settings (dict) – The settings stored in the external BilayerAnalyzer instance.
- ba_reps (dict) – The representation objects stored in the external BilayerAnalyzer instance.
- ba_mda_data (MDAData instance) – The instance of MDAData stored in the external BilayerAnalyzer instance.
-
pybilt.bilayer_analyzer.analysis_protocols.
word_list_to_string
(word_list, delimeter=' ')[source]¶ Creates a single string from a list of strings
This function can be used to combine words in a list into one long sentence string.
Parameters: - word_list (list/tuple) – A list (or other container) of strings.
- delimeter (str, Optional) – A string to delimit the strings in the list when combining the strings.
Returns: A string.
pybilt.bilayer_analyzer.bilayer_analyzer module¶
The bilayer_analyzer module.
This module defines the BilayerAnalyzer class that can be used to build protocols for analyzing and generating plots for the analysis of a lipid bilayer trajectory.
Example
>> import pybilt.bilayer_analyzer as ba >> analyzer = ba.BilayerAnalyzer(input_file=”setup.in”) >> analyzer.run_analysis() >> analyzer.dump_data() >> analyzer.save_all_plots()
-
class
pybilt.bilayer_analyzer.bilayer_analyzer.
BilayerAnalyzer
(structure=None, trajectory=None, selection=None, input_file=None, input_dict=None)[source]¶ Bases:
future.types.newobject.newobject
An object used to implement analyses of the (quasi-)planar bilayers.
This object is used build and implement analysis protocols for quasi-planar lipid bilayer systems. This object currently uses MDAnalysis as the backend for trajectory manipulation.
-
settings
¶ A dictionary of adjustable settings for the analyzer. The dictionary is keyed by setting names and the setting values are stored at that setting key. The following is a list with descriptions of the settings keys:
- frame_range (list): A three element list containing the range
- of frames and the skipping interval for the analysis (i.e. which frames to include in the loop over the trajectory). Structure: [first_frame, last_frame, interval] Default: [0, -1, 1]
- print_interval (int): Set the frame loop interval/frequency for
- outputting some log data to the screen/std out. Default: 5
- norm (int): An integer representing the index of 3 element xyz
- coordinate arrays for the bilayer normal dimension. Default: 2, or the z-dimension/axis
- lateral (list): A two element list of integers representing the
- indices of 3 element xyz coordinate arrays for the bilayer lateral dimensions. Default: [0, 1], or the xy plane.
- normal_dimension (str): A string representing the bilayer’s
- normal dimension (i.e. ‘x’, ‘y’, or ‘z’). This setting corresponds to the ‘norm’ setting by the transformation (‘x’, ‘y’, ‘z’) => (0, 1, 2). Default: ‘z’
- lateral_dimension (str): A string representing the bilayer’s
- lateral dimensions (i.e. ‘xy’, ‘yz’, ‘xz’, etc.). This corresponds to the ‘lateral’ setting by the transformation (‘x’, ‘y’, ‘z’) => (0, 1, 2). Default: ‘xy’
- frame_index (int): An integer used to store the index of the
- current frame in the trajectory during the analysis loop.
Type: dict
-
reps
¶ A dictionary of used to store the different bilayer representations used by the different analyses. The dictionary is keyed by representation names and the representation objects (if used) are stored at that key after construction. The following is a list with descriptions of the rep keys:
- current_mda_frame (MDAnalysis–>Timestep): This key is used to
- store a copy of the current frame from the MDAnalysis trajectory and constitutes the “all atom” representation of the bilayer.
- com_frame (pybilt.bilayer_analyzer.com_frame.COMFrame): This
- key is used to store an instance of the COMFrame object for the current frame during the analysis loop and represents the reduced dimension “centers-of-mass” represetation of the bilayer. i.e. each lipid (or selection from each lipid) is reduced to a single particle located at its center of mass.
- leaflets: (dict of pybilt.bilayer_analyzer.leaflet.Leaflet):
- This key stores a copy of a dictionary containing the Leaflet objects used to store the data about which lipids are in each of the bilayer leaflets. It has the keys ‘upper’ and ‘lower’, which correspond to the upper and lower leaflets of the bilayer respectively.
- lipid_grid (pybilt.lipid_grid.lipid_grid.LipidGrids): This key
- stores a copy of the LipidGrids object for the current frame of the trajectory in the (analysis) loop and represents the “lipid grid” (or GridMAT-MD style) version of the bilayer. i.e., the lipids of each leaflet are mapped /assigned to a 2-dimensional grid (or matrix). There are two grids, one for each leaflet of the bilayer.
- vector_frame (pybilt.bilayer_analyzer.vector_frame.VectorFrame):
- This key is used to store an instance of the VectorFrame object for the current frame during the analysis loop and represents the “lipid vectors” represetation of the bilayer; i.e. each lipid in the bilayer is represented by a vector.
- first_com_frame (pybilt.bilayer_analyzer.com_frame.COMFrame):
- This key is used to store an instance of the COMFrame object for the first frame during the analysis loop and represents the reduced dimension “centers-of-mass” represetation of the bilayer. i.e. each lipid (or selection from each lipid) is reduced to a single particle located at its center of mass.
Type: dict
-
rep_settings
¶ A dictionary of adjustable settings for representatiion used by the analyzer (as stored in the reps dictionary). The dictionary is keyed by rep names and the setting values are stored in a dictionary at that rep name key. The following is a list with descriptions of the rep_settings keys and the subsequent setting keys:
- rep_settings key:setting key (value type): Description and
- Default value. Corresponds to
- –> rep_settings[‘rep_settings key’][‘setting keys’]
- com_frame:dump (bool): A boolean that is used to determine if the
- COMFrame objects should be dumped to disc as a pickle file after each iteration of the analysis loop. Default: False
- com_frame:dump_path (str): A string containing the file path for
- where COMFrame objects are to be dumped. Default: ‘./’
- com_frame:name_dict (dict): A dictionary keyed by residue names of
- specific lipid types and containing a list of atom names to be used when computing the centers-of-mass of lipids of that type. Default: None
- leaflets:dump (bool): Determines whether the leaflets are dumped
- to disc (as pickles) after each frame in the analysis loop. Default: False
- leaflets:dump_path (str): A string file path for where the
- leaflet object dictionaries are dumped. Default: ‘./’
- leaflets:update_interval (int): Determines how ofter to update the
- leaflet assignments. Default: 1, or every frame.
- leaflets:assign_method (str): Set which method is used to assign
- lipids to leaflets. There are two options: ‘avg_norm’ which which compares lipid coms along the bilayer normal dimension to the average for all lipids, and ‘orientation’ which assigns a vector to each lipid and uses the orientation of that vector relative to the bilayer normal to assign the lipids to leaflets. Default: ‘avg_norm’
- leaflets:orientation_atoms (dict): A dictionary keyed to lipid
- resnames which defines the atoms to use for the orientation vector. Each key (lipid resname) should be assigined a two element list of tail and head atoms for that lipid type, specified by the atom names; e.g. {‘POPC’:[‘C128’, ‘P’]}. Default: None. Note: This option is only used in conjuction with leaflets:assign_method = ‘orientation’.
- lipid_grid:dump (bool): Determines wheter the LipidGrids objects
- built during interations of the analysis loop are dumped to disc as pickle files. Default: False
- lipid_grid:dump_path (str): A string containing the path where
- dumped LipidGrids should be written. Default: ‘./’
- lipid_grid:nxbins (int): An integer defining the number of bins to
- use in the ‘x’ dimension of the LipidGrid objects. Default: 10
- lipid_grid:nybins (int): An integer defining the number of bins to
- use in the ‘y’ dimension of the LipidGrid objects. Default: 10
- vector_frame:dump (bool): Determines wheter the VectorFrame objects
- built during interations of the analysis loop are dumped to disc as pickle files. Default: False
- vector_frame:dump_path (str): A string containing the path where
- dumped VectorFrame objects should be written. Default: ‘./’
- vector_frame:ref_atoms (dict): A dictionary of the atom names of
- atoms to be used to compute the vector each lipid type. The dictionary should be keyed by the resname of the lipid types. For each lipid type there should be dictionary with the keys ‘start’ and ‘end’ with lists of the atom names to use when determining the start and end of the vector respectively. Default: None. Example: rep_settings[‘ref_atoms’] = {‘DOPE’:{‘start’:[‘P’], ‘end’:[‘N’]}}
Type: dict
BilayerAnalyzer initialization. The initialization initialially parses all the inputs and sets some the attribute values. It also calls the initialization of the Analyses and PlotProtocol objects and builds the MDAData object. :Parameters: * structure (str) – Optional, the path and filename of the structure file.
- trajectory (str;list) – Optional, the path and filename of the trajectory file. Also accepts a list of filenames.
- selection (str) – Optional, the MDAnalysis compatible string to select the bilayer components.
- input_file (str) – Optional, the path and filename of input setup file.
- input_dict (dict) – Optional, a dictionary of keyed by valid commands and their input values.
-
add_analysis
(analysis_in)[source]¶ Add a analysis to the analysis protocol. :Parameters: analysis_in (str, list/tuple, or dict) – The inpute defining the
analysis key, analysis id, and settings for the new analysis.
-
add_plot
(plot_string)[source]¶ Add a new plot to the plot protocol. :Parameters: plot_string (str) – A string with the plot key, id, and arguments.
-
static
available_analysis
()[source]¶ Returns the available analysiss. :returns: A list of string keys corresponding to the available
analysis.Return type: (list)
-
static
available_plots
()[source]¶ Returns the list of the keys of the available plot types.
Returns: A list of string keys for available plot types. Return type: (list)
-
generate_plot
(plot_id)[source]¶ Generate the plot image file (.eps) for the specified plot. :Parameters: plot_id (str) – The string plot id for the plot generate.
-
get_analysis_data
(analysis_id)[source]¶ Return the analysis output for the specified analysis. :Parameters: analysis_id (str) – A string analysis id.
Returns: - The analysis output of the specified analysis. The
- type/structure will depend on the analysis.
Return type: Variable
-
get_analysis_ids
()[source]¶ Return the ids of currently initialized analysiss in the analysis protocol. :returns: A list string analysis ids. :rtype: (list)
-
get_plot_ids
()[source]¶ Return the ids of the plots in the plot protocol.
Returns: - A list of string plot ids that have been initialized in
- the plot protocol.
Return type: (list)
-
parse_input_script
(input_script_name)[source]¶ Parses input setup scripts. :Parameters: * input_script_name (str) – A string with the file path and name of
- the input script to be parsed.
Returns: - A dictionary containing lists of commands for each type of
- command key (e.g. analysis, plot, etc.).
Return type: (dict) Raises: RuntimeError
– A runtime error is given if there is an invalid command key in the input script. A runtime error is also raised if the required commands are not provided in the input script.
-
remove_analysis
(analysis_id)[source]¶ Remove a specified analysis from the comptue protocol. :Parameters: analysis_id (str) – The string analysis id of the analysis to be
removed from the protocol.
-
remove_plot
(plot_id)[source]¶ Remove the specified plot from the protocol. :Parameters: plot_id (str) – Plot id of the plot to be removed.
-
run_analysis
()[source]¶ Runs the analysis. The function performs the loop over the trajectory. At each frame it builds the necessary objects (e.g. COMFrame) and then executes the analysis of each analysis that was initialized in the setup.
Args:
-
set_dump_com_frame
(on=True, path='./')[source]¶ Turn on (or off) the dumping of COMFrame objects built during analysis. :Parameters: * on (bool, optional) – Defines whether the COMFrame objects should be
dumped (as pickle files) after each frame in the analysis loop. Defaults to True- path (str, optional) – Sets the path where the COMFrame objects are dumped. Defaults to “./”
-
set_dump_leaflet
(on=True, path='./')[source]¶ Turn on (or off) the dumping of leaflet objects built during analysis. :Parameters: * on (bool, optional) – Defines whether the COMFrame objects should be
- dumped (as pickle files) after each frame in the analysis loop.
- Defaults to True
- path (str, optional) – Sets the path where the COMFrame objects are dumped. Defaults to “./”
-
set_dump_lipid_grid
(on=True, path='./')[source]¶ Turn on (or off) the dumping of LipidGrid objects built during analysis. :Parameters: * on (bool, optional) – Defines whether the COMFrame objects should be
dumped (as pickle files) after each frame in the analysis loop. Defaults to True.- path (str, optional) – Sets the path where the COMFrame objects are dumped. Defaults to “./”
-
set_frame_range
(first=0, last=-1, interval=1)[source]¶ Set the frame range and interval to use in the analysis. :Parameters: * first (int) – The first frame.
- last (int) – The last frame.
- interval (int) – The interval to skip between frames in the analysis loop.
-
-
pybilt.bilayer_analyzer.bilayer_analyzer.
print_analysis_settings
(analysis_key)[source]¶ Print to std out the adjustable settings of analyses available to the BilayerAnalyzer.
-
pybilt.bilayer_analyzer.bilayer_analyzer.
print_available_plots
()[source]¶ Print to std out the valid plotting protocols available to the BilayerAnalyzer.
pybilt.bilayer_analyzer.com_frame module¶
-
class
pybilt.bilayer_analyzer.com_frame.
COMFrame
(mda_frame, mda_bilayer_selection, unwrap_coords, name_dict=None, multi_bead=False, rewrap=False, make_whole=False)[source]¶ Bases:
future.types.newobject.newobject
A molecular dynamics style Frame object for LipidCOM objects.
- Atrributes:
- lipidcom (list of obj:LipidCOM): A list of the LipidCOM objects assigned to the COMFrame. box (np.array): A 3 element vector containing the (rectangular) xyz box edge lengths. time (float): The simulation time that this Frame represents. number (int): The frame number of this Frame. mdnumber (int): The corresponding frame number in the original MD trajectory
Frame initialization.
Parameters: - mda_frame (MDAnalysis.Timestep) – The MDAnalysis frame for the coordinates to use in computing the lipid centers of mass.
- mda_bilayer_selection (MDAnalysis.AtomSelection) – The MDAnalsysis atom selection object for the containing the atoms in the bilayer.
- unwrap_coords (numpy.Array) – A numpy array containing the the unwrapped coordinates of the bilayer selection atoms.
-
cog
(wrapped=True)[source]¶ Computes the center of geometry (COG) for the Frame
This member function is used to compute the overall center of geometry (COG) of the COMFrame using the LipidCOM object coordinates.
Parameters: wrapped (bool, optional) – Define which set of coordinates to use in the computation. True (default) - The wrapped LipidCOM coordinates are used to compute the COG of the frame. False - The unwrapped LipidCOM coordinates are used to compute the COG of the frame. Returns: A 3 element vector containing the xyz coordinates of the Frame’s COG Return type: np.array
-
com
(wrapped=True)[source]¶ Computes the center of mass (COM) for the Frame
This member function is used to compute the overall center of mass (COM) of the COMFrame using the LipidCOM object coordinates and masses.
Parameters: wrapped (bool, optional) – Define which set of coordinates to use in the computation. True (default) - The wrapped LipidCOM coordinates are used to compute the COM of the frame. False - The unwrapped LipidCOM coordinates are used to compute the COM of the frame. Returns: A 3 element vector containing the xyz coordinates of the Frame’s COM Return type: np.array
-
set_box
(box_lengths)[source]¶ Set the rectangular xyz box edge lengths.
Parameters: box_lengths (numpy.array) – A 1d, 3 element numpy.array containing the x,y,z box sizes (or edge lengths)
-
class
pybilt.bilayer_analyzer.com_frame.
LipidCOM
[source]¶ Bases:
future.types.newobject.newobject
A lipid center of mass (COM) object.
This object stores the COM coordinates of a lipid (or other molecule or group of atoms) computed from both the wrapped and unwrapped atomic coordinates. This object also stores information about the type of lipid as well as the total mass of the lipid.
LipidCOM initialization
-
type
¶ The lipid type (e.g. the lipid could be typed b resname).
Type: str
-
com
¶ The length three vector holding the wrapped xyz coordinates.
Type: np.array
-
com_unwrap
¶ The length three vector holding the unwrapped xyz coordinates.
Type: np.array
-
mass
¶ The total mass of the atoms used to define LipidCOM.
Type: float
-
extract
(mda_residue, unwrap=False, box=None, name_dict=None, make_whole=True)[source]¶ Get the center of mass coordinates from an MDAnalysis residue
This function calls the MDAnalysis member function center_of_mass() of the residue to compute the center of mass of the atoms constituting the residue.
Parameters: - mda_residue (MDAnalysis.residue) – An MDAnalysis residue object from which to extract a center of masss coordinates.
- unwrap (bool, optional) – Define which com container to store coordiates in. False (default) - The COM coordinates are stored in the container designated for the wrapped coordinate representation. True - The COM coordinates are stored in the container designated for the unwrapped coordinate representation.
-
pybilt.bilayer_analyzer.leaflet module¶
-
class
pybilt.bilayer_analyzer.leaflet.
Leaflet
(name)[source]¶ Bases:
future.types.newobject.newobject
Create a bilayer Leaflet representation. This class object is used to group lipids together according to their bilayer leaflet. It is primarily meant to store the indices of LipidCOMs as they are in a Frame.lipidcom list. This class also creates sub-groups within the Leaflet based on the LipidCOM.type using LipidGroup objects. Instances of Leaflet are created by the MemSys class.
Initializes an instance of a Leaflet object.
Parameters: name (str) – The name of the bilayer leaflet being initialized (‘upper’ and ‘lower’ are used by the MemSys class). -
name
¶ The name of the Leaflet (e.g. ‘upper’ or ‘lower’).
Type: str
-
members
¶ A list containing the integer indices associated with the LipidCOM objects within a Frame that are assigned to the Leaflet instance.
Type: list of int
-
groups (list of obj
LipidGroup): A list of the LipidGroup objects (uniquely named) that are created by the Leaflet instance as new members are added.
-
group_dict
¶ A dictionary keyed according to the names of the LipidGroup objects created, which stores the corresponding index of that LipidGroup in self.groups.
Type: dict
-
add_member
(com_index, resname, resid)[source]¶ Add new lipids to the Leaflet.
This function is meant to be used to add new lipids according to their Frame.lipidcom index to the Leaflet and to a LipidGroup according resname/type/name. :Parameters: * com_index (int) – The COMFrame.lipidcom index of the lipid being added to the Leaflet.
- resname (str) – The resname (or LipidCOM.type) of the lipid being added.
- resid (int) – The topological resid of the lipid being added to the leaflet.
-
get_group_indices
(group_name)[source]¶ Get the indices of lipids in the Leaflet belonging to a specific LipidGroup.
Args: group_name (string): The name of the LipidGroup pull LipidCOM indices from.
Passing the string ‘all’ will return indices of all the lipids assigned to the Leaflet instance. If the group_name is not recognised (i.e. is not in the group_dict) The function defaults to ‘all’.Returns: - A list containing the integer indices of lipids in the Leaflet that
- belong to the specified LipidGroup.
Return type: list of int
-
get_group_names
()[source]¶ Get the names of all the LipidGroup objects in the Leaflet
Returns: list of str: A list of the names of current LipidGroup objects.
-
get_member_indices
()[source]¶ Get the indices of all lipids (LipidCOM) in the Leaflet. This member function Returns: the list of indices for the lipids grouped in the Leaflet instance.
Returns: A list of integer indices of the lipids associated with the Leaflet instance. Return type: list of int
-
get_member_resids
()[source]¶ Get the ‘resid’s of all lipids in the Leaflet. This member function Returns: the list of resid for the lipids grouped in the Leaflet instance.
Returns: A list of integer ‘resid’s of the lipids associated with the Leaflet instance. Return type: list of int
-
get_member_resnames
()[source]¶ Get the ‘resname’s of all lipids in the Leaflet. This member function Returns: the list of resnames for the lipids grouped in the Leaflet instance.
Returns: A list of ‘resname’s of the lipids associated with the Leaflet instance. Return type: list of int
-
-
class
pybilt.bilayer_analyzer.leaflet.
LipidGroup
(name)[source]¶ Bases:
future.types.newobject.newobject
Object to group lipid indices by type/resname/name. Instances of this object are created by the Leaflet class.
Initializes LipidGroup object.
Parameters: name (str) – The name/type/resname of the lipids being grouped in this object. -
lg_members
¶ A list to hold the indices of lipids added to this this LipidGroup.
Type: list of int
-
lg_name
¶ The name/type/resname of the lipids being grouped in this object.
Type: str
-
pybilt.bilayer_analyzer.mda_data module¶
Defines the MDAData class that is used to store the MDAnalysis objects built from the structure and trajectory file.
pybilt.bilayer_analyzer.plot_protocols module¶
-
class
pybilt.bilayer_analyzer.plot_protocols.
APLPlotProtocol
(args, analysis_keys, analysis_ids)[source]¶ Bases:
pybilt.bilayer_analyzer.plot_protocols.PlotFunctionProtocol
Initialization for Plotting protocol for MSD analysis args are the input arguments of format “plot_id analysis_id_1 legend_key_1…”
-
class
pybilt.bilayer_analyzer.plot_protocols.
BTPlotProtocol
(args, analysis_keys, analysis_ids)[source]¶ Bases:
pybilt.bilayer_analyzer.plot_protocols.PlotFunctionProtocol
Initialization for Plotting protocol for MSD analysis args are the input arguments of format “plot_id analysis_id_1 legend_key_1…”
-
class
pybilt.bilayer_analyzer.plot_protocols.
DispVecPlotProtocol
(args, analysis_keys, analysis_ids)[source]¶ Bases:
pybilt.bilayer_analyzer.plot_protocols.PlotFunctionProtocol
Initialization for Plotting protocol for MSD analysis args are the input arguments of format “plot_id analysis_id_1 legend_key_1…”
-
class
pybilt.bilayer_analyzer.plot_protocols.
MSDPlotProtocol
(args, analysis_keys, analysis_ids)[source]¶ Bases:
pybilt.bilayer_analyzer.plot_protocols.PlotFunctionProtocol
Initialization for Plotting protocol for MSD analysis args are the input arguments of format “plot_id analysis_id_1 legend_key_1…”
pybilt.bilayer_analyzer.prefab_analysis_protocols module¶
Prefab analysis protocols for lipid bilayers.
This module defines a set of functions that perform bilayer analysis using pre-designed (prefab) protocols that automatically setup and run the analyses, extract and output data, and generate plots. Most of these protocols make use of the BilayerAnalyzer class, but some use tools from the mda_tools package. These analyses are meant for quasi-planar lipid bilayer systems.
Example
>> from pybilt.bilayer_analyzer import prefab_analysis_protocols as ba_pap >> ba_pap.msd_diffusion(structure_file=’my_structure’, … trajectory_file=’my_trajectory’, selection_string=’resname DOPE POPC’, … dump_path=’./my_output_directory/’)
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
PN_orientational_angle
(structure_file, trajectory_file, selection_string, lipid_resnames, PN_names='default', frame_start=0, frame_end=-1, frame_interval=1, dump_path=None)[source]¶ Protocol to compute PN orientational angles.
This function uses the BilayerAnalyzer with the analysis ‘loa’ to compute the PN orientational angles of the specified lipids (by resname). Reports of data are printed to standard out, while pickled data (numpy array) is dumped to disk. The pickle data files have prefix ‘loa’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- lipid_resnames (list) – A list of lipid types as specified by their resnames.
- PN_names (Optional(dict)) – A dictionary specifying the atom names for the phosphorous and nitrogen atoms to use for the PN vector. This should have the format {‘lipid_resname_1’:(‘phosphorous_name’, nitrogen_name)}. Defaults to ‘default’, which uses (‘P’, ‘N’) for all lipid types.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
area_per_lipid
(structure_file, trajectory_file, selection_string, frame_start=0, frame_end=-1, frame_interval=1, dump_path=None, n_xbins=100, n_ybins=100, name_dict=None)[source]¶ Protocol to compute area per lipid.
This function uses the BilayerAnalyzer with the analyses ‘apl_box’ and ‘apl_grid’ to estimate the area per lipid using two estimators: the lateral area method (composite) and lipid grid approach. Reports of data are printed to standard out, while pickled data is dumped to disk and plots are generated and also dumped to disk. The generated files have the prefix ‘apl’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
- n_xbins (Optional[int]) – Specify the number of bins in the ‘x’ direction to use in the lipid grid. Defaults to 100.
- n_ybins (Optional[int]) – Specify the number of bins in the ‘y’ direction to use in the lipid grid. Defaults to 100.
Returns: void
Notes
The lipid grid will have dimensions of n_xbins by n_ybins.
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
bilayer_thickness
(structure_file, trajectory_file, selection_string, frame_start=0, frame_end=-1, frame_interval=1, dump_path='./', name_dict=None, n_xbins=100, n_ybins=100, plot_grid_map=True)[source]¶ Protocol to compute the bilayer thickness.
This function uses the BilayerAnalyzer with the analysis ‘bilayer_thickness’ to estimate the the thickness of the bilayer via the lipid grid approach. Reports of data are printed to standard out, while pickled data (numpy array) is dumped to disk and plots are generated and also dumped to disk. The generated files have the prefix ‘bt’ and the grid maps have the prefix ‘thickness_grid’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
- name_dict (Optional[dict]) – A dictionary that defines atoms to use for each lipid type when computing the center of mass, which is then mapped to the lipid grid. The dictionary should have structure {‘lipid_resname_1’:[‘atom_a’, ‘atom_b’], ‘lipid_resname_2’:[‘atom_c’]}. Defaults to None, which means the center of mass of the whole lipid is used.
- n_xbins (Optional[int]) – Specify the number of bins in the ‘x’ direction to use in the lipid grid. Defaults to 100.
- n_ybins (Optional[int]) – Specify the number of bins in the ‘y’ direction to use in the lipid grid. Defaults to 100.
- plot_grid_map (Optional[bool]) – Specify whether the 2d grid heat map of of the thickness should be generated and output for each analyzed frame. Defaults to True.
Returns: void
Notes
The lipid grid will have dimensions of n_xbins by n_ybins.
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
com_lateral_rdf
(structure_file, trajectory_file, bilayer_selection_string, resnames, name_dict=None, frame_start=0, frame_end=-1, frame_interval=1, dump_path='./')[source]¶ Protocol to compute the 2d RDFs for lipid types in the bilayer lateral plane.
This function uses the BilayerAnalyzer with the bilayer_anlayzer.analysis_protocols.COMLateralRDFProtocol analysis protocol to compute the 2d RDFs of lipids in the lateral dimensions of the bilayer and generates their plots. Separate plots are generated for each pair of lipid types (denoted by their resnames). The plots are generated and dumped to disk. The output files have the prefix ‘com_lateral_rdf’.
- Args:
structure_file (str): The path and filename of the structure file. trajectory_file (str, list): The path and filename of the trajectory
file. Also accepts a list of path/filenames.- selection_string (str): The MDAnalysis compatible string used to select
- the bilayer components.
- resnames (list): Specify the resnames of the lipid types
- that are to be included in this analysis.
- frame_start (Optional[int]): Specify the index of the first frame
- of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]): Specify the index of the last frame
- of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]): Specify the interval between frames of
- the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]): Specify a file path for the output files.
- Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
compressibility
(structure_file, trajectory_file, selection_string, frame_start=0, frame_end=-1, frame_interval=1, dump_path=None, temperature=298.15)[source]¶ Protocol to compute the compressibilities.
This function uses the BilayerAnalyzer with the analyses ‘acm’, ‘vcm’, and ‘ac’ to estimate the area compressibility modulus, volume compressibility modulus, and area compressibility of the system. Reports of data are printed to standard out, while pickled data is dumped to disk. The generated files have the prefixes ‘acm’, ‘vcm’, and ‘ac’ for area compressibility modulus, volume compressibility modulus, and area compressibility respectively.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
- temperature (Optional[float]) – Set the temperature (in Kelvin) used in the simulation. Defaults to 298.15.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
curvature_grid
(structure_file, trajectory_file, selection_string, frame_start=0, frame_end=-1, frame_interval=1, dump_path='./', name_dict=None, n_xbins=100, n_ybins=100, curvature_grid_vmin=None, curvature_grid_vmax=None)[source]¶ Protocol to generate curvature estimates over a grid.
This function uses the BilayerAnalyzer with the ‘lipid_grid’ reprentation to estimate the curvature of the bilayer via the lipid grid approach. Data and plots are generated and dumped to disk. The generated files have the prefix ‘curvature_grid’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
- name_dict (Optional[dict]) – A dictionary that defines atoms to use for each lipid type when computing the center of mass, which is then mapped to the lipid grid. The dictionary should have structure {‘lipid_resname_1’:[‘atom_a’, ‘atom_b’], ‘lipid_resname_2’:[‘atom_c’]}. Defaults to None, which means the center of mass of the whole lipid is used.
- n_xbins (Optional[int]) – Specify the number of bins in the ‘x’ direction to use in the lipid grid. Defaults to 100.
- n_ybins (Optional[int]) – Specify the number of bins in the ‘y’ direction to use in the lipid grid. Defaults to 100.
Returns: void
Notes
The lipid grid will have dimensions of n_xbins by n_ybins.
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
dispvector_correlation
(structure_file, trajectory_file, selection_string, frame_start=0, frame_end=-1, frame_interval=1, dump_path='./', name_dict=None, resnames=None, generate_stroboscopic=False)[source]¶ Protocol to compute lipid displacement vector maps and correlations.
This function uses the BilayerAnalyzer with the analyses ‘disp_vec’, ‘disp_vec_corr’, and ‘disp_vec_nncorr’ to compute the lipid displacement vectors and their correlations (i.e. cos(theta)). The displacement vectors are used to generate the vector map plots. Reports of data are printed to standard out, while pickled data is dumped to disk and plots are generated and also dumped to disk. The generated pickle data files have the prefix ‘disp_vec’ and the vector map plots have prefix ‘step_vector_map’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
distance_cutoff_clustering
(structure_file, trajectory_file, selection_string, resnames, frame_start=0, frame_end=-1, frame_interval=1, dump_path='./', name_dict=None)[source]¶ Protocol to compute hiearchical distance cutoff clusters.
This function uses the BilayerAnalyzer to determine the hiearchical distance cutoff clusters of lipids in the lateral dimensions; clustering is performed between lipids of the same type using a distance cutoff of 12.0*distance_units (assumed to be Angstroms). The protocol extracts the number of clusters and average cluster size for each lipid type in both the ‘upper’ and ‘lower’ leaflets. Reports of data are printed to standard out, while pickled data is dumped to disk and plots are generated and also dumped to disk. The generated files have the prefix ‘dc_cluster’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
halperin_nelson
(structure_file, trajectory_file, selection_string, frame_start=0, frame_end=-1, frame_interval=1, dump_path='./', name_dict=None)[source]¶ Protocol to compute the Halperin-Nelson rotational invariant in the bilayer leaflets.
This function uses the BilayerAnalyzer with the analysis ‘halperin_nelson’, to compute the mean 2-d Halperin and Nelson’s rotational invariant parameter of lipids in each leaflet of the bilayer. Reports of data are printed to standard out, while pickled data is dumped to disk. The generated pickle data files have the prefix ‘halperin_nelson’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
- name_dict (Optional[dict]) – A dictionary that defines atoms to use for each lipid type when computing the center of mass, which is then mapped to the lipid grid. The dictionary should have structure {‘lipid_resname_1’:[‘atom_a’, ‘atom_b’], ‘lipid_resname_2’:[‘atom_c’]}. Defaults to None, which means the center of mass of the whole lipid is used.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
lipid_collinearity
(structure_file, trajectory_file, selection_string, lipid_resnames, ref_atoms, frame_start=0, frame_end=-1, frame_interval=1, dump_path=None)[source]¶ Protocol to compute PN orientational angles.
This function uses the BilayerAnalyzer with the analysis ‘loa’ to compute the PN orientational angles of the specified lipids (by resname). Reports of data are printed to standard out, while pickled data (numpy array) is dumped to disk. The pickle data files have prefix ‘loa’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- lipid_resnames (list) – A list of lipid types as specified by their resnames.
- ref_atoms (dict) – A dictionary storing the references atoms to be used in building the vector representation. The outer keys of ref_atoms should be the resnames of the lipids. The inner objects should also be dictionaries with the keys ‘start’ and ‘end’.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
lipid_grid_maps
(structure_file, trajectory_file, selection_string, frame_start=0, frame_end=-1, frame_interval=1, dump_path='./', name_dict=None, n_xbins=100, n_ybins=100, type_colors='auto')[source]¶ Protocol to generate lipid grid map plots.
This function uses the BilayerAnalyzer with the ‘lipid_grid’ reprentation to estimate the the thickness of the bilayer via the lipid grid approach. Grid map lots are generated and dumped to disk. The generated files have the prefix ‘lipid_grid’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
- name_dict (Optional[dict]) – A dictionary that defines atoms to use for each lipid type when computing the center of mass, which is then mapped to the lipid grid. The dictionary should have structure {‘lipid_resname_1’:[‘atom_a’, ‘atom_b’], ‘lipid_resname_2’:[‘atom_c’]}. Defaults to None, which means the center of mass of the whole lipid is used.
- n_xbins (Optional[int]) – Specify the number of bins in the ‘x’ direction to use in the lipid grid. Defaults to 100.
- n_ybins (Optional[int]) – Specify the number of bins in the ‘y’ direction to use in the lipid grid. Defaults to 100.
- type_colors (Optional[dict]) – Specify the colors to use for for each lipid type when generating the 2d grid map plot. The dictionary should be keyed by the lipid types’ resnames. Defaults to ‘auto’, which automatically assigns colors for each lipid type.
Returns: void
Notes
The lipid grid will have dimensions of n_xbins by n_ybins.
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
lipid_length
(structure_file, trajectory_file, selection_string, lipid_resnames, ref_atoms, frame_start=0, frame_end=-1, frame_interval=1, dump_path=None)[source]¶ Protocol to compute lengths of lipids.
This function uses the BilayerAnalyzer with the analysis ‘lipid_length’ to estimate the lengths of specified lipids (by resname). Reports of data are printed to standard out, while pickled data (numpy array) is dumped to disk. The pickle data files have prefix ‘lipid_length’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- lipid_resnames (list) – A list of lipid types as specified by their resnames.
- ref_atoms (dict) – A dictionary storing the references atoms to be used in building the vector representation. The outer keys of ref_atoms should be the resnames of the lipids. The inner objects should also be dictionaries with the keys ‘start’ and ‘end’.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
lipid_tilt
(structure_file, trajectory_file, selection_string, lipid_resnames, ref_atoms, frame_start=0, frame_end=-1, frame_interval=1, dump_path=None, ref_axis='z')[source]¶ Protocol to compute lengths of lipids.
This function uses the BilayerAnalyzer with the analysis ‘lipid_tilt’ to estimate the tilt angle of specified lipids (by resname). Reports of data are printed to standard out, while pickled data (numpy array) is dumped to disk. The pickle data files have prefix ‘lipid_tilt’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- lipid_resnames (list) – A list of lipid types as specified by their resnames.
- ref_atoms (dict) – A dictionary storing the references atoms to be used in building the vector representation. The outer keys of ref_atoms should be the resnames of the lipids. The inner objects should also be dictionaries with the keys ‘start’ and ‘end’.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
msd_diffusion
(structure_file, trajectory_file, selection_string, resnames=None, frame_start=0, frame_end=-1, frame_interval=1, dump_path=None)[source]¶ Protocol to compute MSD curves and estimate diffusion coefficents.
This function uses the BilayerAnalyzer with the analysis ‘msd’ to compute the time series curves for the mean squared displacements of lipids in the selection and then uses tools from the diffusion package to estimate the diffusion coefficents via three different estimators; i.e., the Einstein relation, linear (least squares) line fit, and a non-linear anomalous diffusion model fit. The protocol uses two different time ranges for the diffusion coefficent estimations: 0 (or first frame) to 10000.0 (assumed to be 10000 ps or 10 ns) and 10000.0 to 100000.0 (assumed to 10000 ps or 10 ns to 100000 ps or 100 ns). Reports of data are printed to standard out, while pickled data is dumped to disk and MSD time series plots are generated and also dumped to disk. The output files have the prefix ‘msd’.
- Args:
structure_file (str): The path and filename of the structure file. trajectory_file (str, list): The path and filename of the trajectory
file. Also accepts a list of path/filenames.- selection_string (str): The MDAnalysis compatible string used to select
- the bilayer components.
- resnames (Optional[str, list]): Specify the resnames of the lipid types
- that are to be included in this analysis. Defaults to None, which includes all lipid types.
- frame_start (Optional[int]): Specify the index of the first frame
- of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]): Specify the index of the last frame
- of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]): Specify the interval between frames of
- the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]): Specify a file path for the output files.
- Defaults to None, which outputs in the current directory.
Returns: void Notes
This function summarizes the diffusion coefficent estimates by printing to the std out, which could be redirected into a file.
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
nearest_neighbor_fraction
(structure_file, trajectory_file, selection_string, lipid_resnames, frame_start=0, frame_end=-1, frame_interval=1, dump_path=None, name_dict=None)[source]¶ Protocol to compute the nearest neigbor fraction.
This function uses the BilayerAnalyzer with analysis ‘nnf’ to estimate the nearest neighbor fractions (also known as fractional interactions) of the specified lipids (by resname). Reports of data are printed to standard out, while pickled data is dumped to disk and plots are generated and also dumped to disk. The generated files have the prefix ‘nnf’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- lipid_resnames (list) – A list of lipid types as specified by their resnames.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
normal_displacement_lipid_type_correlation
(structure_file, trajectory_file, selection_string, frame_start=0, frame_end=-1, frame_interval=1, dump_path=None, com_sub_selection_dict=None)[source]¶ Protocol for correlation between the normal dimension displacement and lipid type.
This function uses the BilayerAnalyzer with the analysis ‘ndcorr’ to do a local grid analysis to estimate the correlation between between lipid types and their deflection along the bilayer normal; this analysis includes all lipid types. Reports of data are printed to standard out, while pickled data is dumped to disk and plots are generated and also dumped to disk. The generated pickle files have the prefix ‘norm_disp_correlation’ while the plots have the prefix ‘ndcorr’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
position_density_maps_2d
(structure_file, trajectory_file, bilayer_selection_string, resnames, frame_start=0, frame_end=-1, frame_interval=1, dump_path='./')[source]¶ Protocol to compute the 2d positional densities and its plots.
This function uses the mda_tools.mda_density_map.position_density_map_2d_leaflet_simple function to compute the 2d positional densities of lipids in the lateral dimensions and generates their plots. Separate plots are generated for each lipid type, denoted by their resnames. The plots are generated and dumped to disk. The output files have the prefix ‘position_density_2d’.
- Args:
structure_file (str): The path and filename of the structure file. trajectory_file (str, list): The path and filename of the trajectory
file. Also accepts a list of path/filenames.- selection_string (str): The MDAnalysis compatible string used to select
- the bilayer components.
- resnames (list): Specify the resnames of the lipid types
- that are to be included in this analysis.
- frame_start (Optional[int]): Specify the index of the first frame
- of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]): Specify the index of the last frame
- of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]): Specify the interval between frames of
- the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]): Specify a file path for the output files.
- Defaults to None, which outputs in the current directory.
Returns: void
-
pybilt.bilayer_analyzer.prefab_analysis_protocols.
spatial_velocity_correlation_functions
(structure_file, trajectory_file, bilayer_selection_string, resnames, name_dict=None, frame_start=0, frame_end=-1, frame_interval=1, dump_path='./')[source]¶ Protocol to compute the 2d spatial velocity correlation functions for lipid types in the bilayer lateral plane.
This function uses the BilayerAnalyzer with the bilayer_anlayzer.analysis_protocols.SpatialVelocityCorrelationFunctionProtocol analysis protocol to compute the 2d spatial velocity correlation functions lipid-lipid interactions in the lateral dimensions of the bilayer and generates their plots. Separate plots are generated for each pair of lipid types (denoted by their resnames) in each leaflet, as well as the composite of all lipids and over both leaflets. The plots are generated and dumped to disk. The output files have the prefix ‘spatial_velocity_corr’.
Parameters: - structure_file (str) – The path and filename of the structure file.
- trajectory_file (str, list) – The path and filename of the trajectory file. Also accepts a list of path/filenames.
- selection_string (str) – The MDAnalysis compatible string used to select the bilayer components.
- resnames (list) – Specify the resnames of the lipid types that are to be included in this analysis.
- frame_start (Optional[int]) – Specify the index of the first frame of the trajectory to include in the analysis. Defaults to 0, which is the first frame of the trajectory.
- frame_end (Optional[int]) – Specify the index of the last frame of the trajectory to include in the analysis. Defaults to -1, which is the last frame of the trajectory.
- frame_interval (Optional[int]) – Specify the interval between frames of the trajectory to include in the analysis, or the frame frequency. Defaults to 1, which includes all frames [frame_start, frame_end].
- dump_path (Optional[str]) – Specify a file path for the output files. Defaults to None, which outputs in the current directory.
Returns: void
pybilt.bilayer_analyzer.vector_frame module¶
-
class
pybilt.bilayer_analyzer.vector_frame.
LipidVec
[source]¶ Bases:
future.types.newobject.newobject
A lipid vector object.
This object stores the coordinates corresponding to a vector representation of a lipid (e.g. the PN vector); the object uses the wrapped coordinates. This object also stores information about the type of lipid as well as the total mass of the lipid.
LipidVec initialization
-
resname
¶ The lipid resname.
Type: str
-
start
¶ The length three vector holding the wrapped xyz coordinates of the vector starting point.
Type: np.array
-
end
¶ The length three vector holding the wrapped xyz coordinates of the vector end point.
Type: np.array
-
vector
¶ The length three vector (i.e end-start).
Type: np.array
-
mass
¶ The total mass of the atoms used to define LipidVec.
Type: float
-
leaflet
¶ The leaflet that the lipid is in can be stored here.
Type: str
-
resid
¶ The integer resid of the lipid.
Type: int
-
extract
(mda_residue, ref_atoms)[source]¶ Get the center of mass coordinates from an MDAnalysis residue
This function calls the MDAnalysis member function center_of_mass() of the residue to compute the center of mass of the atoms constituting the residue.
Parameters: - mda_residue (MDAnalysis.residue) – An MDAnalysis residue object from which to extract (build) a vector representation.
- ref_atoms (dict) – A dictionary storing the references atoms to be used in building the vector representation. The outer keys of ref_atoms should be the resnames of the lipids.
-
-
class
pybilt.bilayer_analyzer.vector_frame.
VectorFrame
(mda_frame, mda_bilayer_selection, ref_atoms)[source]¶ Bases:
future.types.newobject.newobject
A molecular dynamics style Frame object for LipidVec objects.
- Atrributes:
- lipidvec (list of obj:LipidVec): A list of the LipidVec objects assigned to the COMFrame. box (np.array): A 3 element vector containing the (rectangular) xyz box edge lengths. time (float): The simulation time that this Frame represents. number (int): The frame number of this Frame. mdnumber (int): The corresponding frame number in the original MD trajectory
Frame initialization.
Parameters: - mda_frame (MDAnalysis.Timestep) – The MDAnalysis frame for the coordinates to use in computing the lipid centers of mass.
- mda_bilayer_selection (MDAnalysis.AtomSelection) – The MDAnalsysis atom selection object for the containing the atoms in the bilayer.
- unwrap_coords (numpy.Array) – A numpy array containing the the unwrapped coordinates of the bilayer selection atoms.
-
set_box
(box_lengths)[source]¶ Set the rectangular xyz box edge lengths.
Parameters: box_lengths (numpy.array) – A 1d, 3 element numpy.array containing the x,y,z box sizes (or edge lengths)