Skip to content

Atom-Plane

lahuta.contacts.AtomPlaneContacts

Calculate and handles special atomic contacts within a molecular system, including carbon-pi, cation-pi, donor-pi, and sulphur-pi interactions. Each interaction type is computed as a method of this class.

Aromatic rings and their interactions play a pivotal role in this analysis.

Definition

  1. The interaction is between an aromatic ring and a specific type of atom or group.
  2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring and the specific atom or group is within a predefined cutoff (where applicable).
  3. The distance between the atom or group and the aromatic ring system does not exceed a predefined distance cutoff.

The computation is based on the neighbors and angles calculated within the molecular system.

Attributes:

Name Type Description
max_cutoff float

The predefined maximum distance cutoff for atom-aromatic ring interactions.

angles Optional[NDArray[float32]]

Calculated angles between ring plane and atom vector.

rings Rings

Enumeration of rings in the molecular system.

ap_contacts _AtomPlaneContacts

Instance of _AtomPlaneContacts class.

neighbors NeighborPairs

The object encapsulating pairs of neighboring atoms in the system.

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

apc = AtomPlaneContacts(ns)
dop = apc.donor_pi()    # for donor-pi contacts
sup = apc.sulphur_pi()  # for sulphur-pi contacts
cbp = apc.carbon_pi()   # for carbon-pi contacts
cap = apc.cation_pi()   # for cation-pi contacts
Source code in lahuta/contacts/atom_plane.py
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
class AtomPlaneContacts:
    """Calculate and handles special atomic contacts within a molecular system, including
    carbon-pi, cation-pi, donor-pi, and sulphur-pi interactions. Each interaction type is computed
    as a method of this class.

    Aromatic rings and their interactions play a pivotal role in this analysis.

    !!! tip "Definition"
        1. The interaction is between an aromatic ring and a specific type of atom or group.
        2. The angle between the aromatic ring plane and the vector connecting the center of the
           aromatic ring and the specific atom or group is within a predefined cutoff (where applicable).
        3. The distance between the atom or group and the aromatic ring system does not exceed a
           predefined distance cutoff.

    The computation is based on the neighbors and angles calculated within the molecular system.

    Attributes:
        max_cutoff (float): The predefined maximum distance cutoff for atom-aromatic ring interactions.
        angles (Optional[NDArray[np.float32]]): Calculated angles between ring plane and atom vector.
        rings (Rings): Enumeration of rings in the molecular system.
        ap_contacts (_AtomPlaneContacts): Instance of `_AtomPlaneContacts` class.
        neighbors (NeighborPairs): The object encapsulating pairs of neighboring atoms in the system.

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

        apc = AtomPlaneContacts(ns)
        dop = apc.donor_pi()    # for donor-pi contacts
        sup = apc.sulphur_pi()  # for sulphur-pi contacts
        cbp = apc.carbon_pi()   # for carbon-pi contacts
        cap = apc.cation_pi()   # for cation-pi contacts
        ```
    """

    max_cutoff = CONTACTS["aromatic"]["met_sulphur_aromatic_distance"]

    def __init__(self, ns: NeighborPairs):
        self.angles: Optional[NDArray[np.float32]] = None
        self.rings = enumerate_rings(ns.mol)
        self.ap_contacts = _AtomPlaneContacts()

        self._compute(ns, ns.mda)

    def _compute(self, ns: NeighborPairs, mda: AtomGroupType) -> None:
        pairs, distances = compute_neighbors(mda.atoms.positions, self.rings.centers)

        neighbors = ns.clone(pairs, distances)

        self.neighbors = neighbors - neighbors.type_filter("aromatic", partner=2)

        result = calc_ringnormal_pos_angle(self.neighbors, mda.universe.atoms, self.rings.centers, self.rings.normals)
        self.angles = result

    def donor_pi(self) -> NeighborPairs:
        """Handle the computation of donor pi contacts in a molecular system.

        Donor pi contacts are interactions between electron donors and the π system of atoms in a molecule.
        This class, a derivative of the `ContactAnalysis` base class, overrides the `compute`
        method to provide functionality specifically for donor pi contact computation.

        Donor-pi contacts represent interactions between a hydrogen bond donor and an aromatic ring system.
        The electron-rich  aromatic ring can interact with the partial positive charge of a hydrogen atom
        that is involved in a polar bond, creating a stabilizing interaction.

        !!! tip "Definition"
            1. The interaction is between an aromatic ring and a hydrogen bond donor.
            2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring
            and the hydrogen bond donor is within a predefined cutoff.
            3. The distance between the hydrogen bond donor and the aromatic ring system
                does not exceed a specified distance cutoff.

        Returns:
            NeighborPairs: The computed donor-pi contacts.

        """
        assert self.angles is not None
        return self.ap_contacts.donor_pi(self.neighbors, self.angles)

    def sulphur_pi(self) -> NeighborPairs:
        """Handle the computation of sulphur pi contacts in a molecular system.

        Sulphur pi contacts are interactions involving the π system of sulphur atoms in a molecule.
        This class, a derivative of the `ContactAnalysis` base class, overrides the `compute`
        method to provide functionality specifically for sulphur pi contact computation.

        Sulphur-pi interactions involve the interaction between an aromatic ring and a sulphur atom.
        Sulphur, particularly from methionine residues (MET), can interact with the electron cloud of an aromatic ring,
        contributing to the stability and specificity of biomolecular structures.

        !!! tip "Definition"
            1. The interaction is between an aromatic ring and a sulphur atom specifically in a methionine residue.
            2. The distance between the sulphur atom and the aromatic ring system
            does not exceed a predefined distance cutoff.

        Returns:
            NeighborPairs: The computed sulphur-pi contacts.

        """
        assert self.angles is not None
        return self.ap_contacts.sulphur_pi(self.neighbors, self.angles)

    def carbon_pi(self) -> NeighborPairs:
        """Handle the computation of carbon pi contacts in a molecular system.

        Carbon pi contacts are interactions involving the π system of carbon atoms in a molecule.
        This class, a derivative of the `ContactAnalysis` base class, overrides the `compute`
        method to provide functionality specifically for carbon pi contact computation.

        Carbon-pi contacts represent interactions between a carbon atom and an aromatic ring system.
        These contacts arise due to the partial positive charge on the carbon atom interacting with the electron-rich
        π-system of the aromatic ring.

        !!! tip "Definition"
            1. The interaction is between an aromatic ring and a carbon atom which is a weak hydrogen bond donor.
            2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring
            and the carbon atom is within a specified cutoff.
            3. The distance between the carbon atom and the aromatic ring system does not
            exceed a predefined distance cutoff.

        Returns:
            NeighborPairs: The computed carbon-pi contacts.

        """
        assert self.angles is not None
        return self.ap_contacts.carbon_pi(self.neighbors, self.angles)

    def cation_pi(self) -> NeighborPairs:
        """Handle the computation of cation pi contacts in a molecular system.

        Cation pi contacts are interactions between cations and the π system of atoms in a molecule.
        This class, a derivative of the `ContactAnalysis` base class, overrides the `compute`
        method to provide functionality specifically for cation pi contact computation.

        Cation-pi contacts involve interactions between a cation (a positively charged ion)
        and an electron-rich aromatic ring system. The aromatic system is capable of stabilizing the cation
        through its delocalized pi electrons.

        !!! tip "Definition"
            1. The interaction is between an aromatic ring and a positively ionizable atom.
            2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring
            and the cation is within a defined cutoff.
            3. The distance between the cation and the aromatic ring system does not
            exceed a predefined distance cutoff.

        Returns:
            NeighborPairs: The computed cation-pi contacts.

        """
        assert self.angles is not None
        return self.ap_contacts.cation_pi(self.neighbors, self.angles)

