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.

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.

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
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.

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.

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

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
schrodinger.application.matsci.equilibrium_md.check_file_exist(path_file)

Check and find the path/file on the host

Parameters:path_file (filename with path) – string
Return type:None or str
Returns:None if the file cannot be located
schrodinger.application.matsci.equilibrium_md.check_options(opts, parser, option_flag, min_data_point, check_tau=True)

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
  • check_tau (bool) – validate tau range against available time range
  • min_data_point (int) – minimum required data point
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_file

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_enegry_interval=None, md_save_enegrp=False, energy_groups=[])

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_enegry_interval (time interval for energy group output) – float or None
  • md_save_enegrp (save the enegry_file, if True) – bool
  • energy_groups (list of keywords for desmond energy_groups) – list of str
Return type:

str, str, str, str

Returns:

cmd command to submit md, output cms, trj folder, enegrp file

schrodinger.application.matsci.equilibrium_md.trim_parser_skip_md(options, extra=[])

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) – list of str
Return type:

options: Named tuple

Returns:

Parsed command options with no md flags