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
Known Subclasses:

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.
 
_mungeBeforeValidation(self)
 
validateValues(self, *args, **kwargs)
Validate the keywords against the spec.
 
_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.
 
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.
 
checkConflicts(self)
Check for invalid keyword combinations.
 
setupJson(self, jsdict)
Additional setup to do before writing a JSON file.
 
checkForceFieldLicense(self, jsdict)
If we are using the default forcefield (OPLS3) and don't have an OPLS license, fall back to using OPLS_2005.
 
writeJSON(self)
Write the keywords as a JSON representation.

Inherited from inputconfig.InputConfig: getSpecsString, printout, 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__

validateValues(self, *args, **kwargs)

 

Validate the keywords against the spec. Unlike the parent implementation, raise a ValueError if any unknown keywords are present.

Parameters:
  • preserve_errors - If set to False, this method returns True if all tests passed, and False if there is a failure. If set to True, then instead of getting False for failed checkes, the actual detailed errors are printed for any validation errors encountered.

    Even if preserve_errors is True, missing keys or sections will still be represented by a False in the results dictionary.

  • copy - If False, default values (as specified in the 'specs' strings in the constructor) will not be copied to object's "defaults" list, which will cause them to not be written out when writeInputFile() method is called. If True, then all keywords with a default will be written out to the file via the writeInputFile() method. NOTE: Default is True, while in ConfigObj default is False.
Overrides: inputconfig.InputConfig.validateValues

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

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().

checkConflicts(self)

 

Check for invalid keyword combinations. Raises a ValueError if any are found.

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.