Skip to content

Plane-Plane

lahuta.contacts.PlanePlaneContacts

Handle the computation of plane-plane contacts in a molecular system.

This class provides both class and function-level APIs to compute plane-plane contacts between two ring-containing residues or ligands. Each interaction is labeled according to the relative orientations of the planes.

Definitions

FF (Face-Face): Represents two planes interacting in a face-to-face orientation, where their flat surfaces are parallel and directly aligned. This typically leads to maximum pi-pi stacking.

OF (Oblique Face): Denotes a skewed face-to-face orientation. One plane is tilted relative to the other, resulting in partial overlap of their surfaces.

EE (Edge-Edge): Describes an interaction where the edges of two planes align parallel, but their surfaces do not overlap, limiting pi-pi interactions.

FT (Face-T-stack): Indicates an interaction where the face of one plane (the base of the 'T') aligns with the edge of another plane (the stem of the 'T'). The second plane is oriented in a T-stacked manner.

OT (Oblique-T-stack): Represents an interaction where an obliquely oriented face of one plane (the skewed base of the 'T') aligns with the edge of another plane (the stem of the 'T'). The second plane is in a T-stacked orientation.

ET (Edge-T-stack): Describes an interaction where the edge of one plane aligns with the edge of another plane. Both are part of the stem in a T-stacked orientation.

FE (Face-Edge): Depicts an interaction where the flat surface (face) of one plane aligns with the edge of another plane, leading to partial pi-pi interactions.

OE (Oblique-Edge): Represents an interaction where an obliquely oriented face of one plane aligns with the edge of another plane, leading to partial and skewed pi-pi interactions.

EF (Edge-Face): Indicates an interaction where the edge of one plane aligns with the face of another plane, creating limited pi-pi interactions.

Parameters:

Name Type Description Default
ns NeighborPairs

A NeighborPairs object containing the atom neighbor relationships in the system.

required

Attributes:

Name Type Description
centroid_distance float

The maximum distance to consider for the centroid of a plane-plane contact. See lahuta.config.defaults.CONTACTS for default values.

results NeighborPairs

NeighborPairs containing the pairs of atoms found to be forming plane-plane contacts.

Example
luni = Luni(...)
ns = luni.compute_neighbors()

plane_plane = PlanePlaneContacts(ns)
result = plane_plane.results
Source code in lahuta/contacts/plane_plane.py
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
class PlanePlaneContacts:
    """Handle the computation of plane-plane contacts in a molecular system.

    This class provides both class and function-level APIs to compute plane-plane contacts
    between two ring-containing residues or ligands. Each interaction is labeled according
    to the relative orientations of the planes.

    !!! tip "Definitions"
        **FF** _(Face-Face)_: Represents two planes interacting in a face-to-face orientation, where
            their flat surfaces are parallel and directly aligned. This typically leads to
            maximum pi-pi stacking.

        **OF** _(Oblique Face)_: Denotes a skewed face-to-face orientation. One plane is tilted
            relative to the other, resulting in partial overlap of their surfaces.

        **EE** _(Edge-Edge)_: Describes an interaction where the edges of two planes align parallel,
            but their surfaces do not overlap, limiting pi-pi interactions.

        **FT** _(Face-T-stack)_: Indicates an interaction where the face of one plane (the base of the 'T')
            aligns with the edge of another plane (the stem of the 'T'). The second plane is
            oriented in a T-stacked manner.

        **OT** _(Oblique-T-stack)_: Represents an interaction where an obliquely oriented face of one
            plane (the skewed base of the 'T') aligns with the edge of another plane (the stem of
            the 'T'). The second plane is in a T-stacked orientation.

        **ET** _(Edge-T-stack)_: Describes an interaction where the edge of one plane aligns with the
            edge of another plane. Both are part of the stem in a T-stacked orientation.

        **FE** _(Face-Edge)_: Depicts an interaction where the flat surface (face) of one plane aligns
            with the edge of another plane, leading to partial pi-pi interactions.

        **OE** _(Oblique-Edge)_: Represents an interaction where an obliquely oriented face of one plane
            aligns with the edge of another plane, leading to partial and skewed pi-pi interactions.

        **EF** _(Edge-Face)_: Indicates an interaction where the edge of one plane aligns with the face of
            another plane, creating limited pi-pi interactions.

    Args:
        ns (NeighborPairs): A NeighborPairs object containing the atom neighbor relationships in the system.

    Attributes:
        centroid_distance (float): The maximum distance to consider for the centroid of a plane-plane contact.
            See `lahuta.config.defaults.CONTACTS` for default values.
        results (NeighborPairs): NeighborPairs containing the pairs of atoms found to be forming plane-plane contacts.

    ??? example "Example"
        ``` py
        luni = Luni(...)
        ns = luni.compute_neighbors()

        plane_plane = PlanePlaneContacts(ns)
        result = plane_plane.results
        ```
    """

    centroid_distance = CONTACTS["aromatic"]["centroid_distance"]

    def __init__(self, ns: NeighborPairs) -> None:
        self.ns = ns
        self.results = self.compute()

    def compute(self) -> NeighborPairs:
        """Compute plane-plane contacts based on the neighbor pairs and the set centroid distance.

        This method initializes a `_PlanePlaneContacts` object with the neighbor pairs object (`ns`),
        sets its `centroid_distance` to match the class's `centroid_distance`, calls its `compute`
        method, and finally calls its `get_neighbors` method to obtain the plane-plane contacts.

        Returns
        -------
        NeighborPairs
            The object containing the pairs of atoms that are considered as plane-plane contacts
            based on the set centroid_distance criteria.
        """
        pp = _PlanePlaneContacts(self.ns)
        pp.centroid_distance = self.centroid_distance
        pp.compute()

        return pp.get_neighbors()