CSD Landscape Generator


csd_landscape_generator.py - an API for crystal structure prediction landscape generation.

Simplest operation is:

>>> from ccdc import io
>>> from ccdc.csp.csd_landscape_generator import CSDLandscapeGenerator
>>> csd = io.EntryReader('csd')
>>> mol = csd.molecule('HXACAN')
>>> landscape_generator = CSDLandscapeGenerator()
>>> landscape_generator.settings.nstructures=3
>>> landscape = list(landscape_generator.generate(mol))
>>> print(sorted([round(prediction.relative_score) for prediction in landscape]))
[0, 27, 32]


class ccdc.csp.csd_landscape_generator.CSDLandscapeGenerator(settings=None)[source]

Generation of a landscape of structural analogues using experimentally observed crystal structures as templates for predictions.

class GeneratedEntry(_prediction)[source]

A generated structural analogue entry. This is a ccdc.entry.Entry with associated scores.

property relative_score

The structural analogue’s score relative to the lowest scoring prediction in the prediction run.

This value will be zero until the landscape generation run is finished.

property score

The prediction’s absolute score.

class Settings(_settings=None)[source]

Settings pertaining to landscape generation.

property database_file

The database file containing the template structures. If this is not set, the current release of the CSD will be used.

property external_minimiser

A path to an external minimiser program to use for crystal structure optimisation. If this is not set, the internal minimiser described at https://doi.org/10.1107/S2052520616006533 will be used. An external minimiser should be the path to a program that takes 2 command line arguments: an input CIF file to optimise and an output CIF file in which to store the result. The minimsed value will be read from the CIF field ‘_ccdc_csp_classification_energy_lattice_absolute’ in the output CIF file.

property format

The output crystal file format, one of ‘cif’ or ‘mol2’.

property maximum_number_of_conformers

The maximum number of conformers to generate from the input molecule. 0 means that the input molecule will be used.

property minimum_conformer_rmsd

The minimum RMSD acceptable between generated conformers. A higher value will increase conformer diversity, but may reduce the number or quality of the conformers generated.

property nstructures

The number of structures to generate, default is 100. There may be fewer structures generated if sufficient template structures cannot be found.

property nthreads

Number of threads to allocate for the template predictor.

property shape_database_location

The database file containing molecule shape information. If this is not set, the current release of the CSD will be used.

property sohncke_only

Returns true if structures should be generated only in Sohncke space groups. These are the space groups that are possible for single enantiomers of chiral molecules.

property working_directory

The working and output directory for the landscape.


Generate a structural analogue landscape for the input molecule.

This will yield ccdc.csp.csd_landscape_generator.GeneratedEntry`s as they become ready. The :class:`ccdc.csp.csd_landscape_generator.GeneratedEntry will be given valid relative_score values when landscape generation is completed.