Docking API

Introduction

Note

The ccdc.docking module is available only to CSD-Discovery and CSD-Enterprise users.

The ccdc.docking module provides an API to molecular docking functionality.

Note

The ccdc.docking module is available only to CSD-Discovery and CSD-Enterprise users.

The class ccdc.docking.Docker.LigandPreparation provides functionality for preparing ligands for docking. This classes encapsulate the typical preparation activities, such as protonation and bond typing.

API

class ccdc.docking.Docker(settings=None)[source]

Docker.

class InteractiveResults(settings, pid=None)[source]

A session connecting to a GOLD process.

If the ccdc.docking.Docker.InteractiveResults instance has an attribute, ‘ligand_preparation’, this should be either None, in which case no ligand preparation is performed, or an instance of ccdc.docking.Docker.LigandPreparation whose prepare method will be called for each interactive docking attempted. A default constructed ccdc.docking.Docker.LigandPreparation will be used if the attribute is not present.

dock(entry)[source]

Send an entry to be docked.

Returns:a tuple of ccdc.entry.Entry instances. These are the docked poses.
class LigandPreparation(settings=None)[source]

Prepare ligands for docking.

class Settings[source]

Configuration options for the preparation of ligands.

prepare(entry)[source]

Prepare an entry for docking.

Parameters:entryccdc.entry.Entry instance
Returns:ccdc.entry.Entry instance with specified rules applied.
class Results(settings, return_code=None, pid=None)[source]

Docking results.

class DockedLigand(entry, settings)[source]

Subclass of ccdc.entry.Entry to provide nicer access to the scoring terms of the docking.

class HBond(text, ligand, results)[source]

A hydrogen bond in the docked ligand.

fitness(fitness_function=None)[source]

The recorded fitness of a docking.

Param:fitness_function: one of the fitness functions of the ccdc.docking.Docker.Settings or None.

If the docking has exactly one fitness attribute, i.e., no rescoring has been performed, then there is no need to specify the fitness_function.

scoring_term(*filters)[source]

Individual or dicts of scoring terms from the entry.

Parameters:
  • fitness_function – any of the fitness functions of ccdc.docking.Settings
  • *filters – an iterable of additional constraints to put on the name of the term.
Returns:

a float if the specification is exact or a dictionary of key:float if ambiguous.

class DockedLigandReader[source]

Subclass of ccdc.io.EntryReader to provide ccdc.docking.Docker.Results.DockedLigand instances.

docking_log

The content of the docking log file.

error_log

The content of the docking error log file.

ligand_log(index)[source]

The content of a ligand log.

ligands

The ligands of the docking.

The value of this property is a ccdc.io.EntryReader. Each entry has an attributes property, a dictionary of the docking information pertaining to the docking.

make_complex(ligand)[source]

Make the complex with the ligand, adjusting rotatables as required.

Returns:a ccdc.protein.Protein with the ligand added.
protein_log

The content of the protein log file.

proteins

The protein(s) of the docking.

Returns:a tuple of ccdc.protein.Protein.

This tuple will have more than one entry if ensemble docking was used.

class Settings(_settings=None)[source]

Settings for docker.

class BindingSite[source]
class BindingSiteFromAtom(protein, atom, distance)[source]

A cavity defined from a protein atom.

class BindingSiteFromLigand(protein, ligand, distance=6.0, whole_residues=True)[source]

A cavity defined from a ligand and a contact distance.

class BindingSiteFromListOfAtoms(protein, atoms)[source]
class BindingSiteFromListOfResidues(protein, residues)[source]

Cavity defined from a list of residues.

class BindingSiteFromPoint(protein, origin=(0, 0, 0), distance=12.0)[source]

A cavity defined from a point.

class BindingSiteFromResidue(protein, residue, distance)[source]

A cavity defined from a protein residue.

class Constraint(_constraint=None)[source]

A docking constraint.

class DistanceConstraint(atom1, atom2, limits=(1.5, 3.5), weight=5.0, topological_equivalent=False, _constraint=None)[source]

A distance constraint.

class HBondConstraint(atom1, atom2, _constraint=None)[source]

An HBond constraint.

Parameters:atom2 (atom1,) – ccdc.molecule.Atom instances.

One of the atoms should be a donatable hydrogen, the other a HBond acceptor atom. One atom should be on the protein, the other on a ligand.

class LigandFileInfo(file_name, ndocks=1, start=0, finish=0)[source]

Information about a ligand file.

class ProteinFileInfo(file_name=None, _protein_data=None, settings=None)[source]

Data associated with a protein for docking.

add_constraint(constraint)[source]

Add a constraint to the protein.

clear_constraints()[source]

Remove all constraints.

constraints

The constraints associated with this protein.

file_name

The file name of the protein.

class ProteinHBondConstraint(atoms, weight=10.0, min_hbond_score=0.005, _constraint=None)[source]

A Protein HBond constraint.

class RegionConstraint(origin, radius, type, weight=5.0, atoms=None, _constraint=None)[source]

A region constraint.

class ScaffoldMatchConstraint(molecule, weight=5.0, atoms=None, _constraint=None)[source]

A scaffold match constraint.

class SubstructureConstraint(protein_atom, substructure, substructure_atom, limits, weight=5.0, use_ring_centre=True, substructure_file_name=None, _constraint=None)[source]

A Substructure constraint.

class TemplateSimilarityConstraint(type, template, weight=5.0, template_file_name=None, _constraint=None)[source]

A template similarity constraint.

add_constraint(constraint)[source]

Add a constraint to the docking.

