schrodinger.application.matsci.vsepr module¶
Determines the closest VSEPR geometry based on the metal coordination sphere
This module is used in the OPLS+M force field workflow
Copyright Schrodinger, LLC. All rights reserved.
- exception schrodinger.application.matsci.vsepr.VSEPRError¶
Bases:
Exception
Base class of errors raised when determining the VSEPR geomemtry fails
- exception schrodinger.application.matsci.vsepr.NonBondedMetalError¶
Bases:
VSEPRError
Raised when there are no bonds to the metal and adding bonds was not requested
- exception schrodinger.application.matsci.vsepr.SingleMetalRequiredError¶
Bases:
VSEPRError
Raised when there are too many metals in the structure
- exception schrodinger.application.matsci.vsepr.NoTemplateAvailableError¶
Bases:
VSEPRError
Raised when there are too many bonds to the metal in the structure
- schrodinger.application.matsci.vsepr.determine_vsepr_geometry(struct, **kwargs)¶
Determine the VSEPR geometry of the given structure
The geometry determined is returned from this function. In addition, the geometry as well as the RMS deviation from the ideal geometry are added as structure properties to the given structure.
- Parameters:
struct (Structure) – The structure to check
Additional keyword arguments are passed to the VSEPRFinder class
- Return type:
str
- Returns:
A string giving the VSEPR geometry
- Raises:
SingleMetalRequiredError – If there is more than 1 metal atom in struct
NonBondedMetalError – If there are no bonds to the metal and adding bonds to the metal was not requested
NoTemplateAvailableError – If there are too many bonds to the metal and no VSEPR template exists.
- schrodinger.application.matsci.vsepr.determine_vsepr_geometries_from_file(input_file, basename, create_fit_sts=False, **kwargs)¶
Determine the VSEPR geometries for all structures in an input file, writing the results to an output structure file.
- Parameters:
input_file (str) – The name of the input structure file
basename (str) – The base name for the structure and fits output files
create_fit_sts (bool) – Create a file with structures in it that show how the metal coordination sphere fits ideal VSEPR templates.
Additional keyword arguments are passed to the VSEPRFinder class
- Return type:
str, str, int
- Returns:
The name of the output and fit structure files (in that order), and the number of failed structures
- class schrodinger.application.matsci.vsepr.VSEPRFinder(make_bonds=False, bond_tol=2.7, bond_h=False, allow_neighbors=False, logger=None)¶
Bases:
object
Class used to find the VSEPR geometry of a single-metal organometallic complex.
After creating the object, call the run method to determine the geometry
- NONE = 'None'¶
- LINEAR = 'Linear'¶
- BENT = 'Bent'¶
- TRIGONAL_PLANAR = 'Trigonal planar'¶
- TRIGONAL_PYRAMIDAL = 'Trigonal pyramidal'¶
- T_SHAPED = 'T-Shaped'¶
- TETRAHEDRAL = 'Tetrahedral'¶
- SQ_PLANAR = 'Square planar'¶
- SEESAW = 'Seesaw'¶
- TRIGONAL_BIPYRAMIDAL = 'Trigonal bipyramidal'¶
- SQ_PYRAMIDAL = 'Square pyramidal'¶
- OCTAHEDRAL = 'Octahedral'¶
- PENTAGONAL_BIPYRAMIDAL = 'Pentagonal bipyramidal'¶
- SQUARE_ANTIPRISMATIC = 'Square antiprismatic'¶
- TRICAPPED_TRIGONAL_PRISMATIC = 'Tricapped trigonal prismatic'¶
- __init__(make_bonds=False, bond_tol=2.7, bond_h=False, allow_neighbors=False, logger=None)¶
Create a VSEPRFinder instance
- Parameters:
make_bonds (bool) – If True create bonds to all atoms within bonding distance to the metal atom using the bond_tol and bond_h parameters. If False, the bonding in the structure will be used as given.
bond_tol (float) – The distance at which atoms near the metal should be considered bonded when make_bonds is True.
bond_h (bool) – When make_bonds is True, allow H atoms to bond to the metal
allow_neighbors (bool) – If True, allow atoms that are bonded together to also both be bonded to the metal. If False, only the atom nearer to the metal will be bonded.
logger (callable) – A function that takes a single string argument, used for logging information
- run(struct)¶
Determine the VSEPR geometry of the given structure
The geometry name and rms fit are added to the structure as properties.
- Parameters:
struct (Structure) – The structure to determine the geometry of
- Return type:
str
- Returns:
The VSEPR geometry name
- log(msg)¶
Log a message if a logger has been supplied
- Parameters:
msg (str) – The message to log
- classmethod setUpTemplates()¶
Set up the templates for the VSEPR geometries
- locateMetalAndNeighbors(struct)¶
Find the index of the metal atom and verify its neighbors
- Parameters:
struct (Structure) – The structure to check
- Return type:
int
- Returns:
The index of the metal atom
- Raises:
SingleMetalRequiredError – If there is more than 1 metal atom in struct
NonBondedMetalError – If there are no bonds to the metal and adding bonds to the metal was not requested
- addBondsToMetal(struct, metal_index)¶
Add bonds between the metal atom and nearby atoms
- Parameters:
struct (structure.Structure) – The structure to modify in place
metal_index (int) – The index of the metal atom
- removeNeighborMatches(struct, matches, metal_index)¶
If 2 atoms close to the metal are also bonded to each other, remove the atom that is further from the metal.
- Parameters:
struct (Structure) – The structure containing the atoms
matches (list) – List of atom indexes close to the metal
metal_index (int) – The index of the metal atom
- Return type:
list
- Returns:
A list of remaining indexes after neighbors have been removed
- prepStructureForVSEPR(struct, metal_index)¶
Modify the structure to have similar characteristics as the template
- Parameters:
struct (structure.Structure) – The structure to modify in place
metal_index (int) – The index of the metal atom
- checkAgainstTemplate(struct, template, metal_index)¶
Computes the RMS of the given structure against the given template
- makeFitSt(struct, template)¶
Create a structure that combines the given structure and template, and add it to the list of fit structures.
- getBestRMS(struct, template, flippable_atoms)¶
Get the best RMS deviation between struct and template. The structure “as is” is checked as one possibility. Then if flippable_atoms are supplied, those two atoms are flipped and the flipped structure is checked. The return value is for the structure that better matches the template.
Flipping allows for checking different isomers (fac/mer for octahedral, cis/trans for square planer, R/S for tetrahedral, etc.)
- Parameters:
- Return type:
(Structure, float)
- Returns:
The structure that best matches the template and the RMS deviation of that structure from the template
- adjustOrderToTemplate(struct, template, metal_index)¶
Adjust the atom order of the given structure to best match the atom order of the given template.
The metal atom will be moved to position 1.
For some geometries, all non-metal atom positions are equivalent - such as trigonal planar, tetrahedral, octahedral. But some geometries it is very important for atoms to be in certain positions - such as axial vs equitorial in trigonal bipyramidal or square pyrimidal. For these, we manually force certain atoms to be in certain positions based on the current geometry of struct.
- Parameters:
- Return type:
Structure, list(int)
- Returns:
A new structure with the atoms from struct reordered, and a list of 2 atom indexes that can be flipped to form an isomer of the returned structure.
- adjustSeeSawOrder(struct)¶
Adjust the atom ordering so that the atoms are ordered similarly to the template.
Assumes the metal atom is at position 1
- adjustSqPlanarOrder(struct)¶
Adjust the atom ordering so that the atoms are ordered similarly to the template.
Assumes the metal atom is at position 1
- adjustTrigBiPyrOrder(struct)¶
Adjust the atom ordering so that the atoms are ordered similarly to the template.
Assumes the metal atom is at position 1
- adjustSqPyrOrder(struct)¶
Adjust the atom ordering so that the atoms are ordered similarly to the template.
Assumes the metal atom is at position 1
- adjustTShapeOrder(struct)¶
Adjust the atom ordering so that the atoms are ordered similarly to the template.
Assumes the metal atom is at position 1
- findLinearAtoms(struct)¶
Find 2 atoms that are bonded to the metal so that the atom-metal-atom angle is linear.
Assumes the metal atom is at position 1
- Parameters:
struct (Structure) – The structure to check
- Return type:
list, list
- Returns:
The first list has the 2 atom indexes for the linear atoms. The second list is the atom indexes of all the other non-metal atoms.
- findSmallestAngleAtom(struct)¶
Find the atom that has the smallest maximum atom-metal-atom angle.
This is the atom that should be placed in a position that is near all other atoms (such as an axial position).
Assumes the metal atom is at position 1
- Parameters:
struct (Structure) – The structure to check
- Return type:
int, list
- Returns:
The int is the index of the atom that has the smallest angles to the other atoms. The list is the atom indexes of all the other non-metal atoms.
- schrodinger.application.matsci.vsepr.log_error(msg)¶
Add a message to the log file and exit with an error code
- Parameters:
msg (str) – The message to log
- schrodinger.application.matsci.vsepr.log(msg, **kwargs)¶
Add a message to the log file
- Parameters:
msg (str) – The message to log
Additional keyword arguments are passed to the textlogger.log_msg function
- schrodinger.application.matsci.vsepr.get_parser()¶
Get the command line argument parser
- Return type:
parserutils.DriverParser
- Returns:
The command line argument parser
- schrodinger.application.matsci.vsepr.main(*args)¶