schrodinger.application.desmond.packages.energygroup module

exception schrodinger.application.desmond.packages.energygroup.EnergyGroupError

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class schrodinger.application.desmond.packages.energygroup.EnergyGroupBase

Bases: object

Its subclasses work with EnergyFacade to perform energy group calculations.

The subclass instance should have the following public attributes:

  • key: immutable and iterable. It is used as the key to retrieve

    calculation result from cache in EnergyFacade

  • kwargs: dict. It is the keyword arguments for get_energies.

Its roles include:

  • store and validate the parameters

  • retrieve result from the cache in EnergyFacade

DEFAULT_OPTIONS = {'corr_energy', 'pressure_tensor'}
getResult(result)

Retrieve and format the result from the cache in EnergyFacade

class schrodinger.application.desmond.packages.energygroup.MoleculeEnergy(cms_model, molecule_number, type, type2)

Bases: schrodinger.application.desmond.packages.energygroup.EnergyGroupBase

Analyzer for energy group calculation with single molecule selection. The pre-defined energy groups are (see COMPONENT_LIST)

  1. All atoms - group 2, 3, 4, 5

  2. Solute atoms - group 5

  3. Membrane atoms - group 5

  4. Solvent atoms - group 5

  5. Selected molecule

TYPE_MAP = {'Angle': 'angle', 'Bond': 'stretch', 'Coulomb': 'elec', 'Torsion': 'dihedral', 'Total': 'Total', 'vdW': 'vdw'}
COMPONENT_LIST = ['Other', 'Solute', 'Membrane', 'Solvent', 'Self']
__init__(cms_model, molecule_number, type, type2)
Parameters
  • molecule_number (int) – index of the molecule

  • type (str) – pre-defined energy type, see TYPE_MAP

  • type2 (str) – pre-defined atom group, see COMPONENT_LIST

getResult(result) List[float]
Returns

frame-by-frame result of the type energy (see TYPE_MAP) of the atom group type2 (see COMPONENT_LIST)

DEFAULT_OPTIONS = {'corr_energy', 'pressure_tensor'}
class schrodinger.application.desmond.packages.energygroup.SelectionEnergyMatrix(cms_model: schrodinger.application.desmond.cms.Cms, asl_selections: Optional[List] = None)

Bases: schrodinger.application.desmond.packages.energygroup.EnergyGroupBase

Analyzer for energy group matrix calculation (all self and cross terms). The pre-defined energy groups are calculated for the specified ASL selection.

__init__(cms_model: schrodinger.application.desmond.cms.Cms, asl_selections: Optional[List] = None)
Parameters

asl_selection – List of ASL srings to include in the energy group calculation.

getResult(result) Dict[str, Dict[str, float]]
Returns

frame-by-frame result all self and cross energy terms

DEFAULT_OPTIONS = {'corr_energy', 'pressure_tensor'}
class schrodinger.application.desmond.packages.energygroup.MoleculeEnergyMatrix(cms_model: schrodinger.application.desmond.cms.Cms, molecule_numbers: Optional[List] = None)

Bases: schrodinger.application.desmond.packages.energygroup.EnergyGroupBase

Analyzer for energy group matrix calculation (all self and cross terms). The pre-defined energy groups are calculated for the specified molecules. If molecules are not specified then all molecules will be used.

__init__(cms_model: schrodinger.application.desmond.cms.Cms, molecule_numbers: Optional[List] = None)
Parameters

molecule_numbers – Set of molecules to include in the energy group calculation. If None or empty, all molecules will be used.

getResult(result) Dict[str, Dict[str, float]]
Returns

frame-by-frame result all self and cross energy terms

DEFAULT_OPTIONS = {'corr_energy', 'pressure_tensor'}
class schrodinger.application.desmond.packages.energygroup.InteractionEnergy(cms_model, asl1, asl2)

Bases: schrodinger.application.desmond.packages.energygroup.EnergyGroupBase

Analyzer for interaction energy group calculation.

__init__(cms_model, asl1, asl2)
Parameters
  • asl1 (str) – atom selection for group 1

  • asl2 (str) – atom selection for group 2

getResult(result) List[Tuple[float, float]]
Returns

frame-by-frame result of the electric and van der Walls energies (both non-bonded and pair) between the two groups

DEFAULT_OPTIONS = {'corr_energy', 'pressure_tensor'}
class schrodinger.application.desmond.packages.energygroup.Bulk(cms_model, type, last_n_percent=70)

Bases: schrodinger.application.desmond.packages.energygroup.EnergyGroupBase

Analyzer for material science energy group calculation

