schrodinger.application.matsci.reaction_workflow_utils module

Utilities for reaction workflows.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.reaction_workflow_utils.get_idxs_marked_atoms(st, prop)

Return a list of indices of atoms in the given structure that have the given property defined.

Parameters:
Return type:

list

Returns:

contains indices of atoms

schrodinger.application.matsci.reaction_workflow_utils.get_restrain_atom_idxs(st)

Return a list of indices of restrain atoms in the given structure.

Parameters:st (schrodinger.structure.Structure) – the structure
Return type:list
Returns:contains indices of restrain atoms
exception schrodinger.application.matsci.reaction_workflow_utils.InvalidInput

Bases: Exception

schrodinger.application.matsci.reaction_workflow_utils.get_idx_groups(text)

Get index groups from the given string.

Parameters:text (str) – the string
Raise:InvalidInput if there is a formatting issue
Return type:list
Returns:contains list of indices
schrodinger.application.matsci.reaction_workflow_utils.get_restrain_distance_idxs(st)

Return a list of lists of indices of restrain distances in the given structure.

Parameters:st (schrodinger.structure.Structure) – the structure
Return type:list
Returns:contains lists of restrain distances
schrodinger.application.matsci.reaction_workflow_utils.get_restrain_angle_idxs(st)

Return a list of lists of indices of restrain angles in the given structure.

Parameters:st (schrodinger.structure.Structure) – the structure
Return type:list
Returns:contains lists of restrain angles
schrodinger.application.matsci.reaction_workflow_utils.get_restrain_dihedral_idxs(st)

Return a list of lists of indices of restrain dihedrals in the given structure.

Parameters:st (schrodinger.structure.Structure) – the structure
Return type:list
Returns:contains lists of restrain dihedrals
schrodinger.application.matsci.reaction_workflow_utils.get_idx_groups_str(idx_groups)

Get a string representation of the given index groups.

Parameters:idx_groups (list) – contains lists of indices
Return type:str
Returns:the string
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
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

schrodinger.application.matsci.reaction_workflow_utils.type_cast_jaguar_keywords(jaguar_keywords, reserved_keys={'molchg', 'itrvec', 'multip', 'igeopt', 'nhesref', 'ifreq'}, 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.check_ff_assignment(sts, ffld_name='OPLS3e')

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_conformers(conformers, conformers_group_hash)

Check conformers. If the given structures are conformers then their atom numberings are all changed in place so that they are equivalent to that of the first of the given 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_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.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.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

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.get_int_tuples_from_str_property(st, key, separator=';')

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

Parameters:
  • st (schrodinger.structure.Structure) – the structure
  • key (str) – the property key
  • separator (str) – the tuple separator used for the given property
Return type:

list

Returns:

contains tuples of integers

exception schrodinger.application.matsci.reaction_workflow_utils.ReactionWorkflowException

Bases: Exception

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

Bases: object

Manage a reaction workflow.

createConformers()

Create the conformers.

runJMSWF()

Run the Jaguar multistage workflow.

prepareOutput()

Prepare output.

run()

Run the reaction workflow.