Docking API



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.


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.


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


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.


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 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.


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.


Individual or dicts of scoring terms from the entry.

  • 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.

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

class DockedLigandReader[source]

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


The content of the docking log file.


The content of the docking error log file.


The content of a ligand log.


The ligands of the docking.

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


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

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

The content of the protein log file.


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 a constraint to the protein.


Remove all constraints.


The constraints associated with this protein.


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 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.

  • 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 a target file to be docked against.


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.


Clears the set of constraints.


Remove all ligand datafiles from settings.


Clear the set of targets.


The GOLD conf file represented by this settings instance.


The tuple of constraints set.


Diverse solutions settings.

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


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)


Which fitness function to use.

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


A file to read or write the fitting points.


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.

The ligand datafile settings.

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

The ligands specified for docking.

make_absolute_file_names(file_name, relative=False)[source]

Convert any relative file names to absolute file names.

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

Directory to which output will be sent.


Output file.

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


Desired format for output file.


The protein file targets.


The proteins.


Any reference ligand file name set.


The fitness function used for rescoring.

Should not be the same as the fitness function.


Whether or not to write the binding site atom 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.


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.


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.


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 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 this docker’s settings to another docker instance

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

Dock from the current settings.

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

RuntimeError if no GOLD executable is found.


Check the status of a docking job via the file.


The docking results.

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