Pharmacophore API¶
Introduction¶
This documents the various classes of the pharmacophore module, available to CSD-Discovery and CSD-Enterprise users.
pharmacophore.py - access to pharmacophore searches.
This allows pharmacophore models to be read and written, and using these to run searches. Access to the hits is also provided.
API¶
- class ccdc.pharmacophore.Pharmacophore[source]¶
Namespace for the Pharmacophore functionality.
- class AnnotationFilter(key, value)[source]¶
- property key¶
The annotation filter key.
- property value¶
The annotation filter value.
- class ExcludedVolume(sphere, smarts='[*]')[source]¶
An excluded volume feature. This expresses a region to exclude if atoms are in this region.
- Parameters:
sphere – the sphere to exclude
smarts – an optional SMARTS pattern that means you can exclude hits that have a specific substructure
within the sphere
- property filter_smarts¶
The SMARTS pattern that controls when an atom excludes in a given volume by substructure matching.
- class Feature(feature_definition, *spheres)[source]¶
A feature in a Query.
- add_sphere(sphere)[source]¶
Add a sphere to the feature definition.
- Parameters:
sphere –
ccdc.descriptors.GeometricDescriptors.Sphere
instance
- property colour¶
The colour of the spheres.
- property component_label¶
The component label
- property description¶
Description of the feature definition.
- property identifier¶
The identifier of the feature definition.
- property spheres¶
The spheres defined by this feature definition.
- class FeatureDatabase(file_name, _feature_db=None)[source]¶
A database of pharmacophore features.
- class Creator(settings=None)[source]¶
The creator for feature databases.
- class Settings(feature_definition_directory=None, n_threads=None, skip_duplicate_identifiers=False)[source]¶
Settings for feature database creation.
- class StructureDatabase(db_info, use_crystal_symmetry=True, sqlmol2_database_path=None, structure_filters=None, structure_database_path=None)[source]¶
A database of structures from which a feature database may be created.
- create(structure_databases, feature_defs=None)[source]¶
Create the feature database.
- Parameters:
structure_databases – an iterable of
ccdc.pharmacophore.Pharmacophore.FeatureDatabase.Creator.StructureDatabase
instances.feature_defs – an iterable of
ccdc.pharmacophore.Pharmacophore.FeatureDefinition
instances or None. If None, the default set of feature definitions in read in by
ccdc.pharmacophore.Pharmacophore.read_feature_definitions()
will be used.
- class DatabaseInfo(file_name, n_entries, colour)¶
- colour¶
Alias for field number 2
- file_name¶
Alias for field number 0
- n_entries¶
Alias for field number 1
- class Entry(_entry=None)[source]¶
An entry in a FeatureDatabase.
- property annotations¶
The dictionary of annotations for the entry.
- property identifier¶
The identifier of the entry.
- add_feature_definition(feature_definition)[source]¶
Add a feature definition to the database.
Note: this feature definition will not be indexed in the database, so will run rather more slowly if required in a search. To add the corresponding index, the database will need to be recreated with the feature present.
- annotate(pattern, **kw)[source]¶
Add or replace an annotation in the database.
- Parameters:
pattern – a glob-style pattern which will be used to match against identifiers.
All entries in the database with a matching identifier will be annotated with the key, value pairs of the kw argument.
- property annotation_keys¶
The annotations available in this database.
- property databases¶
The structure databases used in the construction of this feature database.
Each database is presented as a tuple of file_name, nunmber of entries, and colour.
- entry(identifier)[source]¶
The
ccdc.pharmacophore.Pharmacophore.FeatureDatabase.Entry
corresponding to the identifier.- Parameters:
identifier – identifier of the entry.
- Returns:
a
ccdc.pharmacophore.Pharmacophore.FeatureDatabase.Entry
instance.- Raises:
RuntimeError if the identifier is not present.
- property feature_definitions¶
The feature definitions present in the database.
- static from_file(feature_database_path)[source]¶
Read a pharmacophore feature database from the specified path.
- Parameters:
feature_database_path – pharmacophore feature database file path.
- Returns:
ccdc.Pharmacophore.FeatureDatabase
instance.
- property identifiers¶
All identifiers from the database.
- property schema_version¶
The database schema version.
- class FeatureDefinition(_feature_def=None)[source]¶
A feature definition in a feature database.
- property colour¶
The colour associated with this feature.
- property component_label¶
Which component (‘protein’, ‘small_molecule’ or ‘any’) the feature def applies to.
- features_from_atoms(point_generator, *atoms)[source]¶
Create features from this feature definition and an atom of the appropriate type.
- Parameters:
point_generator – a string giving one of the point_generator_names associated with this definition.
atoms – an iterable of
ccdc.molecule.Atom
instances.
- Returns:
a
ccdc.pharmacophore.Pharmacophore.Feature
instance.- Raises:
RuntimeError – if the atom is not suitable for the feature definition.
- static from_SMARTS_definitions(identifier, smarts, point_generators)[source]¶
Create a feature from SMARTS definitions.
- Parameters:
identifier – string
smarts – iterable of
ccdc.pharmacophore.Pharmacophore.SMARTS_definition
instances.point_generators – iterable of
ccdc.pharmacophore.Pharmaophore.PointGenerator
instances.
- property identifier¶
The identifier of the feature.
- property point_generator_names¶
The names of the point generator schemes associated with this feature definition.
- class LinearPointGenerator(identifier, distance=2.8, neighbour_is_base_feature=False)[source]¶
Generates a point displaced from the relevant atom.
- class NonPlanarCentroidPointGenerator(identifier, atom_planarity_threshold=0.0)[source]¶
Generates a point at the centroid of atoms which are not planar.
- class NormalPointGenerator(identifier, distance=2.8)[source]¶
Generates a point from the normal to the plane of atoms.
- class PlanarCentroidPointGenerator(identifier, atom_planarity_threshold=0.0)[source]¶
Generates a point at the centre of a planar ring.
- class PlanarNormalPointGenerator(identifier, distance=2.8, planar_ring_tolerance=0.0)[source]¶
Generates a point from the normal to the plane of a planar ring.
- class PointGenerator(_pg=None)[source]¶
A mechanism for generating spheres from a SMARTS match.
- feature_points(atoms)[source]¶
The points generated by this generator.
- Raises:
RuntimeError if the sequence of points is inappropriate for the generator.
- property parameters¶
The optional parameters of the point generator.
- class PointPointGenerator(identifier)[source]¶
Generates a single point at the position of the relevant atom.
- class Query(features=None, _motif_pharmacophore=None)[source]¶
A pharmacophore query.
- class DistanceConstraint(feature_point1, feature_point2, distance_range, which)¶
- distance_range¶
Alias for field number 2
- feature_point1¶
Alias for field number 0
- feature_point2¶
Alias for field number 1
- which¶
Alias for field number 3
- add_distance_constraint(feature1, feature2, distance_range, which)[source]¶
Add a distance constraint between features.
- Parameters:
feature1 – a feature in the model, the tuple contains an id and a point.
feature2 – a feature in the model, the tuple contains an id and a point.
distance_range – a pair of numbers specifying the desired range.
which – ‘intramolecular’, ‘intermolecular’ or ‘any’.
- property bounding_sphere¶
A minimum volume sphere containing all feature points.
- property features¶
The features of the pharmacophore.
- property intra_only¶
Whether all features should be intramolecular.
- property maximum_feature_distance¶
The maximum distance between features.
- property packing¶
Whether to use crystal packing for query structure.
- class SMARTSDefinition(smarts, point_generators, _sd=None, **kw)[source]¶
A SMARTS definition with associated point generation schemes.
- property SMARTS¶
The SMARTS string.
- property allow_overlaps¶
Whether fully overlapping structures are permitted to be a hit.
- property apply_rule¶
How to apply the SMARTS definition.
- property permutational_equivalence¶
Whether permutionally equivalent structures are deemed to be a single match.
- property point_generators¶
The generators for feature points.
- class Search(settings=None)[source]¶
A pharmacophore search
- class Settings(max_hits_per_structure=5, max_hit_structures=100000)[source]¶
Settings for a pharmacophore search.
- property complete_proteins¶
Whether or not to return the complete protein of a hit.
- property complete_small_molecules¶
Whether or not to return the complete small molecule hit.
- property max_hit_rmsd¶
The maximum RMSD of hit structures to be returned.
- property max_hit_structures¶
The number of hits to retain.
- property max_hits_per_structure¶
The number of hits per structure to be returned.
- property n_threads¶
The number of threads to use in the search.
- property skip_proteins¶
Whether or not to skip protein structures.
- property three_cubed_packing¶
Whether or not to use 3-cubed packing.
- property feature_database¶
The CSD-CrossMiner feature database.
- class SearchHit(model, _motif_pharmacophore_hit=None)[source]¶
Pharmacophore search hit.
- property annotations¶
The annotations of the hit.
- property cluster_number¶
The pharmacophore hit cluster number
- property identifier¶
The hit identifier
- property molecule¶
The pharmacophore overlay molecule
- property overlay_rmsd¶
The root-mean-square deviation of the pharmacophore overlay
- property overlay_transformation¶
The transformation matrix of the pharmacophore overlay
- property points¶
The matched points of the hit.
- property protein¶
The hit’s protein, if any.
- property small_molecule¶
The hit’s small molecule.
- class TetrahedralPointGenerator(identifier, distance=2.8)[source]¶
Generates two points with a tetrahedral geometry.