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

Class CheckInput

object --+
         |
        CheckInput

Manage checking user input.

Instance Methods [hide private]
 
checkFileExists(self, infile, logger=None)
Check if the provided input file exists.
 
checkInputFile(self, infile, logger=None)
Check user input file.
 
checkReactants(self, reactants, logger=None)
Check the provided reactants structure.
int or 'all', list, list, set
checkRandomChannelsInput(self, reactants, num_random_channels, random_types, random_seed, allow_adsorption_onto, logger=None)
Check parameters for generating random channels.
list, set
checkAndProcessAllowAdsorptionOnto(self, astructure, allow_adsorption_onto, logger=None)
Check and process the allow adsorption onto option.
 
checkChannelDefs(self, channeldefs, logger=None)
Check properties of the supplied channel definitions.
bool
checkIfNotAdsorbable(self, astructure, atom_index, matches)
Check if the provided atom can function as an adsorption site, i.e.
list of boolean
checkIfNotSimpleBond(self, astructure, atom_one, atom_two, no_reactive_h)
Check if the provided two atoms do not form a simple bond, i.e.
list
checkChannelUniqueness(self, astructure, bond1idx1, bond1idx2, bond2idx1, bond2idx2)
For the provided structure use SMILES analysis to determine if the defined single or double displacement reaction channels, i.e.
list
checkChannelDefsVsReactants(self, channeldefs, reactants, matches, no_reactive_h, unique, logger=None)
Check user defined channels against user defined reactants.
float
checkDissociationBondLength(self, dissociation_bond_length, logger=None)
Check the specified dissociation bond length.
int or 'all'
checkNumRandomChannels(self, num_random_channels, logger=None)
Check the specified number of random channels.
list of strs
checkRandomTypes(self, random_types, logger=None)
Check the specified types of random channels.
 
checkRandomSeed(self, random_seed, logger=None)
Check the specified random seed.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  TITLE_KEY = 's_m_title'
  ENTRY_NAME_KEY = 's_m_entry_name'
  REACTANT_NAME_BASE = 'reactant'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

checkFileExists(self, infile, logger=None)

 

Check if the provided input file exists.

Parameters:
  • infile (str) - the input file
  • logger (logging.getLogger) - output logger

checkInputFile(self, infile, logger=None)

 

Check user input file.

Parameters:
  • infile (str) - the input file
  • logger (logging.getLogger) - output logger

checkReactants(self, reactants, logger=None)

 

Check the provided reactants structure.

Parameters:
  • reactants (schrodinger.structure.Structure) - the reactants from which channels will be enumerated
  • logger (logging.getLogger) - output logger

checkRandomChannelsInput(self, reactants, num_random_channels, random_types, random_seed, allow_adsorption_onto, logger=None)

 

Check parameters for generating random channels.

Parameters:
  • reactants (schrodinger.structure.Structure) - the reactants from which channels will be enumerated
  • num_random_channels (int or 'all') - the number of random channels to generate or 'all'
  • random_types (list) - list of strings specifying which types of channels should be sampled when generating the random reaction channels
  • random_seed (None or int) - the seed for the random number generator
  • allow_adsorption_onto (list) - SMARTS patterns of arbitrary adsorption sites to support
  • logger (logging.getLogger) - output logger
Returns: int or 'all', list, list, set
num_random_channels, random_types, allow_adsorption_onto as defined above, and matches is a set of atom indicies matching the SMARTS present in allow_adsorption_onto

checkAndProcessAllowAdsorptionOnto(self, astructure, allow_adsorption_onto, logger=None)

 

Check and process the allow adsorption onto option.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure
  • allow_adsorption_onto (list) - SMARTS patterns of arbitrary adsorption sites to support
  • logger (logging.getLogger) - output logger
Returns: list, set
allow_adsorption_onto and matches, final list of SMARTS patterns on which to allow adsorption and a set of atom indicies matching the SMARTS present in allow_adsorption_onto

checkChannelDefs(self, channeldefs, logger=None)

 

Check properties of the supplied channel definitions.

