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.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.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.find_head_tail(struct, atom_ids=None)

Find the head and tail atoms of the longest path. If multiple longest paths are found, rank those longest paths by the head atom ids and then tail atom ids. Choose the longest path with the smallest head/tail atom ids.

Parameters:
  • struct (the structure containing the target molecule.) – structure.Structure
  • atom_ids (atom ids of the target molecule. If None, all the atoms in the struct are used.) – list of int or None
Return type:

int, int

Returns:

atom ids for head and tail atoms

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)

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

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 options
Return 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

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

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

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

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.equilibrium_md', '__doc__': '\n This is a base class for equilibrium MD subclass,\n and should be not be instantiated directly.\n ', '__init__': <function EquilibriumMdBase.__init__>, 'checkSetTimeInterval': <function EquilibriumMdBase.checkSetTimeInterval>, 'checkConstantVol': <function EquilibriumMdBase.checkConstantVol>, 'calDensity': <function EquilibriumMdBase.calDensity>, 'savePropAndCms': <function EquilibriumMdBase.savePropAndCms>, '__dict__': <attribute '__dict__' of 'EquilibriumMdBase' objects>, '__weakref__': <attribute '__weakref__' of 'EquilibriumMdBase' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.equilibrium_md'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

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.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.equilibrium_md', '__doc__': '\n This is a base class for equilibrium MD subclass that uses trajectory,\n and should be not be instantiated directly.\n ', 'readTrj': <function TrjBase.readTrj>, 'trajFrames': <function TrjBase.trajFrames>, 'checkTau': <function TrjBase.checkTau>, 'checkVel': <function TrjBase.checkVel>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__(icms_name)
Parameters:icms_name (cms input file) – str
__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.equilibrium_md'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

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__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.matsci.equilibrium_md', '__doc__': '\n This is a base class for dividing long simulation into blocks\n to get standard deviation, and should be not be instantiated directly.\n ', 'checkBlockTau': <function MixInBlockStd.checkBlockTau>, '__dict__': <attribute '__dict__' of 'MixInBlockStd' objects>, '__weakref__': <attribute '__weakref__' of 'MixInBlockStd' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

Initialize self. See help(type(self)) for accurate signature.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.matsci.equilibrium_md'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)