CSD Landscape Generator¶
Introduction¶
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]
API¶
- class ccdc.csp.csd_landscape_generator.CSDLandscapeGenerator(settings=None)[source]¶
Crystal structure prediction landscape generation using experimentally observed crystal structures as templates for predictions.
- class GeneratedEntry(_prediction)[source]¶
A generated crystal structure prediction entry. This is a
ccdc.entry.Entry
with associated scores.- property relative_score¶
The prediction’s score relative to the lowest scoring prediction in the prediction run.
This value will be zero until after 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 format¶
The output crystal file format, one of ‘cif’ or ‘mol2’.
- 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(molecule)[source]¶
Generate a crystal structure prediction landscape for the input molecule.
This will yield
ccdc.csp.csd_landscape_generator.GeneratedEntry
as they become ready. Theccdc.csp.csd_landscape_generator.GeneratedEntry
will be given valid relative_score values when landscape generation is completed.