pylipid.api.LipidInteraction.compute_residue_duration

LipidInteraction.compute_residue_duration(residue_id=None)[source]

Calculate lipid contact durations for residues

PyLipID calculates lipid contacts using a dual-cutoff scheme. In this scheme, a continuous contact starts when a molecule moves closer than the lower distance cutoff and ends when the molecule moves out of the upper cutoff. The duration between these two time points is the duration of the contact.

PyLipID implements this dual-cutoff tactic by creating a lipid index for the lower and upper cutoff respectively, which records the lipid molecules within that distance cutoff at each trajectory frame for residues. Such lipid indices are created by the method collect_residue_contacts(), and are stored in the private class variables of _contact_residue_high and _contact_residue_low for each of the cutoffs.

For calculation of contact durations, a lipid molecule that appears in the lipid index of the lower cutoff is searched in the subsequent frames of the upper lipid index for that residue and the search then stops if this molecule disappears from the upper cutoff index. This lipid molecule is labeled as ‘checked’ in the searched frames in both lipid indices, and the duration of this contact is calculated from the number of frames in which this lipid molecule appears in the lipid indices. This calculation iterates until all lipid molecules in the lower lipid index are labeled as ‘checked’.

This function returns a list of contact durations or lists of contact durations if multiple residue IDs are provided.

Parameters

residue_id (int or list of int, default=None) – The residue ID, or residue index, that is used by PyLipID for identifying residues. The ID starts from 0, i.e. the ID of N-th residue is (N-1). If None, all residues are selected.

Returns

durations – A list of contact durations or lists of contact durations if multiple residue IDs are provided.

Return type

list

See also

pylipid.api.LipidInteraction.collect_residue_contacts

Create the lipid index.

pylipid.api.LipidInteraction.compute_site_duration

Calculate durations of contacts with binding sites.

pylipid.func.Duration

Calculate contact durations from lipid index.