Package schrodinger :: Package application :: Package matsci :: Package rxn_channel :: Module rxn_channel
[hide private]
[frames] | no frames]

Module rxn_channel

Classes and functions for building reaction channels.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  Constants
Manage some constants.
  ChannelDefinitions
Manage a collection of reaction channel definitions.
  ChannelDefinition
Manage a reaction channel definition.
  CheckInput
Manage checking user input.
  ReactantMolecule
Manage a reactant molecule in the reactants structure object.
  Products
Manage the properties of the products that result from applying a reaction channel definition to the reactants.
  Reactants
Manage the properties of the reactants.
  Channels
Manage the enumeration of reaction channels.
Functions [hide private]
int
init_random_seed(random_seed, logger)
Process the seed to the random number generator.
str, str or str, None
get_fragment_smiles(astructure, idx1, idx2)
Return two SMILES patterns of the two molecule fragments that would result from breaking the bond specified by the given two atoms or return the SMILES pattern of the molecule containing idx1 if idx2 is None.
list of ints @return indicies, atom indicies connected to the start atom by up to the specified bond depth
indicies_from_bonds_deep(astructure, start_atom_index, exclude_atom_indicies=None, depth=None)
Return a list of atom indicies obtained by collecting all atoms that are connected, in the bond traversal sense, to the given start atom by a number of bonds that is less than or equal to that given by the provided depth parameter.
 
set_zob_to_sob(astructure, atom_one, atom_two)
If the given structure has a zero-order bond for the given atom indicies then make this bond a single-order bond.
dict, dict, dict
wrapper_build_attach_structure(mol_one_st, mol_one_from_atom, mol_one_to_atom, mol_two_st, mol_two_from_atom, mol_two_to_atom)
A wrapper that corrects the atom reorder map returned from build.attach_structure to account for deleted fragment atoms and wraps the case where the active bonds may be of zero-order.
dict
dict_delete_and_decrement_keys(indict, key_to_delete)
Return the dictionary obtained from the input dictionary by deleting an entry with the specified key and then decrementing all keys larger than the specified key.
int
open_bonding_sites(astructure, atom_index)
Return the number of open bonding sites available for the provided atom in the given structure.
bool
minimize_geometry(astructure)
Perform a geometry minimization on the provided structure.
list of schrodinger.structure._StructureBond
get_bonds_in_molecule(amolecule)
This is a convenience function to get a list of bond objects from a molecule object, since no such function exists in our Python API.
 
print_allow_adsorption_onto(allow_adsorption_onto, logger=None)
Log the list of allowed adsorption sites.
schrodinger.structure.Structure and two dicts
get_structure_with_contiguous_molecules(molecules)
Return a single structure object containing the given molecules but such that the atom ordering per molecule is contiguous.
Variables [hide private]
  __doc__ = ...
  _version = '$Revision 0.0 $'
  FAILED_SPEAR_ELIM_KEY = 'b_matsci_Failed_Ring_Spear_Elimination'
  __package__ = 'schrodinger.application.matsci.rxn_channel'
Function Details [hide private]

init_random_seed(random_seed, logger)

 

Process the seed to the random number generator.

Parameters:
  • random_seed (None or int) - the seed for the random number generator
  • logger (logging.Logger) - output logger
Returns: int
final random seed

get_fragment_smiles(astructure, idx1, idx2)

 

Return two SMILES patterns of the two molecule fragments that would result from breaking the bond specified by the given two atoms or return the SMILES pattern of the molecule containing idx1 if idx2 is None.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure containing the molecule for which fragment SMILES are wanted
  • idx1 (int) - an atom index
  • idx2 (int) - the atom index for the target bond formed with idx1 or None
Returns: str, str or str, None
either two strings one for each of two fragments or a single string for the molecule containing idx1 and None

indicies_from_bonds_deep(astructure, start_atom_index, exclude_atom_indicies=None, depth=None)

 

