### Navigation

- index
- modules |
- next |
- previous |
- MDAnalysis 0.7.7 documentation »
- 3. Analysis modules »

# 3.9. Leaflet identification — `MDAnalysis.analysis.leaflet`

Author: | Oliver Beckstein
Year: | 2010
Copyright: | GNU Public License v3

Algorithm:
  1. build a graph of all phosphate distances < cutoff
  2. identify the largest connected subgraphs
  3. analyse first and second largest graph, which correspond to the leaflets

One can use this information to identify

- the upper and lower leaflet of a planar membrane by comparing the the `centerOfGeometry()` of the leaflet groups, or
- the outer and inner leaflet of a vesicle by comparing histograms of distances from the centre of geometry (or possibly simply the `radiusOfGyration()`).

See example scripts in the `examples/` directory on how to use `LeafletFinder`. The function `optimize_cutoff()` implements a (slow) heuristic method to find the best cut off for the LeafletFinder algorithm.

class `MDAnalysis.analysis.leaflet.``LeafletFinder`(universe, selectionstring, cutoff=15.0, pbc=False)

  Identify atoms in the same leaflet of a lipid bilayer.

  The components of the graph are stored in the list `LeafletFinder.components`; the atoms in each component are numbered consecutively, starting at 0. To obtain the atoms in the input structure use `LeafletFinder.groups()`:

      L = LeafletFinder(PDB, 'name P*')
      leaflet0 = L.groups(0)
      leaflet1 = L.groups(1)

  The residues can be accessed through the standard MDAnalysis mechanism:

      leaflet0.residues

  provides a `ResidueGroup` instance. Similarly, all atoms in the first leaflet are then

      leaflet0.residues.atoms

  Initialize from a universe or pdb file.

  Arguments : | universe `MDAnalysis.Universe` or a PDB file name. selectionstring `MDAnalysis.Universe.selectAtoms()` selection for atoms that define the lipid head groups, e.g. “name PO4” or “name P*”
  Keywords : | cutoff head group-defining atoms within a distance of cutoff Angstroms are deemed to be in the same leaflet [15.0] pbc take periodic boundary conditions into account (only works for orthorhombic boxes) [`False`]

  `group`(component_index)

    Return a `MDAnalysis.core.AtomGroup.AtomGroup` for component_index.

  `groups`(component_index=None)

    Return a `MDAnalysis.core.AtomGroup.AtomGroup` for component_index.

    If no argument is supplied, then a list of all leaflet groups is returned.

    See also

    `LeafletFinder.group()` and `LeafletFinder.groups_iter()`

  `groups_iter`()

    Iterator over all leaflet `groups()`

  `sizes`()

    Dict of component index with size of component.

  `update`(cutoff=None)

    Update components, possibly with a different cutoff

  `write_selection`(filename, **kwargs)

    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.SelectionWriter` for all options.

`MDAnalysis.analysis.leaflet.``optimize_cutoff`(universe, selection, dmin=10.0, dmax=20.0, step=0.5, max_imbalance=0.2, **kwargs)

  Find cutoff that minimizes number of disconnected groups.

  Applies heuristics to find best groups:

  1. at least two groups (assumes that there are at least 2 leaflets)

  2. reject any solutions for which:

     > |N0 - N1|/|N0 + N1| > *max_imbalance*

     Ni = number of lipids in group i. This heuristic picks groups with balanced numbers of lipids.

  Arguments : | universe `MDAnalysis.Universe` instance selection selection string as used for `LeafletFinder` dmin, dmax, step scan cutoffs from dmin to dmax at stepsize*step (in Angstroms) max_imbalance tuning parameter for the balancing heuristic (2) [0.2] kwargs other arguments for `LeafletFinder`
  Returns : | `(cutoff,N)` optimum cutoff and number of groups found
  Raises : | can die in various ways if really no appropriate number of groups can be found; needs to be made more robust

### Navigation

- index
- modules |
- next |
- previous |
- MDAnalysis 0.7.7 documentation »
- 3. Analysis modules »