schrodinger.application.matsci.crest module

Utilities for Crest.

Copyright Schrodinger, LLC. All rights reserved.

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

Bases: 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: 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'
CONSTRAINT = 'constraint'
CONSTRAINTS = 'constraints'
CALCULATION = 'calculation'
LEVEL = 'level'
CHARGE = 'charge'
UHF = 'uhf'
CONSTRAINT_FC = 'fc'
__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

getConstraintDict(create=True)

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

Parameters:

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

Return type:

dict

Returns:

the constraint dictionary

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

setConstraintFc(fc)

Set the constraint force constant in the TOML dictionary.

Parameters:

fc (float) – the force constant (Hartree/Bohr^2)

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, fc=None, other_fns=None, tpp=1, logger=None)

Bases: object

Wrapper class for managing a Crest job.

JOB_CLASS

alias of CrestJob

INPUT_FLAG = '--input'
THREAD_FLAG = '-T'
__init__(mae_fn, cmd=None, toml_fn=None, constraints_fn=None, fc=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

  • fc (float) – the constraint force constant (Hartree/Bohr^2)

  • 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, fc=None, tpp=1, logger=None)

Bases: Crest

Wrapper class for managing a Crest conformational search job.

JOB_CLASS

alias of 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}
SUB_RMSD_FLAG = '--subrmsd'
NO_REF_TOPO_FLAG = '--noreftopo'
EWIN_FLAG = '--ewin'
ETHR_FLAG = '--ethr'
RTHR_FLAG = '--rthr'
BTHR_FLAG = '--bthr'
NCI_FLAG = '--nci'
WSCAL_FLAG = '--wscal'
NO_TOPO_FLAG = '--notopo'
NO_CROSS_FLAG = '--nocross'
__init__(mae_fn, cmd=None, constraints_fn=None, fc=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.

isValidConformer(conformer)

Return True if the given conformer is valid, False otherwise.

Parameters:

conformer (schrodinger.structure.Structure) – the conformer

Return type:

bool

Returns:

True if the given conformer is valid, False otherwise

getConformers()

Return the conformers dictionary sorted by increasing energy.

Raises:

CrestException – if there is an issue

Return type:

dict[float]=list[schrodinger.structure.Structure]

Returns:

dict with keys as energies (units Hartree), and values as lists of structure.Structure, sorted by increasing energy

getConformerList()

Return a list of conformers sorted by increasing energy.

Return type:

list[schrodinger.structure.Structure]

Returns:

conformers sorted by increasing energy

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