schrodinger.application.jaguar.reactiq_input module¶
Functions and classes for defining the input to a Reactiq workflow.
-
class
schrodinger.application.jaguar.reactiq_input.
ReactiqInput
(inputfile=None, keywords=None, jaguar_keywords=None, jobname=None, add_autots_jaguar_defaults=False)¶ Bases:
object
A class to completely specify a Reactiq calculation.
Example usage:
input = ReactiqInput() # Set user-defined values input.setValue(‘integerKW’, 3) input.setValue(‘floatKW’, ‘7.0’) input.setValue(‘stringKW’, ‘foo’)
# Print all keyword/value pairs. for keyword in input:
print “keyword ‘%s’ has value %s” % (keyword, input[keyword])# Handling the case of trying to set an unsupported keyword try:
input[‘mykeyword’] = ‘value’- except ReactiqKeywordException as e:
- print e.allowed_keywords
-
__init__
(inputfile=None, keywords=None, jaguar_keywords=None, jobname=None, add_autots_jaguar_defaults=False)¶ Create a ReactiqInput instance. If a keyword is specified in both ‘inputfile’ and ‘keywords’, then the values in ‘keywords’ will be set preferrentially. This also applies to ‘jaguar_keywords’.
Parameters: - inputfile (str) – Path to a Reactiq input file
- keywords (dict) – Reactiq keyword/value pairs
- jaguar_keywords (dict) – Jaguar &gen section keyword/value pairs
- jobname (string) – Name of job, if it is not None it will be set to the basename of the input file name.
- add_autots_jaguar_defaults (boolean) – if True add some custom Jaguar defaults
-
__iter__
()¶ Provide convenient way to iterate over the keywords.
-
keywords
¶
-
values
¶ Support access to ReactiqKeyword values via attribute syntax. e.g.
ri = ReactiqInput() print ri.values.optimize # print ‘optimize’ keyword value
-
getValue
(keyword)¶ Return the value for Reactiq keyword. The return type depends on the keyword.
Parameters: keyword (string) – name of keyword :raise ReactiqKeywordError if no keyword found
-
setValue
(keyword, value)¶ Set the Reactiq keyword ‘keyword’ to value ‘value’. Note that there may be type-checking and conversion by the ReactiqKeyword class.
If ‘value’ is None, the keyword will be reset.
Parameters: - keyword (string) – name of keyword
- value (anytype) – value of keyword
:raise ReactiqKeywordError if no keyword found
-
__getitem__
(keyword)¶ Return the value for Reactiq keyword. The return type depends on the keyword.
Parameters: keyword (string) – name of keyword :raise ReactiqKeywordError if no keyword found
-
__setitem__
(keyword, value)¶ Set the Reactiq keyword ‘keyword’ to value ‘value’. Note that there may be type-checking and conversion by the ReactiqKeyword class.
If ‘value’ is None, the keyword will be reset.
Parameters: - keyword (string) – name of keyword
- value (anytype) – value of keyword
:raise ReactiqKeywordError if no keyword found
-
setValues
(keywords)¶ Set multiple Reactiq keywords.
Parameters: keywords (dict of string/anytype pairs) – keyword/value pairs
-
getJaguarValue
(key)¶ Return the value for Jaguar keyword ‘key’. The return type depends on the keyword.
Parameters: key (string) – name of keyword
-
setJaguarValue
(key, value)¶ Set the Jaguar &gen section keyword ‘key’ to value ‘value’.
Parameters: - key (string) – name of keyword
- value (anytype) – value of keyword
:raise JaguarKeywordException if keyword is invalid
-
setJaguarValues
(keywords)¶ Set multiple Jaguar &gen section keywords.
Parameters: keywords (dict of string/anytype pairs) – Jaguar &gen section keyword/value pairs
-
getJaguarNonDefault
()¶ Return a dictionary of all non-default Jaguar keys except ‘multip’ and ‘molchg’, which must be retrieved explicitly.
-
resetKey
(keyword)¶ Reset keyword to default state.
Parameters: keyword (string) – name of keyword
-
resetAll
()¶ Reset all keywords to their default states.
-
getDefault
(keyword)¶ Return the default value for Reactiq keyword ‘keyword’. The return type depends on the keyword.
Parameters: keyword (string) – name of keyword :raise ReactiqKeywordError if no keyword found
-
getNonDefaultKeys
()¶ Return a dictionary of all non-default-value ReactiqKeyword instances indexed by name.
-
getNonDefaultJaguarKeys
()¶ Return a dictionary of all non-default-value Jaguar keywords
-
isNonDefault
(keyword)¶ Has the specified keyword been set to a non-default value?
Parameters: keyword (str) – The key to check Returns: True if the specified keyword is set to a non-default value. False otherwise.
-
getReactants
(fileonly=False, clean_st=False)¶ Return list of reactants. If no file(s) found, return empty list.
Parameters: - fileonly (bool) – if True, return only file paths, else Structures.
- clean_st (bool) – if True redefine bonding using mmlewis.
Returns: reactant Structures or file paths.
-
getProducts
(fileonly=False, clean_st=False)¶ Return list of products. If no file(s) found, return empty list.
Parameters: - fileonly (bool) – if True, return only file paths, else Structures.
- clean_st (bool) – if True redefine bonding using mmlewis.
Returns: product Structures or file paths.
-
getReactantComplex
(fileonly=False, clean_st=False)¶ Return Reactant Complex. If no file found, return NoneType.
Parameters: - fileonly (bool) – if True, return only file paths, else Structures.
- clean_st (bool) – if True redefine bonding using mmlewis.
Returns: Reactant Complex Structures or file path.
-
getProductComplex
(fileonly=False, clean_st=False)¶ Return Product Complex. If no file found, return NoneType.
Parameters: - fileonly (bool) – if True, return only file paths, else Structures.
- clean_st (bool) – if True redefine bonding using mmlewis.
Returns: Product Complex Structures or file path.
-
getReferenceReactantComplex
(fileonly=False, clean_st=False)¶ Return Reference Reactant Complex. If no file found, return NoneType.
Parameters: - fileonly (bool) – if True, return only file paths, else Structures.
- clean_st (bool) – if True redefine bonding using mmlewis.
Returns: Reactant Complex Structures or file path.
-
getReferenceProductComplex
(fileonly=False, clean_st=False)¶ Return Reference Product Complex. If no file found, return NoneType.
Parameters: - fileonly (bool) – if True, return only file paths, else Structures.
- clean_st (bool) – if True redefine bonding using mmlewis.
Returns: Product Complex Structures or file path.
-
setConstraints
(constraints)¶ Set the constraints.
Parameters: constraints (dict) – dictionary relating structure title to a list of Coordinate instances which define the constraints
-
getConstraints
()¶ Return the constraints defined in the input file
Returns: a dict relating structure titles to constraints the constraints are given as a list of Coordinate instances and the titles refer to the titles of the input reactant and product molecules.
-
validate
()¶ Perform a self-consistency check of all currently set keywords.
:raise ReactiqKeywordConflictError if conflicting values found :raise ReactiqConservationError if matter not conserved
-
validate_jaguar_keywords
()¶ Perform a check to ensure that Jaguar keywords are not set that AutoTS cannot handle.
-
validate_constraints
()¶ Validate any constraints that have been read. This ensures that the constraints can be mapped onto the input reactant/product molecules.
- Specifically the properties that are required are:
- relax_path = True cannot be set if we have constraints
- The input reactants and products must have unique titles
- Each constraint must map to some titled molecule or COMPLEX_STRUCTURE_CONSTRAINT if both reactant and product complexes are defined
- Atom indexes of the constraint must be between 1 and the number of atoms in that molecule.
- constraints cannot be in rings
- Atom indexes for complex constraints cannot span multiple molecules.
-
validate_structures
()¶ Perform a check to ensure that matter is conserved and that charge/multiplicity are consistent with structures.
A ReactiqConservationError is raised if any test fails.
-
save
(name)¶ Create a Reactiq input file called ‘name’ in the current working directory based on this class instance. Only write the non-default keyword values.
Parameters: name (str) – Path to a Reactiq input file
-
setConstants
()¶ Set any constants defined by keywords
-
setJobname
(jobname)¶ Set the attribute jobname.
Parameters: jobname (string) – input name of job. If jobname is None we try to use self._inputfile. If that is also None we assign a unique name.
-
read
(inputfile)¶ Read an existing Reactiq input file. Any keywords specified in the input file will override existing values in this ReactiqInput instance.
- Jaguar &gen section keywords are defined like:
- &JaguarKeywords
- key=val key=val …
&
- Constraints can be defined with
- &Constraints
- st_title atom_index1 atom_index2… value
&
Parameters: inputfile (str) – Path to a Reactiq input file
-
set_default_template_file
()¶ If the default template file is not set and the keyword use_default_templates is True and that file exists, set the template file to the default one.
-
remove_input_file_paths
()¶ Remove full paths from file specifications. A new input file is no longer written, if that is desired the user must call the save method.
-
update_input_file_paths
()¶ Update full paths for file specifications to reflect the CWD. This is useful if running this job in a subdirectory or on a remote host.
-
get_input_files
()¶ Return set of expected input files.
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.jaguar.reactiq_input', '__doc__': '\n A class to completely specify a Reactiq calculation.\n\n Example usage:\n\n input = ReactiqInput()\n # Set user-defined values\n input.setValue(\'integerKW\', 3)\n input.setValue(\'floatKW\', \'7.0\')\n input.setValue(\'stringKW\', \'foo\')\n\n # Print all keyword/value pairs.\n for keyword in input:\n print "keyword \'%s\' has value %s" % (keyword, input[keyword])\n\n # Handling the case of trying to set an unsupported keyword\n try:\n input[\'mykeyword\'] = \'value\'\n except ReactiqKeywordException as e:\n print e.allowed_keywords\n ', '__init__': <function ReactiqInput.__init__>, '__iter__': <function ReactiqInput.__iter__>, 'keywords': <property object>, 'values': <property object>, 'getValue': <function ReactiqInput.getValue>, 'setValue': <function ReactiqInput.setValue>, '__getitem__': <function ReactiqInput.getValue>, '__setitem__': <function ReactiqInput.setValue>, 'setValues': <function ReactiqInput.setValues>, 'getJaguarValue': <function ReactiqInput.getJaguarValue>, 'setJaguarValue': <function ReactiqInput.setJaguarValue>, 'setJaguarValues': <function ReactiqInput.setJaguarValues>, 'getJaguarNonDefault': <function ReactiqInput.getJaguarNonDefault>, '_addAutoTSJaguarDefaults': <function ReactiqInput._addAutoTSJaguarDefaults>, 'resetKey': <function ReactiqInput.resetKey>, 'resetAll': <function ReactiqInput.resetAll>, 'getDefault': <function ReactiqInput.getDefault>, 'getNonDefaultKeys': <function ReactiqInput.getNonDefaultKeys>, 'getNonDefaultJaguarKeys': <function ReactiqInput.getNonDefaultJaguarKeys>, 'isNonDefault': <function ReactiqInput.isNonDefault>, 'getReactants': <function ReactiqInput.getReactants>, 'getProducts': <function ReactiqInput.getProducts>, 'getReactantComplex': <function ReactiqInput.getReactantComplex>, 'getProductComplex': <function ReactiqInput.getProductComplex>, 'getReferenceReactantComplex': <function ReactiqInput.getReferenceReactantComplex>, 'getReferenceProductComplex': <function ReactiqInput.getReferenceProductComplex>, 'setConstraints': <function ReactiqInput.setConstraints>, 'getConstraints': <function ReactiqInput.getConstraints>, 'validate': <function ReactiqInput.validate>, 'validate_jaguar_keywords': <function ReactiqInput.validate_jaguar_keywords>, 'validate_constraints': <function ReactiqInput.validate_constraints>, 'validate_structures': <function ReactiqInput.validate_structures>, 'save': <function ReactiqInput.save>, 'setConstants': <function ReactiqInput.setConstants>, 'setJobname': <function ReactiqInput.setJobname>, 'read': <function ReactiqInput.read>, 'set_default_template_file': <function ReactiqInput.set_default_template_file>, 'remove_input_file_paths': <function ReactiqInput.remove_input_file_paths>, 'update_input_file_paths': <function ReactiqInput.update_input_file_paths>, 'get_input_files': <function ReactiqInput.get_input_files>, '_parse_keyword_line': <function ReactiqInput._parse_keyword_line>, '_parse_constraint_line': <function ReactiqInput._parse_constraint_line>, '__dict__': <attribute '__dict__' of 'ReactiqInput' objects>, '__weakref__': <attribute '__weakref__' of 'ReactiqInput' objects>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.jaguar.reactiq_input'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
schrodinger.application.jaguar.reactiq_input.
users_default_template_filename
()¶ Returns the name of the users template file that should be found in .schrodinger/autots_templates. The file may or may not exist.