schrodinger.application.matsci.crest module

Utilities for Crest.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.crest.CrestJob(cmd, subdir)

Bases: schrodinger.application.matsci.jobutils.LoggingSubprocessJob

Manage a raw Crest job.

__init__(cmd, subdir)

See parent class for documentation.

update()

See parent class for documentation.

class schrodinger.application.matsci.crest.CrestCSearchJob(*args, **kwargs)

Bases: schrodinger.application.matsci.crest.CrestJob

Manage a raw Crest conformational search job.

CONFORMERS_XYZ_OUT = 'crest_conformers.xyz'
__init__(*args, **kwargs)

See parent class for documentation.

update()

See parent class for documentation.

class schrodinger.application.matsci.crest.CrestTOML(toml_fn=None, toml_dict=None)

Bases: object

Manage a Crest TOML file.

INPUT = 'input'
THREADS = 'threads'
CONSTRAINTS = 'constraints'
CALCULATION = 'calculation'
LEVEL = 'level'
CHARGE = 'charge'
UHF = 'uhf'
__init__(toml_fn=None, toml_dict=None)
Parameters
  • toml_fn (str) – the TOML input file

  • toml_dict (str) – the TOML input dictionary

getCalculationDict(create=True)

Return the calculation dictionary and optionally create one if it is missing.

Parameters

create (bool) – if True and the calculation dictionary is missing then create one

Return type

dict

Returns

the calculation dictionary

getLevelDicts(create=True)

Return the level dictionaries and optionally create one if they are missing.

Parameters

create (bool) – if True and the level dictionaries are missing then create one

Return type

list

Returns

the level dictionaries

setInput(ainput)

Set the input.

Parameters

ainput (str) – the input

setThreads(threads)

Set the threads.

Parameters

threads (int) – the threads

setConstraints(constraints)

Set the constraints.

Parameters

constraints (str) – the constraints

setCharge(charge)

Set the charge in the TOML dictionary.

Parameters

charge (int) – the charge

setUhf(uhf)

Set the uhf in the TOML dictionary.

Parameters

uhf (int) – the uhf

write(toml_fn)

Write the TOML dictionary to the given TOML file.

Parameters

toml_fn (str) – the TOML file

exception schrodinger.application.matsci.crest.CrestException

Bases: Exception

class schrodinger.application.matsci.crest.Crest(mae_fn, cmd=None, toml_fn=None, constraints_fn=None, other_fns=None, tpp=1, logger=None)

Bases: object

Wrapper class for managing a Crest job.

JOB_CLASS

alias of schrodinger.application.matsci.crest.CrestJob

INPUT_FLAG = '--input'
THREAD_FLAG = '-T'
__init__(mae_fn, cmd=None, toml_fn=None, constraints_fn=None, other_fns=None, tpp=1, logger=None)
Parameters
  • mae_fn (str) – the input Maestro file

  • cmd (str) – the command line

  • toml_fn (str) – the TOML input Crest file

  • constraints_fn (str) – the constraints input Crest file

  • other_fns (list) – any other input Crest files

  • tpp (int) – the number of threads

  • logger (logging.Logger) – output logger

static validate(mae_fn=None, options=None)

Validate input.

Parameters
  • mae_fn (str) – the input Maestro file

  • options (argparse.Namespace) – the options

Raises

CrestException – if there is an issue

getCmd(cmd=None)

Return the command line.

Parameters

cmd (str) – the command line

Return type

list[str]

Returns

the command line

writeInputXYZs(xyz_fn)

Write input xyzs.

Parameters

xyz_fn (str) – the file name to write

writeInputTOML()

Write input toml.

getConstraintsRefXYZFileName()

Return the constraints reference xyz file name.

Return type

str or None

Returns

the constraints reference xyz file name if there is one

writeInput()

Write input files.

writeOutput()

Write output files.

run()

Run a Crest job.

Raises

CrestException – if there is an issue

class schrodinger.application.matsci.crest.CrestCSearch(mae_fn, cmd=None, constraints_fn=None, tpp=1, logger=None)

Bases: schrodinger.application.matsci.crest.Crest

Wrapper class for managing a Crest conformational search job.

JOB_CLASS

alias of schrodinger.application.matsci.crest.CrestCSearchJob

TOML_DICT = {'calculation': {'elog': 'energies.log', 'eprint': True, 'hess_update': 'bfgs', 'level': [{'method': 'tblite', 'tblite_level': 'gfn2', 'charge': None, 'uhf': None}], 'type': 1}, 'input': None, 'threads': None}
__init__(mae_fn, cmd=None, constraints_fn=None, tpp=1, logger=None)
Parameters
  • mae_fn (str) – the input Maestro file

  • cmd (str) – the command line

  • constraints_fn (str) – the constraints input Crest file

  • tpp (int) – the number of threads

  • logger (logging.Logger) – output logger

getCmd(cmd=None)

See parent class for documentation.

writeInputTOML()

See parent class for documentation.

getConformers()

Return the conformers.

Return type

list[schrodinger.structure.Structure]

Returns

the conformers

writeOutput()

See parent class for documentation.

schrodinger.application.matsci.crest.write_substructure_constraints_file(in_fn, natoms, restrain_idxs, out_fn, force_constant=0.5)

Write a substructure constraints file. This is how to constrain atoms in Crest.

Parameters
  • in_fn (str) – the input xyz file name

  • natoms (int) – the number of atoms in the input xyz file

  • restrain_idxs (list[int]) – the indices of the atoms to restrain

  • out_fn (str) – the output constraints file name

  • force_constant (float) – the force constant in Hartree/Bohr^2

schrodinger.application.matsci.crest.validate_platform()

Validate platform.

Raises

CrestException – if there is an issue