OPTIONS = {'COHES_E', 'DENSITY', 'HEAT_VAP', 'INTRA_E', 'PRESSURE_TENSOR', 'SOL_PARAM', 'SPECIFIC_HEAT', 'TOTAL_E', 'VOLUME'}
ENERGY_TERM = '(far_terms|nonbonded_elec|nonbonded_vdw|Total)'
FLOATING_NUMBER = '([-+]?\\b(?:[0-9]*\\.)?[0-9]+(?:[eE][-+]?[0-9]+)?\\b)'
E_PATTERN = '(far_terms|nonbonded_elec|nonbonded_vdw|Total)\\s+\\(([-+]?\\b(?:[0-9]*\\.)?[0-9]+(?:[eE][-+]?[0-9]+)?\\b)\\)'
__init__(cms_model, type, last_n_percent=70)
@param last_n_percent: Only use last_n_percent of the trajectory

to compute specific heat

getResult(result)

Retrieve and format the result from the cache in EnergyFacade

getCfgParams(cfg_file)
Parameters

cfg_file – path to the simulation configuration file

parseEnergies(fname, num_groups)

Parse the vrun output.engp file for total molecular interaction energies, and other requested quantities. See for example https://opengrok.schrodinger.com/xref/desmond-gpu-src/test/data/bulktest/gpu https://opengrok.schrodinger.com/xref/desmond-gpu-src/test/data/bulktest/cpu

Return type

dict

DEFAULT_OPTIONS = {'corr_energy', 'pressure_tensor'}
class schrodinger.application.desmond.packages.energygroup.PartialCohesiveEnergy(cms_model, asl)

Bases: schrodinger.application.desmond.packages.energygroup.EnergyGroupBase

Compute total cohesive energy (not per molecule) for a set of molecules defined by ASL. For this, nonbonding cross terms must be summed up.

__init__(cms_model, asl)
Parameters

asl (str) – ASL that defines set of molecules.

Raises

EnergyGroupError – If ASL defines incomplete molecules

parseEnergies(fname, num_groups)

Parse the vrun output.engp file for nonbonding energies. Don’t keep everything in the memory.

Parameters
  • fname (str) – Energy group file name

  • num_groups (int) – Number of groups

Returns

list of times and dictionary with results

Return type

tuple(list, dict)

getResult(result)

Retrieve and format the result from the cache in EnergyFacade

DEFAULT_OPTIONS = {'corr_energy', 'pressure_tensor'}
class schrodinger.application.desmond.packages.energygroup.SliceParams(first, interval, last)

Bases: tuple

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

count(value, /)

Return number of occurrences of value.

first

Alias for field number 0

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

interval

Alias for field number 1

last

Alias for field number 2

class schrodinger.application.desmond.packages.energygroup.EnergyComponent

Bases: object

Class for storing different energy components

add(term, val)
property elec
property vdw
schrodinger.application.desmond.packages.energygroup.temp_dir()
schrodinger.application.desmond.packages.energygroup.get_energies(sim_cfg, tr_path, cms_model, slicing, groups, parse=<function _parse_energies>, options=None)

Calculate energies between groups of atoms specified by ASL selections, list of list of AIDs, or molecule number. Note there should be no overlap between any pair of the atom groups.

Parameters
  • parse (callable) – parser for the energy-group output data file

  • options (set) – Set of energy group options

Return type

tuple(list(float), list(EnergyComponent))

Returns

simulation times, and various energies for each frame

See EnergyFacade for other arguments

class schrodinger.application.desmond.packages.energygroup.EnergyFacade(sim_cfg, tr_path, cms_model, slicing)

Bases: object

A helper class to manage energy group calculations. Different energy group calculations have different input/output formats. All these details are hidden by using this class and the subclasses of EnergyGroupBase.

To get full control over the energy group calculation, call get_energies directly.

__init__(sim_cfg, tr_path, cms_model, slicing)
Parameters
  • sim_cfg (str or None) – Path to Desmond simulaiton configuration.

  • tr_path (str) – Path to trajectory folder

get(ene)
schrodinger.application.desmond.packages.energygroup.analyze(tr: List[schrodinger.application.desmond.packages.traj.Frame], cms_model: schrodinger.application.desmond.cms.Cms, *analyzers, sim_cfg: Optional[str] = None)

Do analyses on the given trajectory tr, and return the results. The analyses are specified as one or more positional arguements. Each analyzer should satisfy the interface requirements.

Parameters
  • tr – The simulation trajectory to analyze

  • analyzers – A list of analyzer objects

  • sim_cfg – Path to Desmond simulation configuration.

Return type

list

Returns

For a single analyzer, this function will return a list of analysis results, and each element in the list corresponds to the result of the corresponding frame. For multiple analyzers, this function will return a list of lists, and each element is a list of results of the corresponding analyzer.