donor_pi

donor_pi()

Handle the computation of donor pi contacts in a molecular system.

Donor pi contacts are interactions between electron donors and the π system of atoms in a molecule. This class, a derivative of the ContactAnalysis base class, overrides the compute method to provide functionality specifically for donor pi contact computation.

Donor-pi contacts represent interactions between a hydrogen bond donor and an aromatic ring system. The electron-rich aromatic ring can interact with the partial positive charge of a hydrogen atom that is involved in a polar bond, creating a stabilizing interaction.

Definition

  1. The interaction is between an aromatic ring and a hydrogen bond donor.
  2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring and the hydrogen bond donor is within a predefined cutoff.
  3. The distance between the hydrogen bond donor and the aromatic ring system does not exceed a specified distance cutoff.

Returns:

Name Type Description
NeighborPairs NeighborPairs

The computed donor-pi contacts.

Source code in lahuta/contacts/atom_plane.py
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
def donor_pi(self) -> NeighborPairs:
    """Handle the computation of donor pi contacts in a molecular system.

    Donor pi contacts are interactions between electron donors and the π system of atoms in a molecule.
    This class, a derivative of the `ContactAnalysis` base class, overrides the `compute`
    method to provide functionality specifically for donor pi contact computation.

    Donor-pi contacts represent interactions between a hydrogen bond donor and an aromatic ring system.
    The electron-rich  aromatic ring can interact with the partial positive charge of a hydrogen atom
    that is involved in a polar bond, creating a stabilizing interaction.

    !!! tip "Definition"
        1. The interaction is between an aromatic ring and a hydrogen bond donor.
        2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring
        and the hydrogen bond donor is within a predefined cutoff.
        3. The distance between the hydrogen bond donor and the aromatic ring system
            does not exceed a specified distance cutoff.

    Returns:
        NeighborPairs: The computed donor-pi contacts.

    """
    assert self.angles is not None
    return self.ap_contacts.donor_pi(self.neighbors, self.angles)

