schrodinger.application.matsci.reaction_workflow_utils module

Utilities for reaction workflows.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.reaction_workflow_utils.ReactionWorkflow(reaction_wf_input_sts, n_conformers=5, seed=123, return_csearch_files=False, jaguar_keywords=OrderedDict([('dftname', 'B3LYP'), ('basis', 'LACVP**')]), return_jaguar_files=False, tpp=1, logger=None)

Bases: object

Manage a reaction workflow.

createConformers()

Create the conformers.

prepareOutput()

Prepare output.

run()

Run the reaction workflow.

runJMSWF()

Run the Jaguar multistage workflow.

exception schrodinger.application.matsci.reaction_workflow_utils.ReactionWorkflowException

Bases: exceptions.Exception

schrodinger.application.matsci.reaction_workflow_utils.bin_structures_by_property(sts, key='s_matsci_Reaction_Workflow_Conformers_Group')

Return a dictionary of structures binned by a property with the given key.

Parameters:
  • sts (list) – the structures
  • key (str) – the key for the property by which to bin
Return type:

dict

Returns:

dictionary where keys are properties and values are lists of structures

schrodinger.application.matsci.reaction_workflow_utils.check_conformers(conformers, conformers_group_hash)

Check conformers.

Parameters:
  • conformers (list) – contains schrodinger.structure.Structure of conformers
  • conformers_group_hash (str) – a group hash
Raises:

ValueError – if invalid

schrodinger.application.matsci.reaction_workflow_utils.check_ff_assignment(sts, ffld_name='OPLS3')

Check the assignment of the given force field to the given structures.

Parameters:
  • sts (list) – contains schrodinger.structure.Structure
  • ffld_name (str) – the force field name
Raises:

ValueError – if invalid

schrodinger.application.matsci.reaction_workflow_utils.check_reaction_wf_structures(rxn_sts, ffld_name=None)

Check the given reaction workflow structues.

Parameters:
  • rxn_sts (str or list) – the reaction workflow structures, a file name or list of schrodinger.structure.Structure
  • ffld_name (str) – the force field name to use when optionally checking its assignment to the given structures
Raises:

ValueError – if invalid

schrodinger.application.matsci.reaction_workflow_utils.get_int_tuples_from_str_property(st, key, separator=';')

Return a list of tuples of integers from the given string structure property.

Parameters:
Return type:

list

Returns:

contains tuples of integers

schrodinger.application.matsci.reaction_workflow_utils.get_jaguar_keywords_list(jaguar_keywords_dict)

Return the Jaguar keywords list from the given dict.

Parameters:jaguar_keywords_dict (OrderedDict) – the Jaguar keywords dict
Return type:list
Returns:the Jaguar keywords list

Perform a restrained MacroModel conformational search seeded with the given conformers.

Parameters:
  • conformers (list) – schrodinger.structure.Structure conformers used to seed the search
  • n_conformers (int) – number of sought conformers
  • restrain_idxs (list) – indices to restrain
  • seed (int) – seed for random number generator
  • launch_dir (str) – a launch subdirectory to use for the job
  • base_name (str) – a base name to use for file and job naming
  • job_dj (queue.JobDJ) – if an instance is given then add the current job and return
  • clean (bool) – if not given a job_dj then this option controls cleaning up after the job that was run
Raises:

RuntimeError – if the MacroModel job fails

Return type:

list

Returns:

schrodinger.structure.Structure conformers, could be less than n_conformers

schrodinger.application.matsci.reaction_workflow_utils.type_cast_jaguar_keywords(jaguar_keywords, reserved_keys=set(['multip', 'itrvec', 'ifreq', 'nhesref', 'molchg', 'igeopt']), exception_type=<class 'argparse.ArgumentTypeError'>)

Type cast the Jaguar keywords.

Parameters:
  • jaguar_keywords (str or unicode or list) – the Jaguar keywords, a whitespace delimited string of ‘<key>=<value>’ tokens or a list of such tokens
  • reserved_keys (set) – contains reserved Jaguar keys
  • exception_type (type) – the exception type to raise if invalid
Return type:

OrderedDict

Returns:

the Jaguar keywords OrderedDict

schrodinger.application.matsci.reaction_workflow_utils.type_cast_reaction_wf_input(reaction_wf_input, exception_type=<class 'argparse.ArgumentTypeError'>)

Type cast the reaction workflow input.

Parameters:
  • reaction_wf_input (str or unicode or list) – the reaction workflow input, a file name or list of schrodinger.structure.Structure
  • exception_type (type) – the exception type to raise if invalid
Return type:

str or list

Returns:

the reaction workflow input, a file name or list of schrodinger.structure.Structure

schrodinger.application.matsci.reaction_workflow_utils.type_cast_seed(seed, exception_type=<class 'argparse.ArgumentTypeError'>)

Type cast the seed.

Parameters:
  • seed (str or unicode) – seed for random number generator
  • exception_type (type) – the exception type to raise if invalid
Return type:

int

Returns:

the seed