Result API

The hotspots.result contains classes to extract valuable information from the calculated Fragment Hotspot Maps.

The main classes of the hotspots.result module are:

hotspots.result.Results can be generated using the hotspots.calculation module

>>> from hotspots.calculation import Runner
>>>
>>> r = Runner()

either

>>> r.from_pdb("pdb_code")

or

>>> from ccdc.protein import Protein
>>> protein = Protein.from_file("path_to_protein")
>>> result = r.from_protein(protein)

The hotspots.result.Results is the central class for the entire API. Every module either feeds into creating a hotspots.result.Results instance or uses it to generate derived data structures.

The hotspots.result.Extractor enables the main result to be broken down based on molecular volumes. This produces molecule sized descriptions of the cavity and aids tractibility analysis and pharmacophoric generation.

class hotspots.result.Extractor(hr, settings=None)[source]

A class to handle the extraction of molecular volumes from a Fragment Hotspot Map result

Parameters
  • hr (hotspots.HotspotResults) – A Fragment Hotspot Maps result

  • settings (hotspots.Extractor.Settings) – Extractor settings

class Settings(volume=150, cutoff=14, spacing=0.5, mvon=True)[source]

Default settings for hotspot extraction

Parameters
  • volume (float) – required volume (default = 150)

  • cutoff (float) – only features above this value are considered (default = 14)

  • spacing (float) – grid spacing, (default = 0.5)

  • mvon (bool) – Run Max value of neighbours (default = True)

extract_volume(volume='125')[source]

Returns a HotspotResult with a restricted volume

Parameters

volume (int) – target map volume

Return hotspots.result.Resultshotspots.result.Results

A fresh result object

class hotspots.result.Results(super_grids, protein, buriedness=None, pharmacophore=None, superstar=None, weighted_superstar=None)[source]

A class to handle the results of the Fragment Hotspot Map calcation and to organise subsequent analysis

Parameters
  • super_grids (dict) – key = probe identifier and value = grid

  • protein (ccdc.protein.Protein) – target protein

  • buriedness (ccdc.utilities.Grid) – the buriedness grid

  • pharmacophore (bool) – if True, a pharmacophore will be generated

atomic_volume_overlap(mol)[source]

for a given mol, return a dictionary of dictionaries containing the percentage overlap of each atoms VDW radius with the Hotspot Grids.

{“donor”: {“atomic_label”: percentage_overlap}

Parameters

mol

Returns

static from_grid_ensembles(res_list, prot_name, charged=False, mode='max')[source]

Experimental feature

Creates ensemble map from a list of Results. Structures in the ensemble have to aligned by the binding site of interest prior to the hotspots calculation.

TODO: Move to the calculation module?

Parameters
  • res_list – list of hotspots.result.Results

  • prot_name (str) – str

  • out_dir (str) – path to output directory

Returns

a hotspots.result.Results instance

get_difference_map(other, tolerance)[source]

Experimental feature. Generates maps to highlight selectivity for a target over an off target cavity. Proteins should be aligned by the binding site of interest prior to calculation. High scoring regions of a map represent areas of favourable interaction in the target binding site, not present in off target binding site

Parameters
Returns

a hotspots.result.Results instance

get_pharmacophore_model(identifier='id_01', threshold=5)[source]

Generates a hotspots.hotspot_pharmacophore.PharmacophoreModel instance from peaks in the hotspot maps

TODO: investigate using feature recognition to go from grids to features.

Parameters
  • identifier (str) – Identifier for displaying multiple models at once

  • cutoff (float) – The score cutoff used to identify islands in the maps. One peak will be identified per island

Returns

a hotspots.hotspot_pharmacophore.PharmacophoreModel instance

grid_labels()[source]

Detect local maxima and generate a dict of peak by value

Returns

Peak coordinates by peak values.

Return type

dict

map_values()[source]

get the number zero grid points for the Fragment Hotspot Result

Returns

dict of str(probe type) by a numpy.array (non-zero grid point scores)

percentage_matched_atoms(mol, threshold, match_atom_types=True)[source]

for a given molecule, the ‘percentage match’ is given by the percentage of atoms which overlap with the hotspot result (over a given overlap threshol)

Parameters
  • mol

  • threshold

  • match_atom_types

Returns

score(obj=None, tolerance=2)[source]

annotate protein, molecule or self with Fragment Hotspot scores

Parameters
  • objccdc.protein.Protein, ccdc.molecule.Molecule or hotsptos.result.Results (find the median)

  • tolerance (int) – the search radius around each point

Returns

scored obj, either ccdc.protein.Protein, ccdc.molecule.Molecule or hotspot.result.Results

>>> result          # example "1hcl"
<hotspots.result.Results object at 0x000000001B657940>
>>> from numpy import np
>>> p = result.score(result.protein)    # scored protein
>>> np.median([a.partial_charge for a in p.atoms if a.partial_charge > 0])
8.852499961853027