schrodinger.application.matsci.desmondutils module¶
Utilities for working with Desmond.
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.matsci.desmondutils.ENEGRP_VALUE(time, value)¶
Bases:
tuple
- __contains__(key, /)¶
Return key in self.
- __len__()¶
Return len(self).
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- time¶
Alias for field number 0
- value¶
Alias for field number 1
- schrodinger.application.matsci.desmondutils.exit_if_incompatible_with_desmond(logger=None)[source]¶
Desmond only runs on certain platforms. Exit if the platform being used is not compatible. If a logger is supplied, it will print an error to the logger.
- Parameters
logger (logging.Logger) – The logging object to print an error to if the platform is incompatible. If not supplied, nothing will print.
- Raises
SystemExit – If the current platform is not compatible with Desmond
- schrodinger.application.matsci.desmondutils.make_chorus_orthorhombic(struct)[source]¶
Zero out all the non-diagonal Chorus box properties. The main use of this function is to remove numerical imprecision in the off-diagonal elements that causes Desmond to consider the box triclinic. The function returns the largest off-diagonal element pre-zeroing so the calling routine can decide what to do (warn user, etc) if the off-diagonals looked large enough to be intentionally non-zero.
- Parameters
struct (
schrodinger.structure.Structure
) – The structure whose Chorus box properties should be modified- Return type
float
- Returns
The absolute value of the largest off-diagonal element before zeroing
- schrodinger.application.matsci.desmondutils.has_orthorhombic_pbc(struct, tolerance=0.0)[source]¶
Detect if the given structure has a PBC that is orthorhombic (all angles are 90 degrees).
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to checktolerance (float) – The tolerance for the 90 degree check, in degrees
- Return type
bool
- Returns
True if a PBC exists and it is orthorhombic
- schrodinger.application.matsci.desmondutils.might_be_system(structs)[source]¶
Check if we’re using a Desmond system or system is infinite.
- Parameters
structs (iterable) – Each item should be a
structure.Structure
object- Return type
bool or str
- Returns
False if none of the structures are infinite or Desmond systems. An error message is returned if at least one such structure is detected
- schrodinger.application.matsci.desmondutils.determine_box_size(struct)[source]¶
Determine the size of a cubic box that encloses the entire structure
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to use in determining the box size.- Return type
float
- Returns
The largest span in the X, Y or Z direction
- schrodinger.application.matsci.desmondutils.add_cubic_chorus_box_props(struct)[source]¶
Add the Chorus box properties to the structure for a cubic box
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to add the properties to
- schrodinger.application.matsci.desmondutils.store_chorus_box_props(struct, ax, ay=0.0, az=0.0, bx=0.0, by=None, bz=0.0, cx=0.0, cy=0.0, cz=None)[source]¶
Add properties to the structure that define the periodic boundary condition in the way Desmond wants it defined.
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to add the properties toax (float) – The value of the ax box property
ay (float) – The value of the ay box property. Defaults to 0.
az (float) – The value of the az box property. Defaults to 0.
bx (float) – The value of the bx box property. Defaults to 0.
by (float) – The value of the by box property. If not given, this value is set the same as ax.
bz (float) – The value of the bz box property. Defaults to 0.
cx (float) – The value of the cx box property. Defaults to 0.
cy (float) – The value of the cy box property. Defaults to 0.
cz (float) – The value of the cz box property. If not given, this value is set the same as ax.
- schrodinger.application.matsci.desmondutils.has_chorus_box_props(struct)[source]¶
Check if the structure has all the Chorus box properties
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to check for properties- Return type
bool
- Returns
Whether the structure has all the chorus box properties
- schrodinger.application.matsci.desmondutils.has_space_group_pbc_props(struct)[source]¶
Check if the structure has all the space group PBC properties
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to check for properties- Return type
bool
- Returns
Whether the structure has all the space group pbc properties
- schrodinger.application.matsci.desmondutils.is_opls3_model(model)[source]¶
Check if the given Cms model was made with OPLS3
- Parameters
model (
schrodinger.application.desmond.cms.Cms
) – The cms model to check- Return type
bool
- Returns
True if OPLS3 was detected, False if not
- schrodinger.application.matsci.desmondutils.is_opls2005_model(model)[source]¶
Check if the given Cms model was made with OPLS_2005
- Parameters
model (
schrodinger.application.desmond.cms.Cms
) – The cms model to check- Return type
bool
- Returns
True if OPLS_2005 was detected, False if not
- schrodinger.application.matsci.desmondutils.get_model_ff_name(model)[source]¶
If possible detect what force field the model was created with
- Parameters
model (
schrodinger.application.desmond.cms.Cms
) – The cms model to check- Return type
str
- Returns
The name of the detected forcefield or and empty string if no known force field was detected. FF names are the module constants OPLS3 or OPLS2005
- schrodinger.application.matsci.desmondutils.are_isomers_conn(struct1, struct2)[source]¶
Compare struct1 with struct2 to see if their ‘connectivity’ is the same. Returns True only if ct1 and ct2 have same: 1) #atoms; 2) types; 3) bonds; and 4) bond orders.
- Parameters
struct1 (
schrodinger.structure.Structure
) – Structure to use in comparisonstruct2 (
schrodinger.structure.Structure
) – Another structure to use in comparison
- Return type
bool
- Returns
True if structures are equivalent, False otherwise
- schrodinger.application.matsci.desmondutils.mmct_ct_compare_connect_py(struct, indices_a, indices_b, struct2=None)[source]¶
This is a port of mmlibc/mmct/mmct_ct_compare_connect that takes atom indices instead of structure handlers (extracting structure can be expensive)
Compare atom indices (a) from struct with atom indices (b) from struct 2 if set or struct to see if their ‘connectivity’ is the same.
- Parameters
struct (structure.Structure) – Input structure
indices_a (list(int)) – Atom indices
indices_b (list(int)) – Other atom indices
struct2 (structure.Structure or None) – Other input structure if not None, otherwise struct will be used
- Return type
bool
- Returns
Whether atoms defined with indices_a and indices_b have the same: 1) #atoms; 2) types; 3) bonds; and 4) overall bond orders
- schrodinger.application.matsci.desmondutils.copy_atom_properties(struct1, struct2, atom_props)[source]¶
- Parameters
struct1 (
schrodinger.structure.Structure
) – The structure from which atom properties are copiedstruct2 (
schrodinger.structure.Structure
) – The structure to which atom properties are copiedatom_props (list of strings) – Atom properties that are copied
- schrodinger.application.matsci.desmondutils.get_npseudos_per_molecule(comp_ct)[source]¶
Get number of pseudo atoms per molecule.
- Parameters
comp_ct (FFIOSTructure) – CMS component
- Return type
int
- Returns
Number of pseudo atoms in the first molecule of the component
- schrodinger.application.matsci.desmondutils.get_molecules_pseudos(comp_ct, molecules)[source]¶
Given component and molecules indices return the corresponding pseudo indices.
- Parameters
comp_ct (FFIOSTructure) – CMS component
molecules (list) – List of molecules indices
- Return type
set[int]
- Returns
Set of pseudo atoms indices
- schrodinger.application.matsci.desmondutils.extend_comp(comp_ct, struct)[source]¶
Given a component (comp_ct) with possible some pseudo atoms, extend it with struct (must be the same isomers, NUM_COMPONENT == 1 is enforced).
- Parameters
comp_ct (FFIOSTructure) – CMS component
npseudos (int) – Number of pseudo atoms in the first molecule of the component
struct (structure.Structure) – Structure to extend the component with
- schrodinger.application.matsci.desmondutils.is_traj_gcmc(trj_path, check_all_frames=False)[source]¶
Whether trajectory is generated during Grand-canonical Monte Carlo simulation :param str trj_path: The path to input trajectory
- Parameters
check_all_frames (bool) – Whether to check all the frames of a trajectory. In case of false it will only check the first frame
- Return type
bool
- Returns
Whether passed trajectory is generated during Grand-canonical Monte Carlo simulation
- class schrodinger.application.matsci.desmondutils.SystemBuilder(struct, basename, forcefield='OPLS_2005', rezero_system=True, logger=None, copy_output=True, fatal_atom_properties=['i_ffio_grp_ligand', 'i_ffio_grp_energy', 'i_psp_parent', 'f_psp_parent', 's_psp_parent'], check_infinite=True, split_components=False, water_fftype='SPC', set_incorporation=True, wam_type=None, per_structure_wam=False, build_geometry_msj=None, redistribute_hydrogen_mass=False)[source]¶
Bases:
object
- SOLVATION_RADIUS_KEY = 'solvation_exclusion_radius'¶
- __init__(struct, basename, forcefield='OPLS_2005', rezero_system=True, logger=None, copy_output=True, fatal_atom_properties=['i_ffio_grp_ligand', 'i_ffio_grp_energy', 'i_psp_parent', 'f_psp_parent', 's_psp_parent'], check_infinite=True, split_components=False, water_fftype='SPC', set_incorporation=True, wam_type=None, per_structure_wam=False, build_geometry_msj=None, redistribute_hydrogen_mass=False)[source]¶
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to run the system builder on.basename (str) – The base name of the output file
forcefield (str) – The name of the force field to use. The default is ‘OPLS_2005’. Note that any custom directory needed for OPLS3 is taken care of via the runtime environment as long as the script was launched via launcher with the oplsdir argument.
rezero_system (bool) – Whether to move the center of mass to the origin
logger (
logging.Logger
) – The logger to use to record non-error messages. If None, the messages are printed.copy_output (bool) – specifies to copy output files back to the launch directory by adding them to the job control backend
fatal_atom_properties (tuple of strings) – Properties to remove from structure
check_infinite (bool) – request assign is_infinite during FF assignment
split_components (bool) – Whether to split system in components in the system build
water_fftype (str) – the force field type for water solute. Must be a key in the WATER_FFTYPES dictionary.
set_incorporation (bool) – Set the cms as the incorporated structure when set_incorporation=True and copy_output=True
wam_type (int or None) – One of the enums defined in workflow_action_menu.h if the results should have a Workflow Action Menu in Maestro
per_structure_wam (bool) – Whether wam is to be added per structure
build_geoemtry_msj (str or None) – build_geometry stage msj file
redistribute_hydrogen_mass (bool) – whether to perform hydrogen mass repartition
- run()[source]¶
Prepare and run the desmond system builder
- Raises
FileNotFoundError – If the certain files cannot be found.
- setChorusBoxProps()[source]¶
If the chorus box properties are not set to define the periodic boundary condition, a cubic PBC will be imposed based on the largest span of the X, Y or Z coordinates.
- cleanStructProperties()[source]¶
Romove or re-assign the structure-level properties that causes issues.
- writeMae()[source]¶
Write out the mae file for Desmond forceField assignment input.
- Raises
FileNotFoundError – if input files for desmond assign forcefield stage cannot be generated.
- static validateBuildGeometryMsj(msj_fn=None, msj_sea=None)[source]¶
Validate MSJ file or Map to have two stages, task and build_geometry.
- Return type
(bool, sea.Map) or (bool, str)
- Returns
Whether MSJ is valid. If it is, return Map of the MSJ, otherwise error message
- prepareBuildGeometryInput(in_mae)[source]¶
Prepare mae input for the structure builder
- Parameters
in_mae (str) – Input mae (not modified)
- Return str
Mae file with prepared input for build_geometry
- setupBuildGeometryMSJ(msj_fn)[source]¶
Write msj with build_geometry stage.
- Parameters
msj_fn (str) – MSJ filename to use
- Return type
bool or float
- Returns
False on error. 0 if no solvation was requested, otherwise solvation radius
- runBuildGeometry()[source]¶
Run build_geometry with multisim if requested. self.in_mae may be updated here.
- postProcessCms()[source]¶
Post process of desmond cms output.
- Raises
FileNotFoundError – If the cms cannot be found.
- prepareWaterModel(struct)[source]¶
Prepare water component.
- Parameters
struct (
schrodinger.structure.Structure
) – The structure whose atom properties to be modified. Must be one component (all molecules of the same type)
- schrodinger.application.matsci.desmondutils.run_system_builder(struct, base, *args, **kwargs)[source]¶
Run the Desmond multisim system builder.
See SystemBuilder for argument documentation.
- Parameters
location_type (str) – the location type, either parserutils.INSTALLED_CG_FF_LOCATION_TYPE or parserutils.LOCAL_CG_FF_LOCATION_TYPE
- Return type
str or None
- Returns
The name of the resulting .cms file, or None if the file was not produced successfully
- schrodinger.application.matsci.desmondutils.find_forcefield_invalid_structures(structs, ffield_num=None, handle=None)[source]¶
Check structures to see if the specified forcefield is valid for them
- Parameters
structs (list) – A list of
schrodinger.structure.Structure
objectsffield_num (int or None) – An integer specifying which forcefield to use, if None then handle must be given
handle (int or None) – A forcefield handle, if None then ffield_num must be given
- Return type
list
- Returns
A list containing all the structures that fail the force field test. The list is empty if all structures are valid for the force field
- schrodinger.application.matsci.desmondutils.validate_ff_name_and_get_number(name)[source]¶
Check that the given name is a valid force field name and if so, return the mmffld number associated with that name
- Parameters
name (str) – The force field name to check
- Return type
(str or None, int)
- Returns
The first item is an error message if an error occurred. The second item is the mmffld integer for the given forcefield, or 0 if an error occurred.
- schrodinger.application.matsci.desmondutils.read_density_from_eaf(density_eaf, fraction=0.2, logger=None)[source]¶
Reads in a .eaf file generated by an ms_analysis stage of a Desmond MD run and returns density data.
- Parameters
density_eaf (str) – EAF file containing density information
fraction (float) – The last fraction of the frames to use in the density averaging
logger (
logging.Logger
) – The logger to use while logging errors. If not supplied, messages will be printed.
- Return type
(None, None), or (float, float)
- Returns
(None, None) if the density cannot be read from the file, or tuple of the calculated density and standard deviation.
- schrodinger.application.matsci.desmondutils.get_task_stage(extra_task_text='', check_cg=None, check_infinite=None, msj_string_header='', remove_com_motion=None)[source]¶
Get desmond task stage.
- Parameters
extra_task_text (str) – Additional text to place in the task stage. Ignored if task_stage=False.
check_cg (
schrodinger.structure.Structure
) – Check the given structure to see if it is coarse-grained. If it is, add the typical headers for the appropriate coarse-grained structure type. Note that the interplay between extra_task_test and the headers used for coarse-grained structures is uncertain and left to the caller to determine if the results are acceptable if both are used. Ignored if task_stage=False.check_infinite (
schrodinger.structure.Structure
) – Check the given structure to see if it is infinite. If it is, add the typical headers for the infinite systems. Ignored if task_stage=False.msj_string_header (when extra_task_text is empty, use this string as the header of the output msj) – str
remove_com_motion (bool) – None - default behavior, add remove_com_motion only to infinite atomic systems, if True add plugin to msj regardless. If False don’t add remove_com_plugin
- Return type
str
- Returns
Task stage
- schrodinger.application.matsci.desmondutils.validate_box_size(model, temp=300.0, simple=True)[source]¶
Validate model or structure box (lattice) size.
- Parameters
model (cms.Cms or structure.Structure) – Desmond model or structure. For structure chorus properties must be set
temp (float) – Temperature in K
simple (bool) – If true, run an empirical test based on the lattice constants
- Return bool
True if cell is valid for Desmond, False otherwise
- class schrodinger.application.matsci.desmondutils.MSJStringer(stype, last=False, use_base=True, **kwargs)[source]¶
Bases:
object
A base class for setting up the information and generating a string describing that information for a stage in a Desmond MSJ file.
- DOT = '_dot_'¶
- MAX_STEPS = 'max_steps'¶
- TIME = 'time'¶
- TEMP = 'temperature'¶
- SEED = 'randomize_velocity.seed'¶
- PRESSURE = 'pressure'¶
- ENSEMBLE = 'ensemble'¶
- ENSEMBLE_CLASS = 'ensemble.class'¶
- ENSEMBLE_METHOD = 'ensemble.method'¶
- TIMESTEP = 'timestep'¶
- JOBNAME = 'jobname'¶
- CHECKPOINT = 'checkpt'¶
- DIR = 'dir'¶
- COMPRESS = 'compress'¶
- INTERVAL = 'trajectory_dot_interval'¶
- ENE_INTERVAL = 'eneseq_dot_interval'¶
- ANALYSIS_TYPE = 'analysis_type'¶
- OTHERS = 'othertag'¶
- TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'¶
- RANDOMIZE_VEL = 'randomize_velocity_dot_first'¶
- ISOTROPY = 'backend_dot_integrator_dot_pressure_dot_isotropy'¶
- MSJ_BASE = {'checkpt': 'no', 'jobname': '"$MASTERJOBNAME"'}¶
- MSJ_LAST = {'compress': '""', 'dir': '"."'}¶
- LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep', 'ensemble', 'ensemble.class', 'ensemble.method', 'temperature', 'pressure', 'trajectory_dot_interval', 'randomize_velocity.seed', 'othertag', 'jobname', 'dir', 'compress', 'checkpt']¶
- KNOWN_LINES = {'analysis_type', 'checkpt', 'compress', 'dir', 'ensemble', 'ensemble.class', 'ensemble.method', 'jobname', 'max_steps', 'othertag', 'pressure', 'randomize_velocity.seed', 'temperature', 'time', 'timestep', 'trajectory_dot_interval'}¶
- MINIMIZE = 'minimize'¶
- SIMULATE = 'simulate'¶
- ANALYSIS = 'matsci_analysis'¶
- SYSBUILD = 'assign_forcefield'¶
- AVE_CELL = 'average_cell'¶
- EN_ANALYSIS = 'analysis'¶
- CONCATENATE = 'concatenate'¶
- SETTINGS = {'analysis': None, 'assign_forcefield': None, 'average_cell': None, 'concatenate': None, 'matsci_analysis': None, 'minimize': <schrodinger.utils.sea.sea.Map object>, 'simulate': <schrodinger.utils.sea.sea.Map object>}¶
- PADDING = ' '¶
- INDENT = ' '¶
- __init__(stype, last=False, use_base=True, **kwargs)[source]¶
Create a MSJStringer object
- Parameters
stype (str) – The type of stage this is. Should be one of the class constants MINIMIZE, SIMULATE, SYSBUILD, ANALYSIS, or AVE_CELL
last (bool) – Whether the msj lines typically associated with the last stage (dir, compress) should be included
use_base (bool) – Whether the base msj lines (jobname, checkpoint) that are common to almost all stages should be included.
All other keyword arguments are turned into lines in the .msj file. Keys that have a ‘.’ in them should have that . replaced with the class constant string DOT (_dot_). For instance to include a line setting trajectory.write_velocity to true, use the keyword argument trajectory_dot_write_velocity=’true’
- createString(concatenate=False)[source]¶
Create and return the string that represents this stage in the .msj file
- Parameters
concatenate (bool) – If True enable concatenate mode. In this mode, stage type is not printed
- Return type
str
- Returns
The msj string representing this stage
- formLine(key, value)[source]¶
Create the line that should go in the .msj file for this key.
Subclasses should use this function to create custom strings for specific key values
- Parameters
key (str) – Typically, the string before the key = value pair on an msj line.
value (str) – Typically, the string after the key = value pair on an msj line.
- Return type
str
- Returns
The line (or lines) to put in the .msj file for this key/value pair
- class schrodinger.application.matsci.desmondutils.MinimizeMSJStringer(iterations=None, last=False, **kwargs)[source]¶
Bases:
schrodinger.application.matsci.desmondutils.MSJStringer
An MSJStringer class for Minimizer stages
- __init__(iterations=None, last=False, **kwargs)[source]¶
Create a MinimizeMSJStringer object
- Parameters
last (bool) – Whether the msj lines typically associated with the last stage (dir, compress) should be included
iterations (int) – The number of iterations. If not provided the Desmond default will be used.
All other keyword arguments are turned into lines in the .msj file. See parent class for additional information.
- getTitle()[source]¶
Return a title for the stage describing the main parameters.
- Return type
str
- Returns
The title for this stage
- ANALYSIS = 'matsci_analysis'¶
- ANALYSIS_TYPE = 'analysis_type'¶
- AVE_CELL = 'average_cell'¶
- CHECKPOINT = 'checkpt'¶
- COMPRESS = 'compress'¶
- CONCATENATE = 'concatenate'¶
- DIR = 'dir'¶
- DOT = '_dot_'¶
- ENE_INTERVAL = 'eneseq_dot_interval'¶
- ENSEMBLE = 'ensemble'¶
- ENSEMBLE_CLASS = 'ensemble.class'¶
- ENSEMBLE_METHOD = 'ensemble.method'¶
- EN_ANALYSIS = 'analysis'¶
- INDENT = ' '¶
- INTERVAL = 'trajectory_dot_interval'¶
- ISOTROPY = 'backend_dot_integrator_dot_pressure_dot_isotropy'¶
- JOBNAME = 'jobname'¶
- KNOWN_LINES = {'analysis_type', 'checkpt', 'compress', 'dir', 'ensemble', 'ensemble.class', 'ensemble.method', 'jobname', 'max_steps', 'othertag', 'pressure', 'randomize_velocity.seed', 'temperature', 'time', 'timestep', 'trajectory_dot_interval'}¶
- LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep', 'ensemble', 'ensemble.class', 'ensemble.method', 'temperature', 'pressure', 'trajectory_dot_interval', 'randomize_velocity.seed', 'othertag', 'jobname', 'dir', 'compress', 'checkpt']¶
- MAX_STEPS = 'max_steps'¶
- MINIMIZE = 'minimize'¶
- MSJ_BASE = {'checkpt': 'no', 'jobname': '"$MASTERJOBNAME"'}¶
- MSJ_LAST = {'compress': '""', 'dir': '"."'}¶
- OTHERS = 'othertag'¶
- PADDING = ' '¶
- PRESSURE = 'pressure'¶
- RANDOMIZE_VEL = 'randomize_velocity_dot_first'¶
- SEED = 'randomize_velocity.seed'¶
- SETTINGS = {'analysis': None, 'assign_forcefield': None, 'average_cell': None, 'concatenate': None, 'matsci_analysis': None, 'minimize': <schrodinger.utils.sea.sea.Map object>, 'simulate': <schrodinger.utils.sea.sea.Map object>}¶
- SIMULATE = 'simulate'¶
- SYSBUILD = 'assign_forcefield'¶
- TEMP = 'temperature'¶
- TIME = 'time'¶
- TIMESTEP = 'timestep'¶
- TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'¶
- createString(concatenate=False)¶
Create and return the string that represents this stage in the .msj file
- Parameters
concatenate (bool) – If True enable concatenate mode. In this mode, stage type is not printed
- Return type
str
- Returns
The msj string representing this stage
- formLine(key, value)¶
Create the line that should go in the .msj file for this key.
Subclasses should use this function to create custom strings for specific key values
- Parameters
key (str) – Typically, the string before the key = value pair on an msj line.
value (str) – Typically, the string after the key = value pair on an msj line.
- Return type
str
- Returns
The line (or lines) to put in the .msj file for this key/value pair
- class schrodinger.application.matsci.desmondutils.AveCellMSJStringer(**kwargs)[source]¶
Bases:
schrodinger.application.matsci.desmondutils.MSJStringer
An MSJStringer class for post average cell stage.
- PERCENT_TO_AVG = 'percent_to_avg'¶
- __init__(**kwargs)[source]¶
Create a MSJStringer object
- Parameters
stype (str) – The type of stage this is. Should be one of the class constants MINIMIZE, SIMULATE, SYSBUILD, ANALYSIS, or AVE_CELL
last (bool) – Whether the msj lines typically associated with the last stage (dir, compress) should be included
use_base (bool) – Whether the base msj lines (jobname, checkpoint) that are common to almost all stages should be included.
All other keyword arguments are turned into lines in the .msj file. Keys that have a ‘.’ in them should have that . replaced with the class constant string DOT (_dot_). For instance to include a line setting trajectory.write_velocity to true, use the keyword argument trajectory_dot_write_velocity=’true’
- getTitle()[source]¶
This function returns a title for the stage describing the main parameters. The default implementation has no title.
- Return type
str
- Returns
The title for this stage
- ANALYSIS = 'matsci_analysis'¶
- ANALYSIS_TYPE = 'analysis_type'¶
- AVE_CELL = 'average_cell'¶
- CHECKPOINT = 'checkpt'¶
- COMPRESS = 'compress'¶
- CONCATENATE = 'concatenate'¶
- DIR = 'dir'¶
- DOT = '_dot_'¶
- ENE_INTERVAL = 'eneseq_dot_interval'¶
- ENSEMBLE = 'ensemble'¶
- ENSEMBLE_CLASS = 'ensemble.class'¶
- ENSEMBLE_METHOD = 'ensemble.method'¶
- EN_ANALYSIS = 'analysis'¶
- INDENT = ' '¶
- INTERVAL = 'trajectory_dot_interval'¶
- ISOTROPY = 'backend_dot_integrator_dot_pressure_dot_isotropy'¶
- JOBNAME = 'jobname'¶
- KNOWN_LINES = {'analysis_type', 'checkpt', 'compress', 'dir', 'ensemble', 'ensemble.class', 'ensemble.method', 'jobname', 'max_steps', 'othertag', 'pressure', 'randomize_velocity.seed', 'temperature', 'time', 'timestep', 'trajectory_dot_interval'}¶
- LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep', 'ensemble', 'ensemble.class', 'ensemble.method', 'temperature', 'pressure', 'trajectory_dot_interval', 'randomize_velocity.seed', 'othertag', 'jobname', 'dir', 'compress', 'checkpt']¶
- MAX_STEPS = 'max_steps'¶
- MINIMIZE = 'minimize'¶
- MSJ_BASE = {'checkpt': 'no', 'jobname': '"$MASTERJOBNAME"'}¶
- MSJ_LAST = {'compress': '""', 'dir': '"."'}¶
- OTHERS = 'othertag'¶
- PADDING = ' '¶
- PRESSURE = 'pressure'¶
- RANDOMIZE_VEL = 'randomize_velocity_dot_first'¶
- SEED = 'randomize_velocity.seed'¶
- SETTINGS = {'analysis': None, 'assign_forcefield': None, 'average_cell': None, 'concatenate': None, 'matsci_analysis': None, 'minimize': <schrodinger.utils.sea.sea.Map object>, 'simulate': <schrodinger.utils.sea.sea.Map object>}¶
- SIMULATE = 'simulate'¶
- SYSBUILD = 'assign_forcefield'¶
- TEMP = 'temperature'¶
- TIME = 'time'¶
- TIMESTEP = 'timestep'¶
- TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'¶
- createString(concatenate=False)¶
Create and return the string that represents this stage in the .msj file
- Parameters
concatenate (bool) – If True enable concatenate mode. In this mode, stage type is not printed
- Return type
str
- Returns
The msj string representing this stage
- formLine(key, value)¶
Create the line that should go in the .msj file for this key.
Subclasses should use this function to create custom strings for specific key values
- Parameters
key (str) – Typically, the string before the key = value pair on an msj line.
value (str) – Typically, the string after the key = value pair on an msj line.
- Return type
str
- Returns
The line (or lines) to put in the .msj file for this key/value pair
- class schrodinger.application.matsci.desmondutils.AnalysisMSJStringer(**kwargs)[source]¶
Bases:
schrodinger.application.matsci.desmondutils.MSJStringer
An MSJStringer class for the analysis stage.
- __init__(**kwargs)[source]¶
Create a MSJStringer object
- Parameters
stype (str) – The type of stage this is. Should be one of the class constants MINIMIZE, SIMULATE, SYSBUILD, ANALYSIS, or AVE_CELL
last (bool) – Whether the msj lines typically associated with the last stage (dir, compress) should be included
use_base (bool) – Whether the base msj lines (jobname, checkpoint) that are common to almost all stages should be included.
All other keyword arguments are turned into lines in the .msj file. Keys that have a ‘.’ in them should have that . replaced with the class constant string DOT (_dot_). For instance to include a line setting trajectory.write_velocity to true, use the keyword argument trajectory_dot_write_velocity=’true’
- ANALYSIS = 'matsci_analysis'¶
- ANALYSIS_TYPE = 'analysis_type'¶
- AVE_CELL = 'average_cell'¶
- CHECKPOINT = 'checkpt'¶
- COMPRESS = 'compress'¶
- CONCATENATE = 'concatenate'¶
- DIR = 'dir'¶
- DOT = '_dot_'¶
- ENE_INTERVAL = 'eneseq_dot_interval'¶
- ENSEMBLE = 'ensemble'¶
- ENSEMBLE_CLASS = 'ensemble.class'¶
- ENSEMBLE_METHOD = 'ensemble.method'¶
- EN_ANALYSIS = 'analysis'¶
- INDENT = ' '¶
- INTERVAL = 'trajectory_dot_interval'¶
- ISOTROPY = 'backend_dot_integrator_dot_pressure_dot_isotropy'¶
- JOBNAME = 'jobname'¶
- KNOWN_LINES = {'analysis_type', 'checkpt', 'compress', 'dir', 'ensemble', 'ensemble.class', 'ensemble.method', 'jobname', 'max_steps', 'othertag', 'pressure', 'randomize_velocity.seed', 'temperature', 'time', 'timestep', 'trajectory_dot_interval'}¶
- LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep', 'ensemble', 'ensemble.class', 'ensemble.method', 'temperature', 'pressure', 'trajectory_dot_interval', 'randomize_velocity.seed', 'othertag', 'jobname', 'dir', 'compress', 'checkpt']¶
- MAX_STEPS = 'max_steps'¶
- MINIMIZE = 'minimize'¶
- MSJ_BASE = {'checkpt': 'no', 'jobname': '"$MASTERJOBNAME"'}¶
- MSJ_LAST = {'compress': '""', 'dir': '"."'}¶
- OTHERS = 'othertag'¶
- PADDING = ' '¶
- PRESSURE = 'pressure'¶
- RANDOMIZE_VEL = 'randomize_velocity_dot_first'¶
- SEED = 'randomize_velocity.seed'¶
- SETTINGS = {'analysis': None, 'assign_forcefield': None, 'average_cell': None, 'concatenate': None, 'matsci_analysis': None, 'minimize': <schrodinger.utils.sea.sea.Map object>, 'simulate': <schrodinger.utils.sea.sea.Map object>}¶
- SIMULATE = 'simulate'¶
- SYSBUILD = 'assign_forcefield'¶
- TEMP = 'temperature'¶
- TIME = 'time'¶
- TIMESTEP = 'timestep'¶
- TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'¶
- createString(concatenate=False)¶
Create and return the string that represents this stage in the .msj file
- Parameters
concatenate (bool) – If True enable concatenate mode. In this mode, stage type is not printed
- Return type
str
- Returns
The msj string representing this stage
- formLine(key, value)¶
Create the line that should go in the .msj file for this key.
Subclasses should use this function to create custom strings for specific key values
- Parameters
key (str) – Typically, the string before the key = value pair on an msj line.
value (str) – Typically, the string after the key = value pair on an msj line.
- Return type
str
- Returns
The line (or lines) to put in the .msj file for this key/value pair
- getTitle()¶
This function returns a title for the stage describing the main parameters. The default implementation has no title.
- Return type
str
- Returns
The title for this stage
- class schrodinger.application.matsci.desmondutils.MDMSJStringer(time=None, temp=None, pressure=None, random_seed=None, ensemble='NPT', method=None, timestep=None, last=False, **kwargs)[source]¶
Bases:
schrodinger.application.matsci.desmondutils.MSJStringer
An MSJStringer class for Molecular Dynamics stages
- __init__(time=None, temp=None, pressure=None, random_seed=None, ensemble='NPT', method=None, timestep=None, last=False, **kwargs)[source]¶
Create a MDMSJStringer object
Any keyword that does not have a value supplied will use the default Desmond value for MD simulations.
- Parameters
time (float) – Time in picoseconds
temp (float) – Temperature in Kelvin
pressure (float) – The pressure in bar
random_seed (int) – The seed for the random number generator
ensemble (str) – Valid Desmond ensemble such as NPT, NVT
method (str) – Valid Desmond ensemble method such as NH, Berendson, Langevin
timestep (int or float or str or list) – The timestep in picoseconds. If a string, will be treated as a float if it converts to float without error, otherwise it is used directly so must be in the proper [ x y z ] format used in .msj and .cfg files. If float or int, a string of the following format will be generated [ timestep timestep timestep * 3. ] If a list, the items will be converted to a string list of [ x y z ]
last (bool) – Whether the msj lines typically associated with the last stage (dir, compress) should be included
All other keyword arguments are turned into lines in the .msj file. See parent class for additional information.
- getTitle()[source]¶
Return a title for the stage describing the main parameters.
- Return type
str
- Returns
The title for this stage
- ANALYSIS = 'matsci_analysis'¶
- ANALYSIS_TYPE = 'analysis_type'¶
- AVE_CELL = 'average_cell'¶
- CHECKPOINT = 'checkpt'¶
- COMPRESS = 'compress'¶
- CONCATENATE = 'concatenate'¶
- DIR = 'dir'¶
- DOT = '_dot_'¶
- ENE_INTERVAL = 'eneseq_dot_interval'¶
- ENSEMBLE = 'ensemble'¶
- ENSEMBLE_CLASS = 'ensemble.class'¶
- ENSEMBLE_METHOD = 'ensemble.method'¶
- EN_ANALYSIS = 'analysis'¶
- INDENT = ' '¶
- INTERVAL = 'trajectory_dot_interval'¶
- ISOTROPY = 'backend_dot_integrator_dot_pressure_dot_isotropy'¶
- JOBNAME = 'jobname'¶
- KNOWN_LINES = {'analysis_type', 'checkpt', 'compress', 'dir', 'ensemble', 'ensemble.class', 'ensemble.method', 'jobname', 'max_steps', 'othertag', 'pressure', 'randomize_velocity.seed', 'temperature', 'time', 'timestep', 'trajectory_dot_interval'}¶
- LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep', 'ensemble', 'ensemble.class', 'ensemble.method', 'temperature', 'pressure', 'trajectory_dot_interval', 'randomize_velocity.seed', 'othertag', 'jobname', 'dir', 'compress', 'checkpt']¶
- MAX_STEPS = 'max_steps'¶
- MINIMIZE = 'minimize'¶
- MSJ_BASE = {'checkpt': 'no', 'jobname': '"$MASTERJOBNAME"'}¶
- MSJ_LAST = {'compress': '""', 'dir': '"."'}¶
- OTHERS = 'othertag'¶
- PADDING = ' '¶
- PRESSURE = 'pressure'¶
- RANDOMIZE_VEL = 'randomize_velocity_dot_first'¶
- SEED = 'randomize_velocity.seed'¶
- SETTINGS = {'analysis': None, 'assign_forcefield': None, 'average_cell': None, 'concatenate': None, 'matsci_analysis': None, 'minimize': <schrodinger.utils.sea.sea.Map object>, 'simulate': <schrodinger.utils.sea.sea.Map object>}¶
- SIMULATE = 'simulate'¶
- SYSBUILD = 'assign_forcefield'¶
- TEMP = 'temperature'¶
- TIME = 'time'¶
- TIMESTEP = 'timestep'¶
- TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'¶
- createString(concatenate=False)¶
Create and return the string that represents this stage in the .msj file
- Parameters
concatenate (bool) – If True enable concatenate mode. In this mode, stage type is not printed
- Return type
str
- Returns
The msj string representing this stage
- formLine(key, value)¶
Create the line that should go in the .msj file for this key.
Subclasses should use this function to create custom strings for specific key values
- Parameters
key (str) – Typically, the string before the key = value pair on an msj line.
value (str) – Typically, the string after the key = value pair on an msj line.
- Return type
str
- Returns
The line (or lines) to put in the .msj file for this key/value pair
- class schrodinger.application.matsci.desmondutils.MSAnalysisMSJStringer(analysis_type=None, **kwargs)[source]¶
Bases:
schrodinger.application.matsci.desmondutils.MSJStringer
An MSJStringer class for MS MD Analysis stages
- __init__(analysis_type=None, **kwargs)[source]¶
Create a MSAnalysisMSJStringer object
Any keyword that does not have a value supplied will use the default Desmond value for MD simulations.
- Parameters
analysis_type (str) – A string in the form of [ property property ] that lists the properties to be computed in the analysis.
All other keyword arguments are turned into lines in the .msj file. See parent class for additional information.
- getTitle()[source]¶
Return a title for the stage describing the main parameters.
- Return type
str
- Returns
The title for this stage
- ANALYSIS = 'matsci_analysis'¶
- ANALYSIS_TYPE = 'analysis_type'¶
- AVE_CELL = 'average_cell'¶
- CHECKPOINT = 'checkpt'¶
- COMPRESS = 'compress'¶
- CONCATENATE = 'concatenate'¶
- DIR = 'dir'¶
- DOT = '_dot_'¶
- ENE_INTERVAL = 'eneseq_dot_interval'¶
- ENSEMBLE = 'ensemble'¶
- ENSEMBLE_CLASS = 'ensemble.class'¶
- ENSEMBLE_METHOD = 'ensemble.method'¶
- EN_ANALYSIS = 'analysis'¶
- INDENT = ' '¶
- INTERVAL = 'trajectory_dot_interval'¶
- ISOTROPY = 'backend_dot_integrator_dot_pressure_dot_isotropy'¶
- JOBNAME = 'jobname'¶
- KNOWN_LINES = {'analysis_type', 'checkpt', 'compress', 'dir', 'ensemble', 'ensemble.class', 'ensemble.method', 'jobname', 'max_steps', 'othertag', 'pressure', 'randomize_velocity.seed', 'temperature', 'time', 'timestep', 'trajectory_dot_interval'}¶
- LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep', 'ensemble', 'ensemble.class', 'ensemble.method', 'temperature', 'pressure', 'trajectory_dot_interval', 'randomize_velocity.seed', 'othertag', 'jobname', 'dir', 'compress', 'checkpt']¶
- MAX_STEPS = 'max_steps'¶
- MINIMIZE = 'minimize'¶
- MSJ_BASE = {'checkpt': 'no', 'jobname': '"$MASTERJOBNAME"'}¶
- MSJ_LAST = {'compress': '""', 'dir': '"."'}¶
- OTHERS = 'othertag'¶
- PADDING = ' '¶
- PRESSURE = 'pressure'¶
- RANDOMIZE_VEL = 'randomize_velocity_dot_first'¶
- SEED = 'randomize_velocity.seed'¶
- SETTINGS = {'analysis': None, 'assign_forcefield': None, 'average_cell': None, 'concatenate': None, 'matsci_analysis': None, 'minimize': <schrodinger.utils.sea.sea.Map object>, 'simulate': <schrodinger.utils.sea.sea.Map object>}¶
- SIMULATE = 'simulate'¶
- SYSBUILD = 'assign_forcefield'¶
- TEMP = 'temperature'¶
- TIME = 'time'¶
- TIMESTEP = 'timestep'¶
- TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'¶
- createString(concatenate=False)¶
Create and return the string that represents this stage in the .msj file
- Parameters
concatenate (bool) – If True enable concatenate mode. In this mode, stage type is not printed
- Return type
str
- Returns
The msj string representing this stage
- formLine(key, value)¶
Create the line that should go in the .msj file for this key.
Subclasses should use this function to create custom strings for specific key values
- Parameters
key (str) – Typically, the string before the key = value pair on an msj line.
value (str) – Typically, the string after the key = value pair on an msj line.
- Return type
str
- Returns
The line (or lines) to put in the .msj file for this key/value pair
- class schrodinger.application.matsci.desmondutils.BrownieMSJStringer(time=100.0, temp=10.0, ensemble='NVT', timestep='[ 0.001 0.001 0.003 ]', delta_max=0.1, btau=None, ttau=None, **kwargs)[source]¶
Bases:
schrodinger.application.matsci.desmondutils.MDMSJStringer
An MSJStringer class for Brownie stages
- __init__(time=100.0, temp=10.0, ensemble='NVT', timestep='[ 0.001 0.001 0.003 ]', delta_max=0.1, btau=None, ttau=None, **kwargs)[source]¶
Create a BrownieMSJStringer object
Desmond config does not have a specific set of defaults for Brownie stages, so the defaults are supplied here for all keywords.
- Parameters
delta_max (float) – The value of delta_max
btau (float) – The value of the barostat tau
ttau (float) – The value of the thermostat tau
See parent class for additional information.
- getTitle()[source]¶
Return a title for the stage describing the main parameters.
- Return type
str
- Returns
The title for this stage
- ANALYSIS = 'matsci_analysis'¶
- ANALYSIS_TYPE = 'analysis_type'¶
- AVE_CELL = 'average_cell'¶
- CHECKPOINT = 'checkpt'¶
- COMPRESS = 'compress'¶
- CONCATENATE = 'concatenate'¶
- DIR = 'dir'¶
- DOT = '_dot_'¶
- ENE_INTERVAL = 'eneseq_dot_interval'¶
- ENSEMBLE = 'ensemble'¶
- ENSEMBLE_CLASS = 'ensemble.class'¶
- ENSEMBLE_METHOD = 'ensemble.method'¶
- EN_ANALYSIS = 'analysis'¶
- INDENT = ' '¶
- INTERVAL = 'trajectory_dot_interval'¶
- ISOTROPY = 'backend_dot_integrator_dot_pressure_dot_isotropy'¶
- JOBNAME = 'jobname'¶
- KNOWN_LINES = {'analysis_type', 'checkpt', 'compress', 'dir', 'ensemble', 'ensemble.class', 'ensemble.method', 'jobname', 'max_steps', 'othertag', 'pressure', 'randomize_velocity.seed', 'temperature', 'time', 'timestep', 'trajectory_dot_interval'}¶
- LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep', 'ensemble', 'ensemble.class', 'ensemble.method', 'temperature', 'pressure', 'trajectory_dot_interval', 'randomize_velocity.seed', 'othertag', 'jobname', 'dir', 'compress', 'checkpt']¶
- MAX_STEPS = 'max_steps'¶
- MINIMIZE = 'minimize'¶
- MSJ_BASE = {'checkpt': 'no', 'jobname': '"$MASTERJOBNAME"'}¶
- MSJ_LAST = {'compress': '""', 'dir': '"."'}¶
- OTHERS = 'othertag'¶
- PADDING = ' '¶
- PRESSURE = 'pressure'¶
- RANDOMIZE_VEL = 'randomize_velocity_dot_first'¶
- SEED = 'randomize_velocity.seed'¶
- SETTINGS = {'analysis': None, 'assign_forcefield': None, 'average_cell': None, 'concatenate': None, 'matsci_analysis': None, 'minimize': <schrodinger.utils.sea.sea.Map object>, 'simulate': <schrodinger.utils.sea.sea.Map object>}¶
- SIMULATE = 'simulate'¶
- SYSBUILD = 'assign_forcefield'¶
- TEMP = 'temperature'¶
- TIME = 'time'¶
- TIMESTEP = 'timestep'¶
- TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'¶
- createString(concatenate=False)¶
Create and return the string that represents this stage in the .msj file
- Parameters
concatenate (bool) – If True enable concatenate mode. In this mode, stage type is not printed
- Return type
str
- Returns
The msj string representing this stage
- formLine(key, value)¶
Create the line that should go in the .msj file for this key.
Subclasses should use this function to create custom strings for specific key values
- Parameters
key (str) – Typically, the string before the key = value pair on an msj line.
value (str) – Typically, the string after the key = value pair on an msj line.
- Return type
str
- Returns
The line (or lines) to put in the .msj file for this key/value pair
- class schrodinger.application.matsci.desmondutils.SysbuildMSJStringer(forcefield='OPLS_2005', compress='""', **kwargs)[source]¶
Bases:
schrodinger.application.matsci.desmondutils.MSJStringer
An MSJStringer class for building systems
- __init__(forcefield='OPLS_2005', compress='""', **kwargs)[source]¶
Create a SysbuildMSJStringer object
- Parameters
forcefield (str) – The forcefield to use
All other keyword arguments are turned into lines in the .msj file. See parent class for additional information.
- ANALYSIS = 'matsci_analysis'¶
- ANALYSIS_TYPE = 'analysis_type'¶
- AVE_CELL = 'average_cell'¶
- CHECKPOINT = 'checkpt'¶
- COMPRESS = 'compress'¶
- CONCATENATE = 'concatenate'¶
- DIR = 'dir'¶
- DOT = '_dot_'¶
- ENE_INTERVAL = 'eneseq_dot_interval'¶
- ENSEMBLE = 'ensemble'¶
- ENSEMBLE_CLASS = 'ensemble.class'¶
- ENSEMBLE_METHOD = 'ensemble.method'¶
- EN_ANALYSIS = 'analysis'¶
- INDENT = ' '¶
- INTERVAL = 'trajectory_dot_interval'¶
- ISOTROPY = 'backend_dot_integrator_dot_pressure_dot_isotropy'¶
- JOBNAME = 'jobname'¶
- KNOWN_LINES = {'analysis_type', 'checkpt', 'compress', 'dir', 'ensemble', 'ensemble.class', 'ensemble.method', 'jobname', 'max_steps', 'othertag', 'pressure', 'randomize_velocity.seed', 'temperature', 'time', 'timestep', 'trajectory_dot_interval'}¶
- LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep', 'ensemble', 'ensemble.class', 'ensemble.method', 'temperature', 'pressure', 'trajectory_dot_interval', 'randomize_velocity.seed', 'othertag', 'jobname', 'dir', 'compress', 'checkpt']¶
- MAX_STEPS = 'max_steps'¶
- MINIMIZE = 'minimize'¶
- MSJ_BASE = {'checkpt': 'no', 'jobname': '"$MASTERJOBNAME"'}¶
- MSJ_LAST = {'compress': '""', 'dir': '"."'}¶
- OTHERS = 'othertag'¶
- PADDING = ' '¶
- PRESSURE = 'pressure'¶
- RANDOMIZE_VEL = 'randomize_velocity_dot_first'¶
- SEED = 'randomize_velocity.seed'¶
- SETTINGS = {'analysis': None, 'assign_forcefield': None, 'average_cell': None, 'concatenate': None, 'matsci_analysis': None, 'minimize': <schrodinger.utils.sea.sea.Map object>, 'simulate': <schrodinger.utils.sea.sea.Map object>}¶
- SIMULATE = 'simulate'¶
- SYSBUILD = 'assign_forcefield'¶
- TEMP = 'temperature'¶
- TIME = 'time'¶
- TIMESTEP = 'timestep'¶
- TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'¶
- createString(concatenate=False)¶
Create and return the string that represents this stage in the .msj file
- Parameters
concatenate (bool) – If True enable concatenate mode. In this mode, stage type is not printed
- Return type
str
- Returns
The msj string representing this stage
- formLine(key, value)¶
Create the line that should go in the .msj file for this key.
Subclasses should use this function to create custom strings for specific key values
- Parameters
key (str) – Typically, the string before the key = value pair on an msj line.
value (str) – Typically, the string after the key = value pair on an msj line.
- Return type
str
- Returns
The line (or lines) to put in the .msj file for this key/value pair
- getTitle()¶
This function returns a title for the stage describing the main parameters. The default implementation has no title.
- Return type
str
- Returns
The title for this stage
- class schrodinger.application.matsci.desmondutils.ConcatMSJStringer(**kwargs)[source]¶
Bases:
schrodinger.application.matsci.desmondutils.MSJStringer
An MSJStringer class for the concatenate stage.
- STAGES = 'stages'¶
- __init__(**kwargs)[source]¶
Create a MSJStringer object
- Parameters
stype (str) – The type of stage this is. Should be one of the class constants MINIMIZE, SIMULATE, SYSBUILD, ANALYSIS, or AVE_CELL
last (bool) – Whether the msj lines typically associated with the last stage (dir, compress) should be included
use_base (bool) – Whether the base msj lines (jobname, checkpoint) that are common to almost all stages should be included.
All other keyword arguments are turned into lines in the .msj file. Keys that have a ‘.’ in them should have that . replaced with the class constant string DOT (_dot_). For instance to include a line setting trajectory.write_velocity to true, use the keyword argument trajectory_dot_write_velocity=’true’
- formLine(key, value)[source]¶
Create the line that should go in the .msj file for the ‘stages’ key. Parent function creates strings for all other keys.
- Parameters
key (str) – Typically, the string before the key = value pair on an msj line.
value (str) – Typically, the string after the key = value pair on an msj line.
- Return type
str
- Returns
The line (or lines) to put in the .msj file for this key/value pair
- ANALYSIS = 'matsci_analysis'¶
- ANALYSIS_TYPE = 'analysis_type'¶
- AVE_CELL = 'average_cell'¶
- CHECKPOINT = 'checkpt'¶
- COMPRESS = 'compress'¶
- CONCATENATE = 'concatenate'¶
- DIR = 'dir'¶
- DOT = '_dot_'¶
- ENE_INTERVAL = 'eneseq_dot_interval'¶
- ENSEMBLE = 'ensemble'¶
- ENSEMBLE_CLASS = 'ensemble.class'¶
- ENSEMBLE_METHOD = 'ensemble.method'¶
- EN_ANALYSIS = 'analysis'¶
- INDENT = ' '¶
- INTERVAL = 'trajectory_dot_interval'¶
- ISOTROPY = 'backend_dot_integrator_dot_pressure_dot_isotropy'¶
- JOBNAME = 'jobname'¶
- KNOWN_LINES = {'analysis_type', 'checkpt', 'compress', 'dir', 'ensemble', 'ensemble.class', 'ensemble.method', 'jobname', 'max_steps', 'othertag', 'pressure', 'randomize_velocity.seed', 'temperature', 'time', 'timestep', 'trajectory_dot_interval'}¶
- LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep', 'ensemble', 'ensemble.class', 'ensemble.method', 'temperature', 'pressure', 'trajectory_dot_interval', 'randomize_velocity.seed', 'othertag', 'jobname', 'dir', 'compress', 'checkpt']¶
- MAX_STEPS = 'max_steps'¶
- MINIMIZE = 'minimize'¶
- MSJ_BASE = {'checkpt': 'no', 'jobname': '"$MASTERJOBNAME"'}¶
- MSJ_LAST = {'compress': '""', 'dir': '"."'}¶
- OTHERS = 'othertag'¶
- PADDING = ' '¶
- PRESSURE = 'pressure'¶
- RANDOMIZE_VEL = 'randomize_velocity_dot_first'¶
- SEED = 'randomize_velocity.seed'¶
- SETTINGS = {'analysis': None, 'assign_forcefield': None, 'average_cell': None, 'concatenate': None, 'matsci_analysis': None, 'minimize': <schrodinger.utils.sea.sea.Map object>, 'simulate': <schrodinger.utils.sea.sea.Map object>}¶
- SIMULATE = 'simulate'¶
- SYSBUILD = 'assign_forcefield'¶
- TEMP = 'temperature'¶
- TIME = 'time'¶
- TIMESTEP = 'timestep'¶
- TRJ_WRITE_VEL = 'trajectory_dot_write_velocity'¶
- createString(concatenate=False)¶
Create and return the string that represents this stage in the .msj file
- Parameters
concatenate (bool) – If True enable concatenate mode. In this mode, stage type is not printed
- Return type
str
- Returns
The msj string representing this stage
- getTitle()¶
This function returns a title for the stage describing the main parameters. The default implementation has no title.
- Return type
str
- Returns
The title for this stage
- schrodinger.application.matsci.desmondutils.get_materials_relaxation_stringers(temp=300.0, compress_last=True, pressure_isotropy='anisotropic')[source]¶
Get a list of Stringer objects that reproduce the Materials Relaxation protocol
- Parameters
temp (float) – The temperature for the last of the three stages
compress_last (bool) – If true, compress the last stage - the trajectory will not be available except as part of the tgz file. If False, the last stage will not be compressed and the trajectory will be available.
pressure_isotropy (str) – Barostat coupling between x, y, and z.
- Return type
list
- Returns
Each item of the list is a stage in the Materials Relaxation protocol
- schrodinger.application.matsci.desmondutils.get_semicrystalline_relaxation1_stringers(temp=300.0, compress_last=True, pressure_isotropy='anisotropic')[source]¶
Get a list of Stringer objects that reproduce first Semi-Crystalline protocol
- Parameters
temp (float) – The temperature for the last of the three stages
compress_last (bool) – If true, compress the last stage - the trajectory will not be available except as part of the tgz file. If False, the last stage will not be compressed and the trajectory will be available.
pressure_isotropy (str) – Barostat coupling between x, y, and z.
- Return type
list
- Returns
Each item of the list is a stage in the first Semi-Crysatlline relaxation protocol
- schrodinger.application.matsci.desmondutils.get_semicrystalline_relaxation2_stringers(temp=300.0, compress_last=True, pressure_isotropy='anisotropic')[source]¶
Get a list of Stringer objects that reproduce second Semi-Crystalline Relaxation protocol
- Parameters
temp (float) – The temperature for the last of the three stages
compress_last (bool) – If true, compress the last stage - the trajectory will not be available except as part of the tgz file. If False, the last stage will not be compressed and the trajectory will be available.
pressure_isotropy (str) – Barostat coupling between x, y, and z.
- Return type
list
- Returns
Each item of the list is a stage in the second Semi-Crysatlline relaxation protocol
- schrodinger.application.matsci.desmondutils.get_compressive_relaxation_stringers(temp=300.0, compress_last=True, pressure_isotropy='anisotropic')[source]¶
Get a list of Stringer objects that reproduce the compressive relaxation protocol
- Parameters
temp (float) – The temperature for the last of the three stages
compress_last (bool) – If true, compress the last stage - the trajectory will not be available except as part of the tgz file. If False, the last stage will not be compressed and the trajectory will be available.
pressure_isotropy (str) – Barostat coupling between x, y, and z.
- Return type
list
- Returns
Each item of the list is a stage in the compressive Relaxation protocol
- schrodinger.application.matsci.desmondutils.create_msj(stringers, filename=None, task_stage=True, extra_task_text='', check_cg=None, check_infinite=None, msj_string_header='', remove_com_motion=None)[source]¶
Write a Desmond .msj file based on the supplied stringers
- Parameters
filename (str) – If given, write the msj string to this path
stringers (list of
MSJStringer
objects) – Each item of the list is the MSJStringer for a single stage. The stages will be written in list ordertask_stage (bool) – Whether the traditional desmond auto task stage should be written before the stages in stringers
extra_task_text (str) – Additional text to place in the task stage. Ignored if task_stage=False.
check_cg (
schrodinger.structure.Structure
) – Check the given structure to see if it is coarse-grained. If it is, add the typical headers for the appropriate coarse-grained structure type. Note that the interplay between extra_task_test and the headers used for coarse-grained structures is uncertain and left to the caller to determine if the results are acceptable if both are used. Ignored if task_stage=False.check_infinite (
schrodinger.structure.Structure
) – Check the given structure to see if it is infinite. If it is, add the typical headers for the infinite systems. Ignored if task_stage=False.msj_string_header (when extra_task_text is empty, use this string as the header of the output msj) – str
remove_com_motion (bool) – None - default behavior, add remove_com_motion only to infinite atomic systems, if True add plugin to msj regardless. If False don’t add remove_com_plugin
- Return type
str
- Returns
The string that was written to the file
- schrodinger.application.matsci.desmondutils.get_multisim_command(input_name, output_name, msj_name=None, job_name=None, for_shell=False, hosts=None, add_license=True, license_host=None, **kwargs)[source]¶
Return a command to run the Desmond multisim utility
- Parameters
input_name (str) – The name of the input file
output_name (str) – The name to use for the output CMS file
msj_name (str) – The name of the .msj command file
job_name (str) – The name to use for the job
gpu (bool) – Does nothing, left in for backwards compatibility. All calculations run on GPU
procs (int) – Does nothing, left in for backwards compatibility. All calculations run on GPU
for_shell (bool) – True if this will be used directly in a shell, such as when a panel writes a .sh file or used via subprocess. False if the command will be issued via normal Schrodinger job launching. If True, $SCHRORDINGER will be prepended to the command.
hosts (str) – the hosts to run this job in the hostname:nprocs format
add_license (bool) – Whether Desmond GPU license should be added to the command. Should be False when running force field assignment.
license_host (None or str) – Host to be used to generate license. It will NOT appear in the returned cmd. To keep the host pass it in
hosts
. This option cannot be used together withhosts
- Return type
list
- Returns
The command line command to use
- schrodinger.application.matsci.desmondutils.get_default_near_timestep()[source]¶
Return the default near timestep
- Returns
Default near timestep in femtoseconds
- Return type
float
- schrodinger.application.matsci.desmondutils.get_default_far_timestep()[source]¶
Return the default far timestep
- Returns
Default far timestep in femtoseconds
- Return type
float
- schrodinger.application.matsci.desmondutils.prepare_cms_properties_for_writing(model)[source]¶
Deletes several properties that should be removed before writing a CMS. Notably, this function removes the trajectory property.
- Parameters
model (cms.Cms) – System to update
- schrodinger.application.matsci.desmondutils.delete_molecules_from_comps(model, comp_data)[source]¶
Delete molecules from specific components of a model system
- Parameters
model (cms.Cms) – Desmond model/system to update
comp_data (dict) – keys - components ids, values list of molecules ids
- Return set
Set of empty (removed) component names
- schrodinger.application.matsci.desmondutils.delete_molecules_from_model(model, mol_indices, cg_ff_path=None)[source]¶
Delete molecules from a Desmond system
- Parameters
model (cms.Cms) – Model to update
mol_indices (list(int)) – A list of integers containing the indices of the molecules that should be removed. These indices should correspond with the
model.molecule
indices.cg_ff_path (str) – The path to the force field file for the coarse-grain system. Used to reassign the forcefield for coarse-grained systems after delete molecules.
- Return type
- Returns
A copy of the input model with the molecules removed
- Raises
TypeError – When a coarse-grain model is given, but no
cg_ff_path
argument is given.
- schrodinger.application.matsci.desmondutils.delete_molecules_from_cg_model(model, mol_indices, ff_path)[source]¶
Delete molecules from a coarse-grained Desmond system
- Parameters
model (cms.Cms) – Model to update
mol_indices (list(int)) – A list of integers containing the indices of the molecules that should be removed. These indices should correspond with the
model.molecule
indices.ff_path (str) – The path to the force field file
- Return type
- Returns
A copy of the input model with the molecules removed
- schrodinger.application.matsci.desmondutils.delete_molecules_from_aa_model(model, mol_indices)[source]¶
Delete molecules from an all-atom system
- Parameters
model (cms.Cms) – Model to update
mol_indices (list(int)) – A list of integers containing the indices of the molecules that should be removed. These indices should correspond with the
model.molecule
indices.
- Return type
set
- Returns
Set of empty (removed) components names
- schrodinger.application.matsci.desmondutils.parse_ene_file(filename=None, fileobj=None, prop=None, gcmc=False)[source]¶
Parse data from a Desmond .ene file. All the data from the file can be returned in a dictionary, or just the data from a single property can be returned in a list.
- Parameters
filename (str) – The name of the .ene file to read
fileobj (file or io.BufferedReader) – The open file object for the .ene file. Only one of filename or fileobj should be supplied. If both are given, filename will take precedence. io.BufferedReader objects come from tarfile.extractfile, for instance. Note - in Python 3, open file objects are io.TextIOWrapper
prop (str) – If given, should match one of the properties in the ene file header (such as ‘V’). The return value will be a list of values for this property only
gcmc (bool) – Whether to parse GMCM or a standard MD file
- Return type
dict, dict, or list, list or dict or list
- Returns
If prop is not specified, the return value is a dict if gcmc is False, otherwise two dicts. Keys are property names from the ene header (without units, such as ‘V’) and values are lists of floating point values for that property in the order obtained from the .ene file. If prop is specified, the return value is a list if gcmc is False, otherwise two lists of those property values in the order found in the .ene file.
- Raises
ValueError – If a line of unknown format is found while reading the file, or if neither filename or fileobj is specified.
TypeError – If prop is supplied but does not match a property in the header line
- schrodinger.application.matsci.desmondutils.get_density_from_ene(ene_file, struct, fraction=0.2)[source]¶
Parse the volume from the ene file and compute the density from it. The density is averaged over the last fraction of frames.
- Parameters
ene_file (str) – The name of the file to read in.
struct (
schrodinger.structure.Structure
) – The structure to compute the density forfraction (float) – The fraction of frames to average the density over. For instance, use 0.20 to compute the density over the final 20% of frames. Use the special value 0 to just use the final density. With fraction=0, the returned standard deviation is 0.
- Return type
(float, float)
- Returns
The mean density and standard deviation of the density.
- Raises
IOError – If unable to read the volumes from the ene file (from get_prop_from_ene method)
- schrodinger.application.matsci.desmondutils.get_prop_from_ene(ene_file, prop, fraction=0.2, reciprocal=False)[source]¶
Parse the ene file and compute mean and std for a specific property. The property is averaged over the last fraction of frames.
- Parameters
ene_file (str) – The name of the file to read in.
prop (str) – The name of the property to read in
fraction (float) – The fraction of frames to average the density over. For instance, use 0.20 to compute the prop over the final 20% of frames. Use the special value 0 to just use the final density. With fraction=0, the returned standard deviation is 0.
reciprocal (bool) – If True, the mean and std will be done on the reciprocal of the property values.
- Return type
(float, float)
- Returns
The mean property and standard deviation of the property. (or the reciprocal ones if reciprocal=True)
- Raises
IOError – If unable to read the volumes from the ene file
ValueError – If data have zeros, and the reciprocal of them are requested.
- schrodinger.application.matsci.desmondutils.update_pdb_pbc(icms_obj=None, icms_file=None, ocms_file=None)[source]¶
Update the PDB PBC properties given a cms-type input.
- Parameters
icms_obj (
cms.Cms
or None) – input cms.Cms object or None if icms_file is given insteadicms_file (str or None) – input .cms file name or None if icms_obj is given instead
ocms_file (str or None) – if provided the updated cms.Cms will be written to this file, if None then no file will be written
- Raises
RuntimeError – if there is a problem with the input
- Return type
- Returns
the updated cms.Cms
- schrodinger.application.matsci.desmondutils.get_desmond_trj_frames(cms_path=None, traj_dir=None, traj_frames=None)[source]¶
Yield a desmond trajectory frame by frame. The memory taken by the previous frame is released before yielding the next one.
- Parameters
cms_path (
str
or None) – path to the CMS filetraj_dir (
str
or None) – path to trajectory dirtraj_frames (An iterable of trajectory frames) – trajectory to yield
- Raises
RuntimeError – if there is a problem with the input
- Return type
iterator(
schrodinger.application.desmond.packages.traj.frame
)- Returns
an iterator for a trajectory frame
- schrodinger.application.matsci.desmondutils.get_desmond_frames_in_range(traj_dir, trj_min, trj_max, trj_step=None)[source]¶
Get desmond frames from trajectory within the selected range (top and bottom included).
- Parameters
traj_dir (str) – Path to the trajectory directory.
trj_min (int or None) – Index of frame in trajectory to start with. If None it will start from the begining of the trajectory,
trj_max (int or None) – Index of frame in trajectory to end at. If None it will end at the ending of the trajectory
trj_step (int or None) – The step for the trajectory
- Return type
list
- Returns
list of trajectory frames selected
- Raises
ValueError – Will raise if no frames are selected.
- schrodinger.application.matsci.desmondutils.get_desmond_frames_from_options(options)[source]¶
Convenience function to get desmond frames in the range specified by the user from commandline options
- Parameters
options (parserutils.SubscriptableNameSpace) – Parsed commandline options
- Return list
List of trajectory frames
- schrodinger.application.matsci.desmondutils.get_cutoff(length, percent)[source]¶
Get cutoff given length and percent.
- Parameters
length (int) – Length
percent (float) – Percent for the cutoff
- Return int
Cutoff (minimum 1)
- schrodinger.application.matsci.desmondutils.parse_enegrp_file(enegrp_fn, props=('en', 'E_p', 'E_k', 'E_x', 'P', 'V', 'Dispersion_Correction', 'Self_Energy_Correction', 'Net_Charge_Correction', 'Global_Force_Sum', 'Kinetic', 'pair_elec', 'pair_vdw', 'stretch', 'angle', 'dihedral', 'far_exclusion', 'nonbonded_elec', 'nonbonded_vdw', 'far_terms', 'Total', 'Virial', 'K.E.tensor', 'Pressure_Tensor', 'Simulation_Box'))[source]¶
Parse data from a Desmond
*enegrp.dat
file. All the data from the file can be returned in a dictionary where key is the property name and values are dict, key is the time and values are the property value at that time.- Parameters
enegrp_fn (str) – name of enegrp file to read
- Props list props
list of properties to parse. Check ALL_ENEGRP_PROPS for the list of supported properties.
- Return type
dict
- Returns
dictionary where key is the property name and values are namedtuple. The namedtuple has two fields, time and value. The value is the value for the property at that timestep. Value at the timestep can be a float or a list depending on the property.
- schrodinger.application.matsci.desmondutils.get_ptensor_from_enegrp(enegrp_fn, percent_to_avg, log=None)[source]¶
Extract and calculate average pressure from an energy group file.
- Parameters
enegrp_fn (str) – Energy group filename
percent_to_avg (float) – Percent to use when averaging pressure tensor
log (method) – Log method
- Return type
numpy.array()
- Returns
Averaged pressure tensor
- schrodinger.application.matsci.desmondutils.get_lattice_param_from_enegrp(enegrp_fn, percent_to_avg)[source]¶
Extract and calculate average lattice parameter from an energy group file.
- Parameters
enegrp_fn (str) – Energy group filename
percent_to_avg (float) – Percent to use when averaging lattice parameter
- Raises
IOError – fail in reading enegrp file
- Return type
numpy.ndarray
- Returns
Averaged lattice parameters matrix
- schrodinger.application.matsci.desmondutils.get_ptensor_from_trj(trj, percent_to_avg, log=None)[source]¶
Extract and calculate average pressure from trajectory. Trajectory must be in the DTR format trajectory.write_velocity should be True.
- Parameters
trj (str or iterable) – Trajectory directory or iterable trajectory
percent_to_avg (float) – Percent to use when averaging pressure tensor
log (method) – Log method
- Return type
numpy.array
- Returns
Averaged pressure tensor
- schrodinger.application.matsci.desmondutils.get_ptensor_from_plugin(ptensor_fn, percent_to_avg, print_volume=False, log=None)[source]¶
Extract and calculate average pressure from pressure tensor plugin.
- Parameters
ptensor_fn (str) – Output file of ptensor plugin
percent_to_avg (float) – Percent to use when averaging pressure tensor
log (method or None) – Log method. If None, print will be used
- Return type
numpy.array
- Returns
Averaged pressure tensor
- schrodinger.application.matsci.desmondutils.deform_cms_model(model, box, remap=True)[source]¶
Deform the CMS box using values from new_box, and atom coordinates in the model are scaled proportionally to fit the new box if remap=True.
- Parameters
model (
cms.Cms
) – model to modifyremap (bool) – whether to strain the atom coordinates in the cell
box (list) – deform to this box (9 values)
- schrodinger.application.matsci.desmondutils.is_infinite(model)[source]¶
Return a boolean indicating whether the given desmond model has components that are infinitely bonded, meaning that it has bonds that cross the periodic boundary which can not be eliminated by means of molecule contraction.
- Parameters
model (
cms.Cms
) – model to check- Return type
bool
- Returns
True if infinite, False otherwise
- schrodinger.application.matsci.desmondutils.set_physical_properties(model)[source]¶
Set cell formula, volume and density to model.
- Type
- Param
Model to set
- schrodinger.application.matsci.desmondutils.cms_writer(cms_fn_in, cms_fn_out=None)[source]¶
Context manager to modify desmond CMS model.
- with desmondutils.cms_writer(cms_in) as model:
model.set_cts_property(‘r_matsci_real_property’, 11.2)
- Parameters
cms_fn_in (str) – Input CMS filename
cms_fn_in – Output CMS filename. If None, cms_fn_in will be used
- Yield
cms.Cms
- schrodinger.application.matsci.desmondutils.assign_lipid_ff(model)[source]¶
Assign the lipid forcefield to the given model.
- Parameters
model (cms.Cms) – the model containing the lipid
- Raises
ValueError – if there is no known lipid present
- schrodinger.application.matsci.desmondutils.combine_trajectories(trj_path, trj_dirs, trj_int, backend)[source]¶
Combine multiple trajectories into a single one
- Parameters
trj_path (str) – The path to the final trj directory
trj_dirs (list) – List of trajectory directory paths
trj_int (float) – Trajectory recording interval in ps
backend (
schrodinger.job._Backend
or None) – Backend handle, or None if not running under job control
- Return type
None or str
- Returns
The path to the combined trj file, or None if the operation failed
- schrodinger.application.matsci.desmondutils.use_monomer_charges(struct)[source]¶
Add charges to the structure based on the charges computed by monomer. To compute monomer charges we create a fragment for each residue that includes the residue and all attached residues or atoms. Whether attached residues or attached atoms are used depends on the size of the created fragment.
The partial_charge property of atoms in the structure will be modified with the computed charges and also the property ‘r_ffio_custom_charge’ will be added to each atom in the structure to indicate that these charges should be used by the force field
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to compute charges for.
- schrodinger.application.matsci.desmondutils.balance_charge(struct)[source]¶
Ensure that the total of the partial charges on the molecule equals the total of the formal charges.
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to modify
- schrodinger.application.matsci.desmondutils.partial_to_custom_charges(struct)[source]¶
Set the current partial charges as custom FF charges
- Parameters
struct (
schrodinger.structure.Structure
) – The structure to modify
- class schrodinger.application.matsci.desmondutils.AnalysisDriverMixin[source]¶
Bases:
object
Class containing methods that are shared by most trajectory analysis drivers.
- setDefaultAnalysisParams(opts, static_allowed=False)[source]¶
Set default class variables that all trajectory analysis drivers use.
- Parameters
opts (parserutils.SubscriptableNameSpace) – options for running the driver
static_allowed (bool) – whether static frames are allowed
- trjFrames()[source]¶
Yield the trajectory frame by frame. The memory taken by the previous frame is released before yielding the next one.
- Return type
iterator(
schrodinger.application.desmond.packages.traj.frame
)- Returns
an iterator for trajectory frames
- getOutfileName(extension, add_to_backend=True)[source]¶
Get an outfile name by appending the extension to the job name
- Parameters
add_to_backend (bool) – Whether the outfile should be added to backend
- Return str
The outfile name
- writeOutputCmsAndData(wam_type, per_structure_wam=False)[source]¶
Write the modified cms_model and set it as output structure. If a data file is generated (data_filename) if will be added to the backend.
- Parameters
wam_type (int) – One of the enums defined in workflow_action_menu.h
per_structure_wam (bool) – Whether the WAM should be set on the cms model instead of file-level
- schrodinger.application.matsci.desmondutils.validate_ff_and_water_model(ffld, model)[source]¶
Verify that the chosen water model is compatible with the chosen forcefield
- Parameters
ffld (str) – The name of the forcefield
model (str) – The name of the water model. From water combobox use currentData method.
- Return type
True or (False, str)
- Returns
The return type is compatible with AF2 validators. Either True if everything is OK, or False with an error message if not.
- schrodinger.application.matsci.desmondutils.struct_has_ffio_ct_type(st)[source]¶
Return True if the given structure has the ‘s_ffio_ct_type’ property defined.
- Parameters
st (
schrodinger.structure.Structure
) – structure to check- Return type
bool
- Returns
True if defined
- schrodinger.application.matsci.desmondutils.get_cms_and_trj_path_from_st(struct)[source]¶
- Get trajectory and cms path for the passed structure in maestro
using structure property
- Parameters
schrodinger.structure.Structure (struct) – Structure to get associated cms and trajectory of
str (source_path) – Path to source cms and trj folder
- Return str,str
Path to the cms file trajectory frames if both are found.
- schrodinger.application.matsci.desmondutils.make_pos_restraints(model, asl, force_const=500.0)[source]¶
Create kwargs that can be used in MD MSJ stringers to restrain atoms
- Parameters
model (cms.Cms) – the Desmond system that you want to restrain
asl (str) – the atom-specification-language string used to identify the atoms in the system that should be restrained
force_const (float) – the force constant of the restraints that you want imposed on the specified atoms, in units of kcal/mol/Ang^2
- Return type
dict(str=str)
- Returns
key-word arguments that can be passed to
MDMSJStringer
to restrain the atoms