LeafletFinder
Classes
- class lipyds.leafletfinder.leafletfinder.LeafletFinder(universe: AtomGroup | Universe, select: str | None = 'all', select_tailgroups: str | None = None, cutoff: float = 15, pbc: bool = True, method: str = 'graph', n_leaflets: int = 2, normal_axis: str = 'z', update_TopologyAttr: bool = False, **kwargs)[source]
Identify atoms in the same leaflet of a lipid bilayer.
You can use a predefined method (“graph”, “spectralclustering”). Alternatively, you can pass in your own function as a method.
- Parameters:
universe (Universe or AtomGroup) – Atoms to apply the algorithm to
select (str) – A
Universe.select_atoms()selection string for atoms that define the lipid head groups, e.g. universe.atoms.PO4 or “name PO4” or “name P*”cutoff (float (optional)) – cutoff distance for computing distances (for the spectral clustering method) or determining connectivity in the same leaflet (for the graph method). In spectral clustering, it just has to be suitably large to cover a significant part of the leaflet, but lower values increase computational efficiency. Please see the
optimize_cutoff()function for help with values for the graph method. A cutoff is not used for the “center_of_geometry” method.pbc (bool (optional)) – If
False, does not follow the minimum image convention when computing distancesmethod (str or function (optional)) – method to use to assign groups to leaflets. Choose “graph” for
GraphMethod; “spectralclustering” forSpectralClusteringMethod;**kwargs – Passed to
method
- Variables:
universe (Universe)
select (str) – Selection string
selection (AtomGroup) – Atoms that the analysis is applied to
residues (ResidueGroup) – residues that the analysis is applied to
headgroups (List of AtomGroup) – Atoms that the analysis is applied to, grouped by residue.
pbc (bool) – Whether to use PBC or not
leaflet_indices_by_size (list of list of indices) – List of residue indices in each leaflet. This is the index of residues in
residues, not the canonicalresindexattribute from MDAnalysis. Leaflets are sorted by size such that the largest leaflet is first.leaflet_residues_by_size (list of ResidueGroup) – List of ResidueGroups in each leaflet. Leaflets are sorted by size such that the largest leaflet is first.
leaflet_atoms_by_size (list of AtomGroup) – List of AtomGroups in each leaflet. Leaflets are sorted by size such that the largest leaflet is first.
leaflet_indices (list of list of indices) – List of residue indices in each leaflet. This is the index of residues in
residues, not the canonicalresindexattribute from MDAnalysis.leaflet_residues (list of ResidueGroup) – List of ResidueGroups in each leaflet. The leaflets are sorted by z-coordinate so that the lower-most leaflet is first.
leaflet_atoms (list of AtomGroup) – List of AtomGroups in each leaflet. The leaflets are sorted by z-coordinate so that the lower-most leaflet is first.
- classmethod optimize_cutoff(universe, dmin: float = 10.0, dmax: float = 20.0, step: float = 0.5, max_imbalance: float = 0.2, n_leaflets: int = 2, **kwargs) float[source]
Find cutoff that minimizes number of disconnected groups.
Applies heuristics to find best groups:
at least two groups (assumes that there are at least 2 leaflets)
reject any solutions for which:
\[\]rac{|N_0 - N_1|}{|N_0 + N_1|} > mathrm{max_imbalance}
with \(N_i\) being the number of lipids in group \(i\). This heuristic picks groups with balanced numbers of lipids.
- universe: Universe or AtomGroup
Atoms to apply the algorithm to
- dmin: float, optional
Minimum cutoff distance
- dmax: float, optional
Maximum cutoff distance
- step: float, optional
Step size for searching cutoff distances
- max_imbalance: float, optional
Maximum imbalance between groups allowed
- n_leaflets: int, optional
Number of leaflets to find
- **kwargs:
Passed to
LeafletFinder
- write_selection(filename, mode='w', format=None, **kwargs)[source]
Write selections for the leaflets to filename.
The format is typically determined by the extension of filename (e.g. “vmd”, “pml”, or “ndx” for VMD, PyMol, or Gromacs).
See
MDAnalysis.selections.base.SelectionWriterfor all options.