Package schrodinger :: Package application :: Package glide :: Module glide :: Class GlideJob
[hide private]
[frames] | no frames]

Class GlideJob

   object --+                
            |                
         dict --+            
                |            
configobj.Section --+        
                    |        
  configobj.ConfigObj --+    
                        |    
  inputconfig.InputConfig --+
                            |
                           GlideJob

Class for writing Glide input files - either Gridgen or Docking. The keywords passed are used to set MMIM directly with no processing.

Instance Methods [hide private]
new empty dictionary

__init__(self, jobtype=None, specs=None, keywords=None, createhandle=False)
Specify a dictionary of keywords, where the key is the short keyword name and the value is what is should be set to.
 
_applyKeyword(self, keyname, value)
Calls appropriate MMIM APIs to "set" the <keyname> keyword to the specified value.
 
_getAndApplyKeyword(self, username, default=None)
Calls appropriate MMIM APIs to "set" the <username> keyword to the value that the user specified for this keyword.
D[k] if k in D, else d
get(self, key, default=None)
A version of ``get`` that doesn't bypass string interpolation.
Tuple of 2 ints/floats.
getAllowedRange(self, key)
Will return a tuple of (min, max) for the allowed range of value.
 
setup(self)
This function is overridden by the Gridgen and Docking classes.
 
cleanup(self)
Clean up constraints objects.
 
writeSimplified(self, filename=None, yesno=False)
Writes a simplified input file to "<jobname>.inp".
 
applyContextDependentDefaults(self)
Apply context-dependent defaults for a Glide job.
 
setupJson(self, jsdict)
Additional setup to do before writing a JSON file.
 
writeJSON(self)
Write the keywords as a JSON representation.
string
writeDice(self)
Writes the DICE input file to "<jobname>.inp".

Inherited from inputconfig.InputConfig: getSpecsString, printout, validateValues, writeInputFile

Inherited from inputconfig.InputConfig (private): _quote

Inherited from configobj.ConfigObj: __repr__, reload, reset, validate, write

Inherited from configobj.ConfigObj (private): _a_to_u, _decode, _decode_element, _get_single_quote, _get_triple_quote, _handle_bom, _handle_comment, _handle_configspec, _handle_error, _handle_value, _initialise, _load, _match_depth, _multiline, _parse, _set_configspec, _str, _unquote, _write_line, _write_marker

Inherited from configobj.Section: __delitem__, __getitem__, __iter__, __reduce__, __setitem__, __setstate__, __str__, as_bool, as_float, as_int, as_list, clear, dict, items, iteritems, iterkeys, itervalues, keys, merge, pop, popitem, rename, restore_default, restore_defaults, setdefault, update, values, walk

Inherited from configobj.Section (private): _interpolate

Inherited from dict: __cmp__, __contains__, __eq__, __ge__, __getattribute__, __gt__, __le__, __len__, __lt__, __ne__, __new__, __sizeof__, copy, fromkeys, has_key, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]

Inherited from configobj.ConfigObj (private): _bools, _keyword, _listvalueexp, _multi_line_double, _multi_line_single, _nolistvalue, _sectionmarker, _single_line_double, _single_line_single, _triple_quote, _valueexp

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, jobtype=None, specs=None, keywords=None, createhandle=False)
(Constructor)

 

Specify a dictionary of keywords, where the key is the short keyword name and the value is what is should be set to. For indexed keywords, the value needs to be a list. It is also possible to specify a file path to a simplified input file that contains the keywords.

Parameters:
  • infile - The name of the input file.
  • specs - A list of strings, each in the format <keywordname> = <validator>(<validatoroptions>). An example string is NUM_RINGS = integer(min=1, max=100, default=1). For available validators, see: http://www.voidspace.org.uk/python/validate.html.
Returns:
new empty dictionary

Overrides: object.__init__

_applyKeyword(self, keyname, value)

 

Calls appropriate MMIM APIs to "set" the <keyname> keyword to the specified value. Conversion to the correct type is performed if necessary.

_getAndApplyKeyword(self, username, default=None)

 

Calls appropriate MMIM APIs to "set" the <username> keyword to the value that the user specified for this keyword. If the keyword was not specified, but 'default' is provided, set the value to 'default'.

Returns the value that is set or None if not set.

get(self, key, default=None)

 

A version of ``get`` that doesn't bypass string interpolation.

Returns: D[k] if k in D, else d
Overrides: dict.get
(inherited documentation)

getAllowedRange(self, key)

 

Will return a tuple of (min, max) for the allowed range of value. Either or both of these values may be None.

Returns: Tuple of 2 ints/floats.
The allowed min/max range.

setup(self)

 

This function is overridden by the Gridgen and Docking classes. NOT IMPLEMENTED in the base class.

writeSimplified(self, filename=None, yesno=False)

 

Writes a simplified input file to "<jobname>.inp". This input file needs to be run via $SCHRODINGER/glide.

applyContextDependentDefaults(self)

 

Apply context-dependent defaults for a Glide job. It modifies the job object, but marks the modified keywords as "default" so they won't be written by writeSimplified().

setupJson(self, jsdict)

 

Additional setup to do before writing a JSON file. Base implementation does nothing. This method is expected not to modify 'self', but only jsdict, which is the dictionary of keywords that ultimately will be written to the JSON file.

writeJSON(self)

 

Write the keywords as a JSON representation. Unlike writeSimplified, this includes the values for all the keywords, not only the non-default ones.

writeDice(self)

 

Writes the DICE input file to "<jobname>.inp".

Returns: string
The input file name.
Raises:
  • RuntimeError - If the grid specification is incomplete (Docking) or if there is a problem with an mm.mmim* call.