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

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.

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

&

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.

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.