schrodinger.application.matsci.equilibrium_md module¶
Equilibrium molecular dynamics classes/function shared by transport property calculations using Einstein and Green-Kubo methods.
Copyright Schrodinger, LLC. All rights reserved.
-
schrodinger.application.matsci.equilibrium_md.
get_files
(filename, ext)¶ Get all the files with same extension, if ext is provided.
Parameters: - filename (str) – file to be located and returned
- ext (str or None) – extension to search files of the same type
Return type: list of str
Returns: list of filenames with path
-
schrodinger.application.matsci.equilibrium_md.
flatten_list
(list_to_flatten)¶ Flatten [[a1, a2], [b1,]..] to [a1, a2, b1, ..].
Parameters: list_to_flatten (list) – [[a1, a2], [b1],…]; if [a1, a2, b1,…] is the input list, a copy will be returned. Return type: list Returns: [a1, a2.., b1, b2.., ..]
-
schrodinger.application.matsci.equilibrium_md.
check_finite_molecules
(struct, atom_ids=None)¶ Check whether the molecules in structure are finite.
Parameters: - struct (
schrodinger.structure.Structure
) – the structure whose molecules will be checked - atom_ids (set of int, list of int, list of list, or None) – molecules sharing atoms with this set will be checked. If None, all the molecules are checked.
Returns: message if any molecules are infinite
Return type: string or None
- struct (
-
schrodinger.application.matsci.equilibrium_md.
get_md_results
(basename, log, log_error, opts, **kwargs)¶ From parsed options, setup and run md simulation.
Parameters: - basename (str) – basename for md simulation job
- log (function) – log information
- log_error (function) – log error information and exit
- opts (Named tuple) – The parsed command line option
- kwargs (dict) – extra options to control md simulation
Return type: str, str, str or None
Returns: output cms, trj folder, and enegrp_dat
-
schrodinger.application.matsci.equilibrium_md.
setup_md_job
(name_base, icms, md_time, md_timestep, md_emsemble, md_temperature, md_pressure, trj_interval, md_save_trj, random_seed, gpu, procs, write_vel=False, md_enegrp_int=None, md_enegrp_start=0.0, md_save_enegrp=False, energy_groups=None, save_msj=True, save_multisim_log=True, save_ocms=True, save_log=True, save_ene=True, save_cfg=True, command_dir=None)¶ Write the .msj file and form the command for running the molecular dynamics simulation at a specific temperature.
Parameters: - name_base (base name for the md job) – str
- icms (input cms filename) – str
- md_time (md simulation time in ps) – float
- md_timestep (md timestep in ps) – float
- md_emsemble (md ensemble) – str
- md_temperature (md temperature in K) – float
- md_pressure (md pressure in bar) – float
- trj_interval (time interval for trj output in ps) – float
- md_save_trj (save trj folder, if True) – bool
- random_seed (int) – Seed for random number generator used in simulation
- gpu (request gpu, if True) – bool
- procs (number of processors) – int
- write_vel (record velocity in trj frame, if True) – bool
- md_enegrp_int (time interval for energy group output) – float or None
- md_enegrp_start (start time for energy group output) – float
- md_save_enegrp (save the enegry_file, if True) – bool
- energy_groups (list of keywords for desmond energy_groups) – None or list of str
- save_msj (save msj file, if True) – bool
- save_multisim_log (save _multisim_log file, if True) – bool
- save_ocms (save out cms file, if True) – bool
- save_log (save log file, if True) – bool
- save_ene (save ene file, if True) – bool
- save_cfg (save cfg file, if True) – bool
Return type: str, str, str, str, str
Returns: cmd command to submit md, output cms, trj folder, enegrp file, jobname
Return type: command_dir or None
Returns: the job submission directory (where the command is called and the job is launched)
-
schrodinger.application.matsci.equilibrium_md.
trim_parser_skip_md
(options, extra=None)¶ If md is skipped, delete any options for setting up molecular dynamics simulation.
Parameters: - options (Parsed command options) – Named tuple
- extra (extra flags to be deleted) – None or list of str
Return type: options: Named tuple
Returns: Parsed command options with no md flags
-
schrodinger.application.matsci.equilibrium_md.
add_md_basic_argument
(parser)¶ Parameters: parser ( argparse.ArgumentParser
) – The parser to add additional optionsReturn type: ‘argparse._ArgumentGroup’ Returns: argparse ArgumentGroup with MD setting options Add necessary parser arguments for setting up a MD simulation.
-
schrodinger.application.matsci.equilibrium_md.
add_md_output_argument
(parser, extra_options)¶ Add parser arguments to record output information for MD simulations.
Parameters: - parser (
argparse.ArgumentParser
) – The parser to add additional options - extra_options (extra options can be added according to these keywords) – list of str
Return type: ‘argparse._ArgumentGroup’
Returns: argparse ArgumentGroup with MD output recording information
- parser (
-
schrodinger.application.matsci.equilibrium_md.
add_analysis_argument
(parser, extra_options)¶ Add parser arguments for analysis.
Parameters: - parser (
argparse.ArgumentParser
) – The parser to add additional options - extra_options (extra options can be added according to these keywords) – list of str
Return type: ‘argparse._ArgumentGroup’
Returns: argparse ArgumentGroup with analysis options
- parser (
-
schrodinger.application.matsci.equilibrium_md.
add_parser_opts
(parser, final_prop, mid_prop, use_tau=True, extra_options=None)¶ Add all necessary parser arguments for setting up a MD simulation and optional arguments for certain green-kubo property calculation.
Parameters: - parser (
argparse.ArgumentParser
) – The parser for error information - final_prop (the final property needs to be calculated) – str
- mid_prop (the property needs to be calculated before the final prop) – str
- use_tau (Tau limits are added, if True) – bool
- extra_options (extra options can be added according to these keywords) – None or list of str
Return type: ‘argparse._ArgumentGroup’, ‘argparse._ArgumentGroup’, ‘argparse._ArgumentGroup’
Returns: argparse ArgumentGroups with setting options
- parser (
-
schrodinger.application.matsci.equilibrium_md.
check_options
(opts, parser, option_flag, min_data_point, check_tau=True, check_gpu=False)¶ Validate the options.
Parameters: - opts (Named tuple) – The parsed command line options
- parser (
argparser.ArgumentParser
) – parser to log error information - option_flag (str) – time interval is defined by this flag
- min_data_point (int) – minimum required data point
- check_tau (bool) – validate tau range against available time range
- check_gpu (bool) – check GPU/CPU resource availability. For a remote host, -gpu flag requires a GPU host, and no -gpu flag requires a CPU HOST. For localhost and no job control, only check whether GPU resource is available when -gpu flag exists.
-
schrodinger.application.matsci.equilibrium_md.
check_tau_options
(opts, parser, option_flag, min_data_point)¶ Validate the Tau options.
Parameters: - opts (Named tuple) – The parsed command line options
- parser (
argparser.ArgumentParser
) – parser to log error information - option_flag (str) – time interval is defined by this flag
- min_data_point (int) – minimum required data point
-
class
schrodinger.application.matsci.equilibrium_md.
EquilibriumMdBase
(icms_name)¶ Bases:
object
This is a base class for equilibrium MD subclass, and should be not be instantiated directly.
-
__init__
(icms_name)¶ Parameters: icms_name (cms input file) – str
-
checkSetTimeInterval
(time_intervals=None)¶ Time interval must be the same for all trajectery.
Parameters: time_intervals (list or None) – time intervals between every two frames.
-
checkConstantVol
(allow_npt=True)¶ Calculate volume and check whether it changes.
Parameters: allow_npt (bool) – allow volume to change, if True
-
calDensity
()¶ Caluate the average system density.
-
savePropAndCms
()¶ Save properties to cms model, delete trj information if needed, and write out cms file.
-
-
class
schrodinger.application.matsci.equilibrium_md.
TrjBase
(icms_name)¶ Bases:
schrodinger.application.matsci.equilibrium_md.EquilibriumMdBase
This is a base class for equilibrium MD subclass that uses trajectory, and should be not be instantiated directly.
-
readTrj
(make_whole=False)¶ Read trj frames from trj folder.
Parameters: make_whole (bool) – if True, bond across PBCs are fixed so that two bonded particles won’t be on opposite sides of the system
-
trajFrames
(make_whole=False)¶ Fix pbc bonds (if needed), yield the trajectory frame, and garbage-collect to release the occupied memory.
Parameters: make_whole (bool) – if True, bond across PBCs are fixed so that two bonded particles won’t be on opposite sides of the system Return type: schrodinger.application.desmond.packages.traj.frame
Returns: a trajectory frame
-
checkTau
(total_trj_frame_num, min_tau_data_point)¶ Check whether trj frame number is large enough.
Parameters: - total_trj_frame_num (number of total data point) – int
- min_tau_data_point (minimum requested data) – int
-
checkVel
()¶ Check whether each frame contains velocity information.
-
__init__
(icms_name)¶ Parameters: icms_name (cms input file) – str
-
calDensity
()¶ Caluate the average system density.
-
checkConstantVol
(allow_npt=True)¶ Calculate volume and check whether it changes.
Parameters: allow_npt (bool) – allow volume to change, if True
-
checkSetTimeInterval
(time_intervals=None)¶ Time interval must be the same for all trajectery.
Parameters: time_intervals (list or None) – time intervals between every two frames.
-
savePropAndCms
()¶ Save properties to cms model, delete trj information if needed, and write out cms file.
-
-
class
schrodinger.application.matsci.equilibrium_md.
MixInBlockStd
¶ Bases:
object
This is a base class for dividing long simulation into blocks to get standard deviation, and should be not be instantiated directly.
-
checkBlockTau
(total_step_num, min_tau_data_point)¶ Chech whether there are minimum data points between Tau start and end.
Parameters: - total_step_num (number of total data point) – int
- min_tau_data_point (minimum requested data) – int
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-