pyKVFinder.hydropathy

pyKVFinder.hydropathy(surface: ndarray, atomic: ndarray | List[List[str | float | int]], vertices: ndarray | List[List[float]], step: float | int = 0.6, probe_in: float | int = 1.4, hydrophobicity_scale: str | Path = 'EisenbergWeiss', ignore_backbone: bool = False, selection: List[int] | List[str] | None = None, nthreads: int | None = None, verbose: bool = False) Tuple[ndarray, Dict[str, float]][source]

Hydropathy characterization of the detected cavities.

Map a target hydrophobicity scale per surface point and calculate average hydropathy of detected cavities.

Parameters:
  • surface (numpy.ndarray) –

    Surface points in the 3D grid (surface[nx][ny][nz]). Surface array has integer labels in each position, that are:

    • -1: bulk points;

    • 0: biomolecule or empty space points;

    • >=2: surface points.

    The empty space points are regions that do not meet the chosen volume cutoff to be considered a cavity.

  • atomic (Union[numpy.ndarray, List[List[Union[str, float, int]]]]) – A numpy array with atomic data (residue number, chain, residue name, atom name, xyz coordinates and radius) for each atom.

  • vertices (Union[numpy.ndarray, List[List[float]]]) – A numpy.ndarray or a list with xyz vertices coordinates (origin, X-axis, Y-axis, Z-axis).

  • step (Union[float, int], optional) – Grid spacing (A), by default 0.6.

  • probe_in (Union[float, int], optional) – Probe In size (A), by default 1.4.

  • hydrophobicity_scale (str, optional) –

    Name of a built-in hydrophobicity scale or a path to a TOML-formatted file with a custom hydrophobicity scale, by default EisenbergWeiss. The hydrophobicity scale file defines the name of the scale and the hydrophobicity value for each residue and when not defined, it assigns zero to the missing residues (see Hydrophobicity scale file template). The package contains seven built-in hydrophobicity scales:

    • EisenbergWeiss [1];

    • HessaHeijne [2];

    • KyteDoolittle [3];

    • MoonFleming [4];

    • RadzickaWolfenden [5];

    • WimleyWhite [6];

    • ZhaoLondon [7].

  • ignore_backbone (bool, optional) – Whether to ignore backbone atoms (C, CA, N, O) when defining interface residues, by default False.

  • selection (Union[List[int], List[str]], optional) – A list of integer labels or a list of cavity names to be selected, by default None.

  • nthreads (int, optional) – Number of threads, by default None. If None, the number of threads is os.cpu_count() - 1.

  • verbose (bool, optional) – Print extra information to standard output, by default False.

Returns:

  • scales (numpy.ndarray) – A numpy.ndarray with hydrophobicity scale value mapped at surface points (scales[nx][ny][nz]).

  • avg_hydropathy (Dict[str, float]) – A dictionary with average hydropathy for each detected cavity and the range of the hydrophobicity scale (min, max).

Raises:
  • TypeErrorsurface must be a numpy.ndarray.

  • ValueErrorsurface has the incorrect shape. It must be (nx, ny, nz).

  • TypeErroratomic must be a list or a numpy.ndarray.

  • ValueErroratomic has incorrect shape. It must be (n, 8).

  • TypeErrorvertices must be a list or a numpy.ndarray.

  • ValueErrorvertices has incorrect shape. It must be (4, 3).

  • TypeErrorstep must be a positive real number.

  • ValueErrorstep must be a positive real number.

  • TypeErrorprobe_in must be a non-negative real number.

  • ValueErrorprobe_in must be a non-negative real number.

  • TypeErrorhydrophobicity_scale must be a string or a pathlib.Path.

  • TypeErrorignore_backbone must be a boolean.

  • TypeErrorselection must be a list of strings (cavity names) or integers (cavity labels).

  • ValueError – Invalid selection: {selection}.

  • TypeErrornthreads must be a positive integer.

  • ValueErrornthreads must be a positive integer.

  • TypeErrorverbose must be a boolean.

Note

The cavity nomenclature is based on the integer label. The cavity marked with 2, the first integer corresponding to a cavity, is KAA, the cavity marked with 3 is KAB, the cavity marked with 4 is KAC and so on.

Example

With the surface points identified with pyKVFinder.spatial and atomic coordinates and information read with pyKVFinder.read_pdb or pyKVFinder.read_xyz, we can perform a hydropathy characterization, that maps a target hydrophobicity scale on surface points and calculate the average hydropathy

>>> from pyKVFinder import hydropathy
>>> scales, avg_hydropathy = hydropathy(surface, atomic, vertices)
>>> scales
array([[[0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        ...,
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.]],
      ...,
      [[0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        ...,
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.]]])
>>> avg_hydropathy
{'KAA': -0.73, 'KAB': -0.05, 'KAC': -0.07, 'KAD': -0.62, 'KAE': -0.81, 'KAF': -0.14, 'KAG': -0.33, 'KAH': -0.16, 'KAI': -0.4, 'KAJ': 0.62, 'KAK': -0.99, 'KAL': 0.36, 'KAM': -0.33, 'KAN': 0.18, 'KAO': 0.88, 'KAP': -0.96, 'KAQ': 0.48, 'KAR': 0.24, 'EisenbergWeiss': [-1.42, 2.6]}

However, users may opt to ignore backbones contacts (C, CA, N, O) with the cavity when mapping hydrophobicity scales on surface points. Then, users must set ignore_backbone flag to True.

>>> from pyKVFinder import hydropathy
>>> scales, avg_hydropathy = hydropathy(surface, atomic, vertices, ignore_backbone=True)
>>> scales
array([[[0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        ...,
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.]],
      ...,
      [[0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        ...,
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.],
        [0., 0., 0., ..., 0., 0., 0.]]])
>>> avg_hydropathy
{'KAA': -0.7, 'KAB': 0.12, 'KAC': -0.08, 'KAD': -0.56, 'KAE': -0.28, 'KAF': -0.25, 'KAG': -0.28, 'KAH': -0.09, 'KAI': -0.4, 'KAJ': 0.96, 'KAK': -0.87, 'KAL': 0.23, 'KAM': 0.06, 'KAN': -0.1, 'KAO': 0.99, 'KAP': -1.04, 'KAQ': 0.48, 'KAR': -0.84, 'EisenbergWeiss': [-1.42, 2.6]}

References