Package schrodinger :: Package application :: Package matsci :: Module desmondutils :: Class MSJStringer
[hide private]
[frames] | no frames]

Class MSJStringer

object --+
         |
        MSJStringer
Known Subclasses:

A base class for setting up the information and generating a string describing that information for a stage in a Desmond MSJ file.

Instance Methods [hide private]
 
__init__(self, stype, last=False, use_base=True, **kwargs)
Create a MSJStringer object
str
createString(self)
Create and return the string that represents this stage in the .msj file
str
formLine(self, key, value)
Create the line that should go in the .msj file for this key.
str
getTitle(self)
This function returns a title for the stage describing the main parameters.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DOT = '_dot_'
  MAX_STEPS = 'max_steps'
  TIME = 'time'
  TEMP = 'temperature'
  PRESSURE = 'pressure'
  ENSEMBLE = 'ensemble'
  ENSEMBLE_CLASS = 'ensemble.class'
  ENSEMBLE_METHOD = 'ensemble.method'
  TIMESTEP = 'timestep'
  JOBNAME = 'jobname'
  CHECKPOINT = 'checkpt.write_last_step'
  DIR = 'dir'
  COMPRESS = 'compress'
  INTERVAL = 'trajectory_dot_interval'
  ANALYSIS_TYPE = 'analysis_type'
  OTHERS = 'othertag'
  MSJ_BASE = {'checkpt.write_last_step': 'yes', 'jobname': '"$MA...
  MSJ_LAST = {'compress': '""', 'dir': '"."'}
  LINE_ORDER = ['max_steps', 'analysis_type', 'time', 'timestep'...
  KNOWN_LINES = set(['analysis_type', 'checkpt.write_last_step',...
  MINIMIZE = 'minimize'
  SIMULATE = 'simulate'
  ANALYSIS = 'matsci_analysis'
  SYSBUILD = 'assign_forcefield'
  SETTINGS = {'assign_forcefield': None, 'matsci_analysis': None...
  PADDING = ' '
  INDENT = ' '
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, stype, last=False, use_base=True, **kwargs)
(Constructor)

 

Create a MSJStringer object

Parameters:
  • stype (str) - The type of stage this is. Should be one of the class constants MINIMIZE, SIMULATE, SYSBUILD or ANALYSIS
  • 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'

Overrides: object.__init__

createString(self)

 

Create and return the string that represents this stage in the .msj file

Returns: str
The msj string representing this stage

formLine(self, 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.
Returns: str
The line (or lines) to put in the .msj file for this key/value pair

getTitle(self)

 

This function returns a title for the stage describing the main parameters. The default implementation has no title.

Returns: str
The title for this stage

Class Variable Details [hide private]

MSJ_BASE

Value:
{'checkpt.write_last_step': 'yes', 'jobname': '"$MASTERJOBNAME"'}

LINE_ORDER

Value:
['max_steps',
 'analysis_type',
 'time',
 'timestep',
 'ensemble',
 'ensemble.class',
 'ensemble.method',
 'temperature',
...

KNOWN_LINES

Value:
set(['analysis_type',
     'checkpt.write_last_step',
     'compress',
     'dir',
     'ensemble',
     'ensemble.class',
     'ensemble.method',
     'jobname',
...

SETTINGS

Value:
{MINIMIZE: config.DEFAULT_SETTING.MINIMIZE, SIMULATE: config.DEFAULT_S\
ETTING.MD, ANALYSIS: None, SYSBUILD: None}