Parameters:constraintccdc.docking.Docker.Settings.Constraint instance.
add_ligand_file(file_name, ndocks=1, start=0, finish=0)[source]

Add a file of ligands to the docking settings.

Parameters:
  • file_name – a mol2 or sdf file of ligand molecules, or a ccdc.docking.Docker.Settings.LigandFileInfo instance.
  • ndocks – int, the number of docking attempts for each ligand
  • start – int, index of ligand at which to start
  • finish – int, index of ligand at which to finish
add_protein_file(file_name)[source]

Add a target file to be docked against.

autoscale

The autoscale percentage, which controls how much searching is performed.

The docker will determine how much docking is reasonable to perform on a ligand based on the number of rotatable bonds and the number of hydrogen donors and acceptors. This percentage will scale the amount of docking done to perform faster or more thorough docking.

clear_constraints()[source]

Clears the set of constraints.

clear_ligand_files()[source]

Remove all ligand datafiles from settings.

clear_protein_files()[source]

Clear the set of targets.

conf_file

The GOLD conf file represented by this settings instance.

constraints

The tuple of constraints set.

diverse_solutions

Diverse solutions settings.

If diverse solutions is enabled this will be (True, cluster size, rmsd), otherwise (False, None, None)

early_termination

Whether early termination is permitted.

If early termination is permitted this will be (True, number_of_solutions, rmsd_threshold), if not this will be (False, None, None)

fitness_function

Which fitness function to use.

Options are ‘goldscore’, ‘chemscore’, ‘asp’, ‘plp’. GoldScore is selected by default.

fitting_points_file

A file to read or write the fitting points.

force_constraints

Whether the constraints are to be forced.

static from_file(file_name)[source]

Read docking settings from a gold.conf file.

Parameters:file_name – Location of the gold.conf file.
ligand_files

The ligand datafile settings.

Returns:tuple of class:ccdc.docking.Docker.Settings.LigandFileInfo instances.
ligands

The ligands specified for docking.

make_absolute_file_names(file_name, relative=False)[source]

Convert any relative file names to absolute file names.

Parameters:
  • file_name – str, the location of the settings file.
  • relative – bool, whether to make file names relative to the settings file.
output_directory

Directory to which output will be sent.

output_file

Output file.

If this is an empty string then each docking will be in a separate file.

output_format

Desired format for output file.

protein_files

The protein file targets.

proteins

The proteins.

reference_ligand_file

Any reference ligand file name set.

rescore_function

The fitness function used for rescoring.

Should not be the same as the fitness function.

save_binding_site_atoms

Whether or not to write the binding site atom file.

score_parameter_file

The location of an alternative score parameter file.

If set to a relative path the file will be found in the standard GOLD distribution. If set to None, the DEFAULT file will be used.

seed_file

The seed file for the pseudo random number generator

set_hostname(hostname='localhost', ndocks=1)[source]

Set the hostname on which docking jobs will be run.

torsion_distribution_file

The location of a torsion distribution file.

If set to a relative path, the file will be found in the standard GOLD distribution. If set to None, the DEFAULT file will be used.

write_options

Determines which write options are set.

The options are: * MIN_OUT: Use this to write only the gold.log and bestranking.lst files. This is the recommended option for high-throughput virtual screening * NO_LOG_FILES: Use this to disable the writing of all ligand log files and the gold_protein.log file. * NO_LINK_FILES: Use this to disable the writing of ranked pose shortcut files to solution files. By default, one file is written per solution file. * NO_RNK_FILES: Use this to disable the writing of the ranked fitness lists (.rnk extension) for each molecule. By default, one file is written per ligand. * NO_BESTRANKING_LST_FILE: Use this to disable the writing of the bestranking.lst file which includes a list of the highest scoring pose for each ligand. * NO_GOLD_SOLN_LIGAND_MOL2_FILES: Use this to disable the writing of all solution files. As there would be nothing to point to, this option also disables the writing of the ranked pose shortcut files. * NO_GOLD_LIGAND_MOL2_FILE: Use this to disable the writing of all ligand files. By default, one file is written per ligand. * NO_GOLD_PROTEIN_MOL2_FILE: Use this to disable the writing of the protein file. By default, one file is written per target protein. * NO_LGFNAME_FILE: Use this to disable the writing of the .lgfname file. * NO_PLP_MOL2_FILES: If using the ChemPLP scoring function, use this to disable the writing of plp_ligand.mol2 and plp_protein.mol2. * NO_PID_FILE: Use this to disable the writing of the gold.pid file. * NO_SEED_LOG_FILE: Use this to disable the writing of the gold.seed_log file. * NO_GOLD_ERR_FILE: Use this to disable the writing of the gold.err file. * NO_FIT_PTS_FILES: Use this to disable the writing of all files related to fitting points including, but not limited to, fit_pts.mol2 and fit_pts_merged.mol2. * NO_ASP_MOL2_FILES: If using the ASP scoring function, use this to disable the writing of asp_ligand.mol2 and asp_protein.mol2. * NO_GOLD_LOG_FILE: Use this to disable the writing of gold.log.

Returns a list of enabled write options.

copy_settings(newdocker)[source]

Copy this docker’s settings to another docker instance

dock(file_name=None, mode='foreground')[source]

Dock from the current settings.

Parameters:
  • file_name – file name for the settings. If None, current settings are written to a temporary directory.
  • mode – one of ‘foreground’, ‘background’ or ‘interactive’.
Raises:

RuntimeError if no GOLD executable is found.

dock_status()[source]

Check the status of a docking job via the gold.pid file.

results

The docking results.

If the docking is still in progress, the results may be partial.