lipyphilic_biobb package

Submodules

lipyphilic_biobb.lpp_assign_leaflets module

Module containing the Lipyphilic AssignLeaflets class and the command line interface.

class lipyphilic_biobb.lpp_assign_leaflets.LPPAssignLeaflets(input_top_path, input_traj_path, output_leaflets_path, properties=None, **kwargs)[source]

Bases: BiobbObject

biobb_mem LPPAssignLeaflets
Wrapper of the LiPyphilic AssignLeaflets module for assigning lipids to leaflets in a bilayer.
LiPyphilic is a Python package for analyzing MD simulations of lipid bilayers. The parameter names and defaults are the same as the ones in the official Lipyphilic documentation.
Parameters:
  • input_top_path (str) – Path to the input structure or topology file. File type: input. Sample file. Accepted formats: crd (edam:3878), gro (edam:2033), mdcrd (edam:3878), mol2 (edam:3816), pdb (edam:1476), pdbqt (edam:1476), prmtop (edam:3881), psf (edam:3882), top (edam:3881), tpr (edam:2333), xml (edam:2332), xyz (edam:3887).

  • input_traj_path (str) –

    Path to the input trajectory to be processed. File type: input. Sample file. Accepted formats: arc (edam:2333), crd (edam:3878), dcd (edam:3878), ent (edam:1476), gro (edam:2033), inpcrd (edam:3878), mdcrd (edam:3878), mol2 (edam:3816), nc (edam:3650), pdb (edam:1476), pdbqt (edam:1476), restrt (edam:3886), tng (edam:3876), trr (edam:3910), xtc (edam:3875), xyz (edam:3887).

  • output_leaflets_path (str) –

    Path to the output leaflet assignments. File type: output. Sample file. Accepted formats: csv (edam:format_3752), npy (edam:format_4003).

  • properties (dic - Python dictionary object containing the tool parameters, not input/output files) –

    • start (int) - (None) Starting frame for slicing.

    • stop (int) - (None) Ending frame for slicing.

    • steps (int) - (None) Step for slicing.

    • lipid_sel (str) - (“all”) Selection string for the lipids in a membrane. The selection should cover all residues in the membrane, including cholesterol.

    • midplane_sel (str) - (None) Selection string for residues that may be midplane. Any residues not in this selection will be assigned to a leaflet regardless of its proximity to the midplane. The default is None, in which case all lipids will be assigned to either the upper or lower leaflet.

    • midplane_cutoff (float) - (0) Minimum distance in z an atom must be from the midplane to be assigned to a leaflet rather than the midplane. The default is 0, in which case all lipids will be assigned to either the upper or lower leaflet. Must be non-negative.

    • n_bins (int) - (1) Number of bins in x and y to use to create a grid of membrane patches. Local membrane midpoints are computed for each patch, and lipids assigned a leaflet based on the distance to their local membrane midpoint. The default is 1, which is equivalent to computing a single global midpoint.

    • ignore_no_box (bool) - (False) Ignore the absence of box information in the trajectory. If the trajectory does not contain box information, the box will be set to the minimum and maximum positions of the atoms in the trajectory.

    • remove_tmp (bool) - (True) [WF property] Remove temporal files.

    • restart (bool) - (False) [WF property] Do not execute if output files exist.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

Examples

This is a use example of how to use the building block from Python:

from biobb_mem.lipyphilic_biobb.lpp_assign_leaflets import lpp_assign_leaflets
prop = {
    'lipid_sel': 'name GL1 GL2 ROH',
}
lpp_assign_leaflets(input_top_path='/path/to/myTopology.tpr',
                    input_traj_path='/path/to/myTrajectory.xtc',
                    output_leaflets_path='/path/to/leaflets.csv',
                    properties=prop)
Info:
launch() int[source]

Execute the LPPAssignLeaflets lipyphilic_biobb.lpp_assign_leaflets.LPPAssignLeaflets object.

lipyphilic_biobb.lpp_assign_leaflets.display_nglview(input_top_path: str, output_leaflets_path: str, frame: int = 0)[source]

Visualize the leaflets of a membrane using NGLView.