sulphur_pi

sulphur_pi()

Handle the computation of sulphur pi contacts in a molecular system.

Sulphur pi contacts are interactions involving the π system of sulphur atoms in a molecule. This class, a derivative of the ContactAnalysis base class, overrides the compute method to provide functionality specifically for sulphur pi contact computation.

Sulphur-pi interactions involve the interaction between an aromatic ring and a sulphur atom. Sulphur, particularly from methionine residues (MET), can interact with the electron cloud of an aromatic ring, contributing to the stability and specificity of biomolecular structures.

Definition

  1. The interaction is between an aromatic ring and a sulphur atom specifically in a methionine residue.
  2. The distance between the sulphur atom and the aromatic ring system does not exceed a predefined distance cutoff.

Returns:

Name Type Description
NeighborPairs NeighborPairs

The computed sulphur-pi contacts.

Source code in lahuta/contacts/atom_plane.py
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
def sulphur_pi(self) -> NeighborPairs:
    """Handle the computation of sulphur pi contacts in a molecular system.

    Sulphur pi contacts are interactions involving the π system of sulphur atoms in a molecule.
    This class, a derivative of the `ContactAnalysis` base class, overrides the `compute`
    method to provide functionality specifically for sulphur pi contact computation.

    Sulphur-pi interactions involve the interaction between an aromatic ring and a sulphur atom.
    Sulphur, particularly from methionine residues (MET), can interact with the electron cloud of an aromatic ring,
    contributing to the stability and specificity of biomolecular structures.

    !!! tip "Definition"
        1. The interaction is between an aromatic ring and a sulphur atom specifically in a methionine residue.
        2. The distance between the sulphur atom and the aromatic ring system
        does not exceed a predefined distance cutoff.

    Returns:
        NeighborPairs: The computed sulphur-pi contacts.

    """
    assert self.angles is not None
    return self.ap_contacts.sulphur_pi(self.neighbors, self.angles)

