schrodinger.application.jaguar.autots_input module¶
Functions and classes for defining the input to a AutoTS workflow.
-
schrodinger.application.jaguar.autots_input.
read_mae_files
(fhlist, fileonly, clean_st, reset_bonding=True)[source]¶ Process a list of mae files and return extant file paths or associated Structure instances if requested.
- Parameters
fhlist (list of strings) – list of filehandles
fileonly (bool) – if True, return only file paths, else Structures.
clean_st (bool) – if True, cleanup structure file by removing dummy atoms, etc.
reset_bonding (bool) – if True and clean_st is True, redefine bonding using mmjag.
- Returns
Structures or file paths.
-
class
schrodinger.application.jaguar.autots_input.
AutoTSInput
(inputfile=None, keywords=None, jaguar_keywords=None, jobname=None, add_autots_jaguar_defaults=False)[source]¶ Bases:
schrodinger.application.jaguar.workflow_input.WorkflowInput
A class to completely specify a AutoTS calculation.
Example usage:
input = AutoTSInput() # 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 WorkflowKeywordException as e:
print e.allowed_keywords
-
input_file_keys
= ['reactant', 'product', 'reactant_complex', 'product_complex', 'reference_reactant_complex', 'reference_product_complex', 'template_database_file', 'full_path_file', 'spectators']¶
-
workflow_name
= 'AutoTS'¶
-
__init__
(inputfile=None, keywords=None, jaguar_keywords=None, jobname=None, add_autots_jaguar_defaults=False)[source]¶ Create a AutoTSInput 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 AutoTS input file
keywords (dict) – AutoTS 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
-
property
reaction_smarts
¶ Reaction smarts identifying input reaction
-
setJaguarValues
(keywords)[source]¶ Set multiple Jaguar &gen section keywords.
- Parameters
keywords (dict of string/anytype pairs) – Jaguar &gen section keyword/value pairs
-
updateJaguarUserKeywords
(keywords)[source]¶ Update the Jaguar &gen section keywords of the user-defined settings only if previous settings exist.
- Parameters
keywords (dict of string/anytype pairs) – Jaguar &gen section keyword/value pairs
-
getReactants
(fileonly=False, clean_st=False, reset_bonding=True)[source]¶ 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.
reset_bonding (bool) – if True and clean_st is True, redefine bonding using mmjag.
- Returns
reactant Structures or file paths.
-
getProducts
(fileonly=False, clean_st=False, reset_bonding=True)[source]¶ 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.
reset_bonding (bool) – if True and clean_st is True, redefine bonding using mmjag.
- Returns
product Structures or file paths.
-
getReactantComplex
(fileonly=False, clean_st=False, reset_bonding=True)[source]¶ 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.
reset_bonding (bool) – if True and clean_st is True, redefine bonding using mmjag.
- Returns
Reactant Complex Structures or file path.
-
getProductComplex
(fileonly=False, clean_st=False, reset_bonding=True)[source]¶ 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.
reset_bonding (bool) – if True and clean_st is True, redefine bonding using mmjag.
- Returns
Product Complex Structures or file path.
-
getReferenceReactantComplex
(fileonly=False, clean_st=False, reset_bonding=True)[source]¶ 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.
reset_bonding (bool) – if True and clean_st is True, redefine bonding using mmjag.
- Returns
Reactant Complex Structures or file path.
-
getReferenceProductComplex
(fileonly=False, clean_st=False, reset_bonding=True)[source]¶ 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.
reset_bonding (bool) – if True and clean_st is True, redefine bonding using mmjag.
- Returns
Product Complex Structures or file path.
-
getSpectators
(fileonly=False, clean_st=False)[source]¶ Return spectator. 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.
-
validate
()[source]¶ Perform a self-consistency check of all currently set keywords.
:raise WorkflowKeywordConflictError if conflicting values found :raise WorkflowConservationError if matter not conserved
-
validate_jaguar_keywords
(strs)[source]¶ Perform a check to ensure that Jaguar keywords are not set that AutoTS cannot handle.
-
read
(inputfile)[source]¶ Read an existing AutoTS input file. Any keywords specified in the input file will override existing values in this AutoTSInput 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 AutoTS input file
-
set_default_template_file
()[source]¶ 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.
-
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 molecules.
-
getDefault
(keyword)¶ Return the default value for Workflow keyword ‘keyword’. The return type depends on the keyword.
- Parameters
keyword (string) – name of keyword
:raise WorkflowKeywordError if no keyword found
-
getFrozenAtoms
()¶ Return the frozen atoms defined in the input file :return: 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 molecules.
-
getJaguarNonDefault
()¶ Return a dictionary of all non-default Jaguar keys except ‘multip’ and ‘molchg’, which must be retrieved explicitly.
-
getJaguarValue
(key)¶ Return the value for Jaguar keyword ‘key’. The return type depends on the keyword.
- Parameters
key (string) – name of keyword
-
getNonDefaultKeys
()¶ Return a dictionary of all non-default-value WorkflowKeyword instances indexed by name.
-
getValue
(keyword)¶ Return the value for Workflow keyword. The return type depends on the keyword.
- Parameters
keyword (string) – name of keyword
:raise WorkflowKeywordError if no keyword found
-
get_input_files
()¶ Return set of expected input files.
-
have_constraints
()¶ Do we have internal coordinate constraints
-
have_frozen_atoms
()¶ Do we have frozen atom constraints
-
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.
-
property
keywords
¶
-
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.
-
resetAll
()¶ Reset all keywords to their default states.
-
resetKey
(keyword)¶ Reset keyword to default state.
- Parameters
keyword (string) – name of keyword
-
save
(name)¶ Create a Workflow 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 Workflow input file
-
setConstraints
(constraints)¶ Set the constraints.
- Parameters
constraints (dict of str: Coordinate instance) – dictionary relating structure title to a list of Coordinate instances which define the constraints
-
setFrozenAtoms
(frozen_atoms)¶ Set the constraints.
- Parameters
frozen_atoms (dict of str: Coordinate instance) – dictionary relating structure title to a list of Coordinate instances which define the frozen atoms
-
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
-
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.
-
setValue
(keyword, value)¶ Set the Workflow keyword ‘keyword’ to value ‘value’. Note that there may be type-checking and conversion by the WorkflowKeyword class.
If ‘value’ is None, the keyword will be reset.
- Parameters
keyword (string) – name of keyword
value (anytype) – value of keyword
:raise WorkflowKeywordError if no keyword found
-
setValues
(keywords)¶ Set multiple Workflow keywords.
- Parameters
keywords (dict of string/anytype pairs) – keyword/value pairs
-
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.
-
property
values
¶ Support access to WorkflowKeyword values via attribute syntax. e.g.
wi = WorkflowInput() print wi.values.optimize # print ‘optimize’ keyword value