Parameters:
  • input_top_path (str) – Path to the input topology file.

  • output_leaflets_path (str) – Path to the CSV file containing leaflet assignments.

  • frame (int, optional) – Frame number to visualize. Default is 0.

Returns:

An NGLView widget displaying the membrane leaflets.

Return type:

nglview.NGLWidget

lipyphilic_biobb.lpp_assign_leaflets.lpp_assign_leaflets(input_top_path: str, input_traj_path: str, output_leaflets_path: str | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_mem LPPAssignLeaflets
Wrapper of the LiPyphilic AssignLeaflets module for assigning lipids to leaflets in a bilayer.
LiPyphilic is a Python package for analyzing MD simulations of lipid bilayers. The parameter names and defaults are the same as the ones in the official Lipyphilic documentation.
Parameters:
  • input_top_path (str) –

    Path to the input structure or topology file. File type: input. Sample file. Accepted formats: crd (edam:3878), gro (edam:2033), mdcrd (edam:3878), mol2 (edam:3816), pdb (edam:1476), pdbqt (edam:1476), prmtop (edam:3881), psf (edam:3882), top (edam:3881), tpr (edam:2333), xml (edam:2332), xyz (edam:3887).

  • input_traj_path (str) –

    Path to the input trajectory to be processed. File type: input. Sample file. Accepted formats: arc (edam:2333), crd (edam:3878), dcd (edam:3878), ent (edam:1476), gro (edam:2033), inpcrd (edam:3878), mdcrd (edam:3878), mol2 (edam:3816), nc (edam:3650), pdb (edam:1476), pdbqt (edam:1476), restrt (edam:3886), tng (edam:3876), trr (edam:3910), xtc (edam:3875), xyz (edam:3887).

  • output_leaflets_path (str) –

    Path to the output leaflet assignments. File type: output. Sample file. Accepted formats: csv (edam:format_3752), npy (edam:format_4003).

  • properties (dic - Python dictionary object containing the tool parameters, not input/output files) –

    • start (int) - (None) Starting frame for slicing.

    • stop (int) - (None) Ending frame for slicing.

    • steps (int) - (None) Step for slicing.

    • lipid_sel (str) - (“all”) Selection string for the lipids in a membrane. The selection should cover all residues in the membrane, including cholesterol.

    • midplane_sel (str) - (None) Selection string for residues that may be midplane. Any residues not in this selection will be assigned to a leaflet regardless of its proximity to the midplane. The default is None, in which case all lipids will be assigned to either the upper or lower leaflet.

    • midplane_cutoff (float) - (0) Minimum distance in z an atom must be from the midplane to be assigned to a leaflet rather than the midplane. The default is 0, in which case all lipids will be assigned to either the upper or lower leaflet. Must be non-negative.

    • n_bins (int) - (1) Number of bins in x and y to use to create a grid of membrane patches. Local membrane midpoints are computed for each patch, and lipids assigned a leaflet based on the distance to their local membrane midpoint. The default is 1, which is equivalent to computing a single global midpoint.

    • ignore_no_box (bool) - (False) Ignore the absence of box information in the trajectory. If the trajectory does not contain box information, the box will be set to the minimum and maximum positions of the atoms in the trajectory.

    • remove_tmp (bool) - (True) [WF property] Remove temporal files.

    • restart (bool) - (False) [WF property] Do not execute if output files exist.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

Examples

This is a use example of how to use the building block from Python:

from biobb_mem.lipyphilic_biobb.lpp_assign_leaflets import lpp_assign_leaflets
prop = {
    'lipid_sel': 'name GL1 GL2 ROH',
}
lpp_assign_leaflets(input_top_path='/path/to/myTopology.tpr',
                    input_traj_path='/path/to/myTrajectory.xtc',
                    output_leaflets_path='/path/to/leaflets.csv',
                    properties=prop)
Info:

lipyphilic_biobb.flip_flop module

lipyphilic_biobb.lpp_zpositions module

Module containing the Lipyphilic ZPositions class and the command line interface.

class lipyphilic_biobb.lpp_zpositions.LPPZPositions(input_top_path, input_traj_path, output_positions_path, properties=None, **kwargs)[source]

Bases: BiobbObject

biobb_mem LPPZPositions
Wrapper of the LiPyphilic ZPositions module for calculating the z distance of lipids to the bilayer center.
LiPyphilic is a Python package for analyzing MD simulations of lipid bilayers. The parameter names and defaults are the same as the ones in the official Lipyphilic documentation.
Parameters:
  • input_top_path (str) –

    Path to the input structure or topology file. File type: input. Sample file. Accepted formats: crd (edam:3878), gro (edam:2033), mdcrd (edam:3878), mol2 (edam:3816), pdb (edam:1476), pdbqt (edam:1476), prmtop (edam:3881), psf (edam:3882), top (edam:3881), tpr (edam:2333), xml (edam:2332), xyz (edam:3887).

  • input_traj_path (str) –

    Path to the input trajectory to be processed. File type: input. Sample file. Accepted formats: arc (edam:2333), crd (edam:3878), dcd (edam:3878), ent (edam:1476), gro (edam:2033), inpcrd (edam:3878), mdcrd (edam:3878), mol2 (edam:3816), nc (edam:3650), pdb (edam:1476), pdbqt (edam:1476), restrt (edam:3886), tng (edam:3876), trr (edam:3910), xtc (edam:3875), xyz (edam:3887).

  • output_positions_path (str) –

    Path to the output z positions. File type: output. Sample file. Accepted formats: csv (edam:format_3752).

  • properties (dic - Python dictionary object containing the tool parameters, not input/output files) –

    • start (int) - (None) Starting frame for slicing.

    • stop (int) - (None) Ending frame for slicing.

    • steps (int) - (None) Step for slicing.

    • lipid_sel (str) - (“all”) Selection string for the lipids in a membrane. The selection should cover all residues in the membrane, including cholesterol.

    • height_sel (str) - (“all”) Atom selection for the molecules for which the z position will be calculated.

    • n_bins (int) - (1) Number of bins in x and y to use to create a grid of membrane patches. Local membrane midpoints are computed for each patch, and lipids assigned a leaflet based on the distance to their local membrane midpoint. The default is 1, which is equivalent to computing a single global midpoint.

    • ignore_no_box (bool) - (False) Ignore the absence of box information in the trajectory. If the trajectory does not contain box information, the box will be set to the minimum and maximum positions of the atoms in the trajectory.

    • remove_tmp (bool) - (True) [WF property] Remove temporal files.

    • restart (bool) - (False) [WF property] Do not execute if output files exist.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

Examples

This is a use example of how to use the building block from Python:

from biobb_mem.lipyphilic_biobb.lpp_zpositions import lpp_zpositions
prop = {
    'lipid_sel': 'name GL1 GL2 ROH',
}
lpp_zpositions(input_top_path='/path/to/myTopology.tpr',
                    input_traj_path='/path/to/myTrajectory.xtc',
                    output_positions_path='/path/to/zpositions.csv.csv',
                    properties=prop)
Info:
launch() int[source]

Execute the LPPZPositions lipyphilic_biobb.lpp_zpositions.LPPZPositions object.

lipyphilic_biobb.lpp_zpositions.frame_df(output_positions_path)[source]

Processes a CSV file containing z-position data and calculates the mean positive, mean negative, thickness, and standard deviation of thickness for each frame.

Parameters:

output_positions_path (str) – Path to the CSV file containing z-position data.

Returns:

A DataFrame with the following columns:
  • mean_positive: Mean of positive z-positions for each frame.

  • mean_negative: Mean of negative z-positions for each frame.

  • thickness: Difference between mean_positive and mean_negative for each frame.

  • std_thickness: Standard deviation of the absolute z-positions for each frame.

Return type:

pandas.DataFrame

lipyphilic_biobb.lpp_zpositions.lpp_zpositions(input_top_path: str, input_traj_path: str, output_positions_path: str | None = None, properties: dict | None = None, **kwargs) int[source]

Execute the LPPZPositions class and execute the launch() method.

lipyphilic_biobb.lpp_zpositions.main()[source]

Command line execution of this building block. Please check the command line documentation.