carbon_pi

carbon_pi()

Handle the computation of carbon pi contacts in a molecular system.

Carbon pi contacts are interactions involving the π system of carbon atoms in a molecule. This class, a derivative of the ContactAnalysis base class, overrides the compute method to provide functionality specifically for carbon pi contact computation.

Carbon-pi contacts represent interactions between a carbon atom and an aromatic ring system. These contacts arise due to the partial positive charge on the carbon atom interacting with the electron-rich π-system of the aromatic ring.

Definition

  1. The interaction is between an aromatic ring and a carbon atom which is a weak hydrogen bond donor.
  2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring and the carbon atom is within a specified cutoff.
  3. The distance between the carbon atom and the aromatic ring system does not exceed a predefined distance cutoff.

Returns:

Name Type Description
NeighborPairs NeighborPairs

The computed carbon-pi contacts.

Source code in lahuta/contacts/atom_plane.py
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
def carbon_pi(self) -> NeighborPairs:
    """Handle the computation of carbon pi contacts in a molecular system.

    Carbon pi contacts are interactions involving the π system of carbon atoms in a molecule.
    This class, a derivative of the `ContactAnalysis` base class, overrides the `compute`
    method to provide functionality specifically for carbon pi contact computation.

    Carbon-pi contacts represent interactions between a carbon atom and an aromatic ring system.
    These contacts arise due to the partial positive charge on the carbon atom interacting with the electron-rich
    π-system of the aromatic ring.

    !!! tip "Definition"
        1. The interaction is between an aromatic ring and a carbon atom which is a weak hydrogen bond donor.
        2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring
        and the carbon atom is within a specified cutoff.
        3. The distance between the carbon atom and the aromatic ring system does not
        exceed a predefined distance cutoff.

    Returns:
        NeighborPairs: The computed carbon-pi contacts.

    """
    assert self.angles is not None
    return self.ap_contacts.carbon_pi(self.neighbors, self.angles)

cation_pi

cation_pi()

Handle the computation of cation pi contacts in a molecular system.

Cation pi contacts are interactions between cations and the π system of atoms in a molecule. This class, a derivative of the ContactAnalysis base class, overrides the compute method to provide functionality specifically for cation pi contact computation.

Cation-pi contacts involve interactions between a cation (a positively charged ion) and an electron-rich aromatic ring system. The aromatic system is capable of stabilizing the cation through its delocalized pi electrons.

Definition

  1. The interaction is between an aromatic ring and a positively ionizable atom.
  2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring and the cation is within a defined cutoff.
  3. The distance between the cation and the aromatic ring system does not exceed a predefined distance cutoff.

Returns:

Name Type Description
NeighborPairs NeighborPairs

The computed cation-pi contacts.

Source code in lahuta/contacts/atom_plane.py
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
def cation_pi(self) -> NeighborPairs:
    """Handle the computation of cation pi contacts in a molecular system.

    Cation pi contacts are interactions between cations and the π system of atoms in a molecule.
    This class, a derivative of the `ContactAnalysis` base class, overrides the `compute`
    method to provide functionality specifically for cation pi contact computation.

    Cation-pi contacts involve interactions between a cation (a positively charged ion)
    and an electron-rich aromatic ring system. The aromatic system is capable of stabilizing the cation
    through its delocalized pi electrons.

    !!! tip "Definition"
        1. The interaction is between an aromatic ring and a positively ionizable atom.
        2. The angle between the aromatic ring plane and the vector connecting the center of the aromatic ring
        and the cation is within a defined cutoff.
        3. The distance between the cation and the aromatic ring system does not
        exceed a predefined distance cutoff.

    Returns:
        NeighborPairs: The computed cation-pi contacts.

    """
    assert self.angles is not None
    return self.ap_contacts.cation_pi(self.neighbors, self.angles)