Return a list of atom indicies obtained by collecting all atoms that are connected, in the bond traversal sense, to the given start atom by a number of bonds that is less than or equal to that given by the provided depth parameter. The start atom is included in the returned list. One can set a direction for the traversal by specifying exclusion atoms that are bound to the given start atom; the traversal will be done away from these atoms. Useful for doing SMARTS analysis from a central atom and proceeding outwards from that atom, as in nearest-neighbor, next-nearest-neighbor, etc., i. e. shells. Also useful for splitting a molecule into fragments about a given bond.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure containing all atoms
  • start_atom_index (int) - the atom index from which to start the traversal
  • exclude_atom_indicies (list of int) - atom indicies to exclude from the bond traversal which basically sets the direction of the bond traversal, for example in the direction of a certain bond
  • depth (int) - the maximum depth that the traversal is allowed to traverse in terms of the number of bonds from the starting atom
Returns: list of ints @return indicies, atom indicies connected to the start atom by up to the specified bond depth

set_zob_to_sob(astructure, atom_one, atom_two)

 

If the given structure has a zero-order bond for the given atom indicies then make this bond a single-order bond.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure for which the bond order may be changed
  • atom_one (int) - the first atom index of the bond whose order needs changing
  • atom_two (int) - the second atom index of the bond whose order needs changing

wrapper_build_attach_structure(mol_one_st, mol_one_from_atom, mol_one_to_atom, mol_two_st, mol_two_from_atom, mol_two_to_atom)

 

A wrapper that corrects the atom reorder map returned from build.attach_structure to account for deleted fragment atoms and wraps the case where the active bonds may be of zero-order.

Parameters:
  • mol_one_st (schrodinger.structure.Structure) - the base structure to which the fragment will be added
  • mol_one_from_atom (int) - defines the point at which the fragment structure will be added to the base structure
  • mol_one_to_atom (int) - this atom defines the part of the base structure that will be replaced by the fragment
  • mol_two_st (schrodinger.structure.Structure) - the fragment structure to be added to the base structure
  • mol_two_from_atom (int) - defines the point at which the base structure will be added to the fragment structure
  • mol_two_to_atom (int) - this atom defines the part of the fragment structure that will be replaced by the base
Returns: dict, dict, dict
three mapping dictionaries, (1) original_map, which is the original map returned from build.attach_structure, (2) orig_to_new_map, which is the corrected version of (1), and (3) new_to_orig_map, the reverse of (2).

dict_delete_and_decrement_keys(indict, key_to_delete)

 

Return the dictionary obtained from the input dictionary by deleting an entry with the specified key and then decrementing all keys larger than the specified key. Leave the values unchanged.

Parameters:
  • indict (dict) - dictionary with integer keys and values from which to remove and decrement the specified key
  • key_to_delete (int) - the key to delete from the input dictionary
Returns: dict

open_bonding_sites(astructure, atom_index)

 

Return the number of open bonding sites available for the provided atom in the given structure. This number is the same as the number of unpaired electrons for the atom in its current state in the given structure.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure that contains the provided atom
  • atom_index (int) - the index of the atom for which the number of open bonding sites will be reported
Returns: int
atom_open_val, the number of open bonding sites for the provided atom

minimize_geometry(astructure)

 

Perform a geometry minimization on the provided structure.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure object needing minimization
Returns: bool
False if the minimization was successful, True otherwise

get_bonds_in_molecule(amolecule)

 

This is a convenience function to get a list of bond objects from a molecule object, since no such function exists in our Python API.

Parameters:
  • amolecule (schrodinger.structure._Molecule) - the molecule object from which bonds will be defined
Returns: list of schrodinger.structure._StructureBond
bonds, list of bond objects for bonds in the specified molecule

print_allow_adsorption_onto(allow_adsorption_onto, logger=None)

 

Log the list of allowed adsorption sites.

Parameters:
  • allow_adsorption_onto (list) - SMARTS patterns of arbitrary adsorption sites to support
  • logger (logging.getLogger) - output logger

get_structure_with_contiguous_molecules(molecules)

 

Return a single structure object containing the given molecules but such that the atom ordering per molecule is contiguous.

Parameters:
  • molecules (list of schrodinger.structure._Molecule) - molecules that need to be contiguously assembled into a single structure
Returns: schrodinger.structure.Structure and two dicts
mols_st, single structure containing all molecules in contiguous form, and mols_new_to_old and mols_old_to_new, two reordering dictionaries

Variables Details [hide private]

__doc__

Value:
"""
Classes and functions for building reaction channels.

Copyright Schrodinger, LLC. All rights reserved."""