schrodinger.application.matsci.thermo_correction_utils module¶
Utilities for thermochemical correction in reaction workflow.
Copyright Schrodinger, LLC. All rights reserved.
- schrodinger.application.matsci.thermo_correction_utils.has_stage_separator(astr)¶
Return True if the given string has the STAGE_SEPARATOR.
- Parameters:
astr (str) – string to check
- Return type:
bool
- Returns:
True if the given string has the STAGE_SEPARATOR
- schrodinger.application.matsci.thermo_correction_utils.split_stage(astr)¶
Split the given string on STAGE_SEPARATOR.
- Parameters:
astr (str) – string to split
- Return type:
str, str
- Returns:
the given string split on STAGE_SEPARATOR
- schrodinger.application.matsci.thermo_correction_utils.split_stage_ext(astr)¶
Split the given string by the extension.
- Parameters:
astr (str) – string to split
- Return type:
str, str
- Returns:
the given string split by the extension
- schrodinger.application.matsci.thermo_correction_utils.split_stage_hash(astr)¶
Split the given string by the stage hash.
- Parameters:
astr (str) – string to split
- Return type:
str, str, str
- Returns:
the given string split by the stage hash
- schrodinger.application.matsci.thermo_correction_utils.insert_stage_hash(astr, stage_idx)¶
Insert the stage hash to the given string.
- Parameters:
astr (str) – the string to which to insert the stage hash
stage_idx (int) – the stage index
- Return type:
str
- Returns:
the given string with the stage hash inserted
- schrodinger.application.matsci.thermo_correction_utils.insert_temp_press(astr, temp, press)¶
Insert the temperature and pressure extension into the given string.
- Parameters:
astr (str) – the string to which to insert the temperature and pressure extension
temp (float) – the temperature in K
press (float) – the pressure in atm
- Raises:
ThermoCorrectionException – if there is an issue
- Return type:
str
- Returns:
the string with the temperature and pressure extension inserted
- schrodinger.application.matsci.thermo_correction_utils.get_units(key)¶
Return units in the given key.
- Parameters:
key (str) – the key
- Return type:
str
- Returns:
the units
- schrodinger.application.matsci.thermo_correction_utils.insert_units(astr, units)¶
Insert the units extension into the given string.
- Parameters:
astr (str) – the string to which to insert the units extension
units (str) – the units extension, for example ‘(au)’
- Raises:
ThermoCorrectionException – if there is an issue
- Return type:
str
- Returns:
the string with the units extension inserted
- schrodinger.application.matsci.thermo_correction_utils.get_stage_idx(astr)¶
Return the stage index from the given string.
- Parameters:
astr (str) – the string from which to get the stage index
- Return type:
int
- Returns:
the stage index
- schrodinger.application.matsci.thermo_correction_utils.get_restrain_distance_idxs(st)¶
Return a list of lists of indices of restrain distances in the given structure.
- Parameters:
st (Structure) – the structure
- Return type:
list
- Returns:
contains lists of restrain distances
- schrodinger.application.matsci.thermo_correction_utils.get_restrain_angle_idxs(st)¶
Return a list of lists of indices of restrain angles in the given structure.
- Parameters:
st (Structure) – the structure
- Return type:
list
- Returns:
contains lists of restrain angles
- schrodinger.application.matsci.thermo_correction_utils.get_restrain_dihedral_idxs(st)¶
Return a list of lists of indices of restrain dihedrals in the given structure.
- Parameters:
st (Structure) – the structure
- Return type:
list
- Returns:
contains lists of restrain dihedrals
- exception schrodinger.application.matsci.thermo_correction_utils.JaguarPostProcException¶
Bases:
Exception
- schrodinger.application.matsci.thermo_correction_utils.check_ts_vetting(out_file)¶
Return False if TS vetting failed in the given Jaguar out file.
- Parameters:
out_file (str) – Jaguar out file
- Return type:
bool
- Returns:
False if TS vetting failed
- schrodinger.application.matsci.thermo_correction_utils.check_jaguar_output(jag_out_dir, base_name, max_i_freq=0)¶
Check if the Jaguar job for the given base name is valid.
- Parameters:
jag_out_dir (str) – path to the directory containing the Jaguar output files with the given base name
base_name (str) – base name of the Jaguar job
max_i_freq (float) – tolerate small imaginary frequencies less than this value in wavenumbers (cm^-1)
- Raises:
JaguarPostProcException – if there is an issue
- schrodinger.application.matsci.thermo_correction_utils.has_transition_state(rxnwf_file_path=None, rxnwf_sts=None)¶
Return True if the reaction workflow features a transition state, False otherwise.
- Return type:
bool
- Returns:
True if the reaction workflow features a transition state, False otherwise
- schrodinger.application.matsci.thermo_correction_utils.check_anharmonic(sts)¶
Check if anharmonic corrections are applicable to the given structures.
- Parameters:
sts (list[
structure.Structure
]) – the structures- Raises:
ThermoCorrectionException – if there is an issue
- exception schrodinger.application.matsci.thermo_correction_utils.ThermoCorrectionException¶
Bases:
Exception
- class schrodinger.application.matsci.thermo_correction_utils.ThermoCorrection(sts, jag_out_dir, anharm=True, anharm_max_freq=300, anharm_factor_data=None, anharm_dir='anharmonic', return_anharm_zip=True, solvation_entropy=False, solvation_entropy_solvent='water', solvation_entropy_dir='solvation_entropy', return_solvation_entropy_zip=True, jaguar_keywords=None, max_i_freq=0, temp_press_data=None, host=None, n_subjobs=1, tpp=1, max_retries=0, logger=None)¶
Bases:
object
Manage correcting thermochemical properties.
- THERMO_CORR_FINAL = 'thermo_corr_final'¶
- PROP_STARTER = 'r_matsci_thermo_corr_final'¶
- FREE_ENERGY_STARTER = 'r_matsci_thermo_corr_final{type_key}G_tot_(au)'¶
- FREE_ENERGY_PROP = 'r_matsci_thermo_corr_final{type_key}G_tot_(au){temp_press}_stage_{idx}'¶
- LNQ_STARTER = 'r_matsci_thermo_corr_final{type_key}lnQ_tot'¶
- LNQ_PROP = 'r_matsci_thermo_corr_final{type_key}lnQ_tot{temp_press}_stage_{idx}'¶
- __init__(sts, jag_out_dir, anharm=True, anharm_max_freq=300, anharm_factor_data=None, anharm_dir='anharmonic', return_anharm_zip=True, solvation_entropy=False, solvation_entropy_solvent='water', solvation_entropy_dir='solvation_entropy', return_solvation_entropy_zip=True, jaguar_keywords=None, max_i_freq=0, temp_press_data=None, host=None, n_subjobs=1, tpp=1, max_retries=0, logger=None)¶
- Parameters:
sts (list[
structure.Structure
]) – the structuresjag_out_dir (str) – path to a directory containing output files of Jaguar jobs, the .out, .01.in, and .01.mae files are required, base names of files should be title_stage_n where title are the titles of the given structures and n is the stage number, stage being the Jaguar multistage workflow stage from which the output came, .01.mae files should be from auto-rxnwf and have certain properties related to that workflow
anharm (bool) – whether to calculate the anharmonic correction
anharm_max_freq (float) – anharmonic potentials are created for normal modes with harmonic frequencies less than this value in wavenumbers (cm^-1)
anharm_factor_data (SeqData or None) – unitless factor data for factors that multiply a normal mode displacement, if None then the defaults are used, the number of points is in the positive direction only, excluding zero and the negative direction, for example using a value of 4 in turn means 2 * 4 + 1 = 9 points total
return_anharm_zip (bool) – whether to return zipped up directories of all anharmonic subjobs
solvation_entropy (bool) – whether to correct thermochemical properties for solvation entropy
solvation_entropy_solvent (str) – solvent to use for solvation entropy calculation
solvation_entropy_dir (str) – path to a directory to hold results from solvation entropy corrections
return_solvation_entropy_zip (bool) – whether to return zipped up directories of all solvation entropy subjobs
jaguar_keywords (dict) – Jaguar keywords
max_i_freq (float) – tolerate small imaginary frequencies less than this value in wavenumbers (cm^-1)
temp_press_data (
seu.TempPressData
) – the temperature and pressure data for thermochemical propertieshost (str) – the host on which to run subjobs, by default it will be determined automatically by job control from the toplevel -HOST and -SUBHOST arguments
n_subjobs (int) – the maximum number of simulatanous subjobs
tpp (int) – the number of threads to use for Jaguar subjobs, i.e. -TPP (threads-per-process)
max_retries (int) – maximum number of times to try relaunching subjobs
logger (logging.Logger or None) – output logger or None if there isn’t one
- setFreqStageIdxs()¶
Set the indices of frequency stages.
- getJagOutFileName(st, stage_idx)¶
Return the Jaguar output file name.
- Parameters:
st (
schrodinger.structure.Structure
) – the structurestage_idx (int) – the stage index
- Return type:
str
- Returns:
the Jaguar output file name
- setUpDirs()¶
Set up the directories.
- Raises:
ThermoCorrectionException – if there is an issue
- addSolvationEntropyJobs(job_dj, host)¶
Add solvation entropy subjobs.
- Parameters:
jobs_dj (
schrodinger.job.queue.JobDJ
) – the JobDJ objecthost (str or None) – the host string or None if it is determined by the backend
- Raises:
ThermoCorrectionException – if there is an issue
- processSolvationEntropy()¶
Process the solvation entropy.
- Raises:
ThermoCorrectionException – if there is an issue
- addAnharmonicJobs(job_dj, host)¶
Add anharmonic subjobs.
- Parameters:
jobs_dj (
schrodinger.job.queue.JobDJ
) – the JobDJ objecthost (str or None) – the host string or None if it is determined by the backend
- processAnharmonic()¶
Process the anharmonic workflow.
- Raises:
ThermoCorrectionException – if there is an issue
- getFinalThermoProps(st, stage_idx, temperature, pressure)¶
Return final thermochemical properties.
- Parameters:
st (
schrodinger.structure.Structure
) – the structurestage_idx (int) – the stage index
temperature (float) – temperature in K
pressure (float) – pressure in atm
- Raises:
ThermoCorrectionException – if there is an issue
- Return type:
dict[
seu.StructurePropertyInfo
]=float- Returns:
dictionary of
seu.StructurePropertyInfo
to values
- setFinalThermoProps()¶
Set the final thermochemical properties.
- run()¶
Run it.