Parameters:
  • channeldefs (ChannelDefinitions) - list of ChannelDefinitions
  • logger (logging.getLogger) - output logger

checkIfNotAdsorbable(self, astructure, atom_index, matches)

 

Check if the provided atom can function as an adsorption site, i.e. check if the atom has any open bonding sites or if the atom belongs to the list of arbitary adsorption sites to allow.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure that contains the atom whose candidacy for adsorption will be checked
  • atom_index (int) - the index of the atom to check
  • matches (set) - a set of atom indicies matching the SMARTS present in the list of allowed adsorption sites
Returns: bool
False if atom can function as an adsorption site, True otherwise

checkIfNotSimpleBond(self, astructure, atom_one, atom_two, no_reactive_h)

 

Check if the provided two atoms do not form a simple bond, i.e. a single bond that is not in a ring and possibly does not involve a hydrogen atom.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure on which the simple bond will be checked
  • atom_one (int) - the first atom in the potential bond
  • atom_two (int) - the second atom in the potential bond
  • no_reactive_h (bool) - specify that R-H bonds be considered inert
Returns: list of boolean
Contains the bool values of whether (1) the two atoms are not bound, (2) the bond they form is not a single bond, (3) the bond they form is in a ring, and (4) if -no_reactive_h has been specified that the bond involves a hydrogen atom. If any of these is True then the bond is not a simple bond.

checkChannelUniqueness(self, astructure, bond1idx1, bond1idx2, bond2idx1, bond2idx2)

 

For the provided structure use SMILES analysis to determine if the defined single or double displacement reaction channels, i.e. A + B-C --> A-B + C (1st type) or A-C + B (2nd type) or A-B + C-D --> A-C + B-D (1st type) or A-D + B-C (2nd type), respectively, lead to unique products.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure for which the channels will be checked for uniqueness
  • bond1idx1 (int) - the first atom index of the bond in the first molecule
  • bond1idx2 (int or None) - the second atom index of the bond in the first molecule or None if this is a single displacement channel and there is no bond
  • bond2idx1 (int) - the first atom index of the bond in the second molecule
  • bond2idx2 (int or None) - the second atom index of the bond in the second molecule or None if this is a single displacement channel and there is no bond
Returns: list
two booleans, (1) True if the 1st type should be computed, False otherwise and (2) True if the 2nd type should be computed, False otherwise

checkChannelDefsVsReactants(self, channeldefs, reactants, matches, no_reactive_h, unique, logger=None)

 

Check user defined channels against user defined reactants.

Parameters:
  • channeldefs (list) - list of ChannelDefinitions
  • reactants (schrodinger.structure.Structure) - the reactants from which channels will be enumerated
  • matches (set) - a set of atom indicies matching the SMARTS present in the list of allowed adsorption sites
  • no_reactive_h (bool) - specify that R-H bonds be considered inert
  • unique (bool) - provide only unique products
  • logger (logging.getLogger) - output logger
Returns: list
final_channeldefs, list of good ChannelDefinitions

checkDissociationBondLength(self, dissociation_bond_length, logger=None)

 

Check the specified dissociation bond length.

Parameters:
  • dissociation_bond_length (float) - final bond length to use for dissociative reaction channels
  • logger (logging.getLogger) - output logger
Returns: float
dissociation_bond_length, final bond length to use for dissociative reaction channels

checkNumRandomChannels(self, num_random_channels, logger=None)

 

Check the specified number of random channels.

Parameters:
  • num_random_channels (int or 'all') - the desired number of random channels to generate or 'all'
  • logger (logging.getLogger) - output logger
Returns: int or 'all'
num_random_channels, the desired number of random channels to generate or 'all'

checkRandomTypes(self, random_types, logger=None)

 

Check the specified types of random channels.

Parameters:
  • random_types (list of strs) - the desired types of random channels to generate
  • logger (logging.getLogger) - output logger
Returns: list of strs
random_types, the desired types of random channels to generate

checkRandomSeed(self, random_seed, logger=None)

 

Check the specified random seed.

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