schrodinger.application.matsci.crest module

Utilities for Crest.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.crest.CrestHostValidatorMixin

Bases: object

Validate the job host for GUI panels that can launch CREST.

validateCrestHost()

Reject CREST jobs assigned to an unsupported localhost.

Return type:

bool or (bool, str)

Returns:

Whether the selected host is compatible, and an error message if it is not

class schrodinger.application.matsci.crest.CrestOutputFileLoc(filename, sub_subdir)

Bases: tuple

filename

Alias for field number 0

sub_subdir

Alias for field number 1

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.ValidatedCrestJob(*args, **kwargs)

Bases: CrestJob

Base class for validated Crest jobs.

__init__(*args, **kwargs)

See parent class for documentation.

property xyz_out

Return the output xyz file name for the given job type.

Return type:

CrestOutputFileLoc

Returns:

the output xyz file as CrestOutputFileLoc

update()

See parent class for documentation.

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

Bases: ValidatedCrestJob

Manage a raw Crest conformational search job.

property xyz_out

Return the output xyz file name for Crest conformational search.

Return type:

CrestOutputFileLoc

Returns:

the output xyz file as CrestOutputFileLoc

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

Bases: ValidatedCrestJob

Manage a raw Crest Quantum Cluster Growth job.

property xyz_out

Return the output xyz file name for Crest QCG.

Return type:

CrestOutputFileLoc

Returns:

the output xyz file as CrestOutputFileLoc

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'
METHOD = 'method'
TBLITE_LEVEL = 'tblite_level'
CHARGE = 'charge'
UHF = 'uhf'
CONSTRAINT_FC = 'fc'
CALCULATION_TYPE = 'type'
ENERGY_PRINT = 'eprint'
ENERGY_LOG = 'elog'
HESSIAN_UPDATE = 'hess_update'
EXACT_RF = 'exact_rf'
METHOD_TBLITE = 'tblite'
METHOD_GFNFF = 'gfnff'
TBLITE_LEVEL_GFN1 = 'gfn1'
TBLITE_LEVEL_GFN2 = 'gfn2'
ENERGY_LOG_FILENAME = 'energies.log'
HESSIAN_UPDATE_BFGS = 'bfgs'
__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'
GFN1_FLAG = '--gfn1'
GFN2_FLAG = '--gfn2'
GFNFF_FLAG = '--gfnff'
__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.

getBondingTemplate(st)

Return a structure with the input bonding, atom-ordered like the given Crest output structure.

Parameters:

st (Structure) – the Crest output structure

Return type:

Structure

Returns:

the bonding template

transferBonding(st)

Return a copy of the bonding template with the coordinates of the given Crest output structure. Bonds, including zero-order bonds, bond orders, and formal charges are taken from the input.

Parameters:

st (Structure) – the Crest output structure

Return type:

Structure

Returns:

the structure with the input bonding and output coordinates

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

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'
THEORY_FLAGS = ('--gfn1', '--gfn2', '--gfnff')
DEFAULT_THEORY_FLAG = '--gfn2'
TBLITE_LEVELS = {'--gfn1': 'gfn1', '--gfn2': 'gfn2'}
__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.

classmethod getTheoryFlag(cmd)

Return the theory flag selected by the command line.

Parameters:

cmd (list(str)) – the command line

Return type:

str

Returns:

the selected theory flag

Raises:

CrestException – if multiple theory flags are present

getTOMLDict()

Return the TOML dictionary for the selected theory level.

Return type:

dict

Returns:

the TOML dictionary

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

doBonding(st)

Assign bonds and bond orders on the given structure.

Parameters:

st (schrodinger.structure.Structure) – the structure

Return type:

schrodinger.structure.Structure

Returns:

the structure with bonds and bond orders assigned

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.

class schrodinger.application.matsci.crest.CrestQCG(mae_fn, solv_mae_fn, cmd=None, other_fns=None, tpp=1, logger=None)

Bases: Crest

Wrapper class for managing a Crest Quantum Cluster Growth job.

JOB_CLASS

alias of CrestQCGJob

QCG_FLAG = '--qcg'
GROW_FLAG = '--grow'
ENSEMBLE_FLAG = '--ensemble'
GSOLV_FLAG = '--gsolv'
NSOLV_FLAG = '--nsolv'
NOPREOPT_FLAG = '--nopreopt'
FIXSOLUTE_FLAG = '--fixsolute'
NOFIXSOLUTE_FLAG = '--nofix'
ENSEMBLE_LVL_FLAG = '--enslvl'
SIM_LEN_FLAG = '--mdtime'
NCLUS_FLAG = '--nclus'
FREQ_LVL_FLAG = '--freqlvl'
DIRECTED_FLAG = '--directed'
SOLVENT_FN = 'solvent.xyz'
__init__(mae_fn, solv_mae_fn, cmd=None, other_fns=None, tpp=1, logger=None)
Parameters:
  • mae_fn (str) – the input solute Maestro file

  • solv_mae_fn (str) – the input solvent Maestro file

  • cmd (str) – the command line

  • other_fns (list[str]) – the other input filenames (directed docking)

  • tpp (int) – the number of threads

  • logger (logging.Logger) – output logger

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

writeInputXYZs(xyz_fn)

Write input xyzs for solute and solvent.

Parameters:

xyz_fn (str) – the file name to write

getCmd(cmd=None)

Get the command line arguments for the job.

Parameters:

cmd (str) – the command line

Return type:

list[str]

Returns:

the command line

getBondingTemplate(st)

See parent class for documentation. The Crest QCG output cluster contains the solute atoms followed by the solvent molecules, each in input atom order.

Raises:

CrestException – if the output atoms can not be partitioned into the solute and solvent molecules or do not match the template

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