schrodinger.application.matsci.buildcomplex module

This module assists in building organometallic complexes. Given one or more ligands, these ligands will be arranged around a central atom.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.buildcomplex.MONODENTATE = 'Monodentate'

Name for ligands that have a single coordination site

schrodinger.application.matsci.buildcomplex.BIDENTATE = 'Bidentate'

Name for ligands that have two coordination sites

schrodinger.application.matsci.buildcomplex.OCTAHEDRAL = 'Octahedral'

VESPR geometry with 6 coordination sites around a central atom

schrodinger.application.matsci.buildcomplex.TRIGONAL_BIPYRAMIDAL = 'Trigonal bipyramidal'

VESPR geometry with 5 coordination sites around a central atom

schrodinger.application.matsci.buildcomplex.TETRAHEDRAL = 'Tetrahedral'

VESPR geometry with 4 coordination sites around a central atom

schrodinger.application.matsci.buildcomplex.SQUARE_PLANAR = 'Square planar'

VESPR geometry with 4 coordination sites around a central atom

schrodinger.application.matsci.buildcomplex.TRIGONAL_PLANAR = 'Trigonal planar'

VESPR geometry with 3 coordination sites around a central atom

schrodinger.application.matsci.buildcomplex.LINEAR = 'Linear'

VESPR geometry with 2 coordination sites around a central atom

schrodinger.application.matsci.buildcomplex.PENTAGONAL_BIPYRAMIDAL = 'Pentagonal bipyramidal'

VESPR geometry with 7 coordination sites around a central atom

schrodinger.application.matsci.buildcomplex.SQUARE_ANTIPRISMATIC = 'Square antiprismatic'

VESPR geometry with 8 coordination sites around a central atom

schrodinger.application.matsci.buildcomplex.TRICAPPED_TRIGONAL_PRISMATIC = 'Tricapped trigonal prismatic'

VESPR geometry with 9 coordination sites around a central atom

schrodinger.application.matsci.buildcomplex.SUPPORTED_GEOMETRIES = ['Octahedral', 'Trigonal bipyramidal', 'Square planar', 'Tetrahedral', 'Trigonal planar', 'Linear', 'Pentagonal bipyramidal', 'Square antiprismatic', 'Tricapped trigonal prismatic']

VESPR geometries that can be built by this module

schrodinger.application.matsci.buildcomplex.FACIAL = 'facial'

Octahedral complex with identical atoms on the face of the octahedron

schrodinger.application.matsci.buildcomplex.MERIDIONAL = 'meridional'

Octahedral complex with identical atoms on the meridion of the octahedron

schrodinger.application.matsci.buildcomplex.NO_ISOMER = 'none'

No specific isomer

schrodinger.application.matsci.buildcomplex.CIS = 'cis'

Square planar complex with identical atoms in adjacent sites

schrodinger.application.matsci.buildcomplex.TRANS = 'trans'

Square planar complex with identical atoms in opposite sites

schrodinger.application.matsci.buildcomplex.OCTAHEDRAL_LOCATIONS = [(2.0, 0.0, 0.0), (0.0, 2.0, 0.0), (0.0, 0.0, 2.0), (0.0, -2.0, 0.0), (-2.0, 0.0, 0.0), (0.0, 0.0, -2.0)]

XYZ coordinates of the octahedral coordination sites

schrodinger.application.matsci.buildcomplex.TRIGONAL_BIPYRAMIDAL_LOCATIONS = [(0.0, 2.0, 0.0), (0.0, -2.0, 0.0), (2.0, 0.0, 0.0), (-1.0, 0.0, 1.73205), (-1.0, 0.0, -1.73205)]

XYZ coordinates of the trigonal pyramid coordination sites

schrodinger.application.matsci.buildcomplex.SQUARE_PLANAR_LOCATIONS = [(2.0, 0.0, 0.0), (0.0, 2.0, 0.0), (0.0, -2.0, 0.0), (-2.0, 0.0, 0.0)]

XYZ coordinates of the square planar coordination sites

schrodinger.application.matsci.buildcomplex.TETRAHEDRAL_LOCATIONS = [(0.0, 2.0, 0.0), (1.88562, -0.66667, 0.0), (-0.94281, -0.66667, -1.63299), (-0.94281, -0.66667, 1.63299)]

XYZ coordinates of the tetrahedral coordination sites

schrodinger.application.matsci.buildcomplex.TRIGONAL_PLANAR_LOCATIONS = [(2.0, 0.0, 0.0), (-1.0, 1.73205, 0.0), (-1.0, -1.73205, 0.0)]

XYZ coordinates of the trigonal planar coordination sites

schrodinger.application.matsci.buildcomplex.LINEAR_LOCATIONS = [(2.0, 0.0, 0.0), (-2.0, 0.0, 0.0)]

XYZ coordinates of the linear coordination sites

schrodinger.application.matsci.buildcomplex.PENTAGONAL_BIPYRAMIDAL_LOCATIONS = [(0.0, 0.0, 2.0), (2.0, 0.0, 0.0), (0.6180339887498949, 1.902113032590307, 0.0), (-1.6180339887498947, 1.1755705045849465, 0.0), (-1.6180339887498947, -1.1755705045849465, 0.0), (0.6180339887498949, -1.902113032590307, 0.0), (0.0, 0.0, -2.0)]

XYZ coordinates of the pentagonal bipyramidal sites

schrodinger.application.matsci.buildcomplex.SQUARE_ANTIPRISMATIC_LOCATIONS = [(1.696096192312852, 0.0, 1.0598385284664098), (1.2496025204274779, 1.2496025204274779, -0.9364758843038024), (0.0, 1.696096192312852, 1.0598385284664098), (-1.2496025204274779, 1.2496025204274779, -0.9364758843038024), (-1.696096192312852, 0.0, 1.0598385284664098), (-1.2496025204274779, -1.2496025204274779, -0.9364758843038024), (0.0, -1.696096192312852, 1.0598385284664098), (1.2496025204274779, -1.2496025204274779, -0.9364758843038024)]

XYZ coordinates of the square antiprismatic sites

schrodinger.application.matsci.buildcomplex.TRICAPPED_TRIGONAL_PRISMATIC_LOCATIONS = [(1.4142135623730951, 0.0, -1.414213562373095), (0.0, 1.4142135623730951, -1.414213562373095), (-1.4142135623730951, 0.0, -1.414213562373095), (0.0, -1.4142135623730951, -1.414213562373095), (1.4142135623730951, -1.0, 0.9999999999999998), (1.4142135623730951, 1.0, 0.9999999999999998), (-1.4142135623730951, 1.0, 0.9999999999999998), (-1.4142135623730951, -1.0, 0.9999999999999998), (0.0, 0.0, 2.0)]

XYZ coordinates of the tricapped trigonal prismatic sites

schrodinger.application.matsci.buildcomplex.minimize_complex(struct, forcefield=14, **kwargs)[source]

Minimize the given structure using the new MMFFLD method of determining parameters for metal complexes.

Additional keyword arguments are passed to the Minimizer class constructor

Parameters
  • struct (schrodinger.structure.Structure) – The structure to minimize

  • ffld_version (integer) – The force field to use. Should be a module constant from the minimize module.

Raises
  • ValueError – Typically means atom typing error or valence violations

  • mm.MmException – Due to overlapping atoms

schrodinger.application.matsci.buildcomplex.fix_metal_bond_orders(struct, index)[source]

Fix all the bonds to atom index to be either single or dative depending on whether the other atom has a full valence without this bond or not. Full valence without this bond = dative bond, otherwise bond order = number of open valences. Formal charges are also set to 0 for the metal atom and bonded neighbors.

Note - no bonds are added or removed by this function, only bond orders are changed.

Parameters
  • struct (schrodinger.structure.Structure) – The structure to operate on - bonds are modified on this structure directly, not a copy

  • index (int) – The atom index of the metal atom with bonds to adjust

schrodinger.application.matsci.buildcomplex.transmute_atom(atom, element, color=None)[source]

Transmute atom from its current element to a new element. The new name will be element + index (ex. H17), and the new color if not supplied will be the Maestro default (or purple if no Maestro default).

Parameters
  • atom (schrodinger.structure._StructureAtom) – The atom object to transmute to a new element

  • element (str) – The atomic symbol of the new element

  • color (str) – The new color of the atom in a format accepted by the _StructAtom.color property. The default is to use Maestro’s default color for the new element, or purple if the default color is not defined.

Raises

ValueError – if element is not a recognized atomic symbol

schrodinger.application.matsci.buildcomplex.find_atoms_to_remove(struct, keep_atom, root_atom)[source]

Return a list of atoms bound to root atom (and recursively all atoms bound to those atoms, ad infinitum). keep_atom and all atoms recursively bound to it will not be added to the list.

If keep_atom and root_atom are part of the same ring system, root_atom will be the only atom returned in the list.

For structure A-B-C-D-E, if keep_atom=B and root_atom=C, the returned list will be [C, D, E].

Parameters
  • struct (schrodinger.structure.Structure) – The structure to use

  • keep_atom (int) – The index of the atom to keep

  • root_atom (int) – The index of the first atom to remove. All neighbors of this atom that are not keep_atom will be added to the list.

Return type

list

Returns

A list of all atoms recursively bound to root atom. keep_atom and all atoms bound to it are excluded from the list.

schrodinger.application.matsci.buildcomplex.convert_old_marker_props_to_new(struct)[source]

Some template strutures may still use old-style properties to mark Rx atoms. This function converts those properties to new-style properties and removes the old ones.

Parameters

struct (schrodinger.structure.Structure) – The structure with properties to read and modify

schrodinger.application.matsci.buildcomplex.get_marker_atom_indexes_from_structure(struct)[source]

Get the indexes of atoms marked as Rx atoms

Parameters

struct (schrodinger.structure.Structure) – The structure with the Rx atoms

Return type

(dict, int)

Returns

dict keys are the int value of x in Rx, values are lists of atom indexes set to that Rx value (atom indexes are 1-based). The int return value is the highest value of x in the keys of the dictionary.

schrodinger.application.matsci.buildcomplex.mark_eta_positions(struct, rx_atoms)[source]

Add a structure property that gives the index of each eta-coordination marker

Parameters
  • struct (schrodinger.structure.Structure) – The structure with the Rx atoms

  • rx_atoms (dict) – Keys are x value and values are lists of atoms denoted with that Rx marker

schrodinger.application.matsci.buildcomplex.get_eta_marker_indexes(struct)[source]

Get a set of all atom indexes for eta-coordination markers

Parameters

struct (schrodinger.structure.Structure) – The structure with the Rx atoms

Return type

set

Returns

Each item of the set is the atom index of a marker for an eta-coordination site

schrodinger.application.matsci.buildcomplex.clear_marker_properties(struct)[source]

Clear any marker properties that exist on the structure

Parameters

struct (schrodinger.structure.Structure) – The structure with the marker properties to clear

schrodinger.application.matsci.buildcomplex.set_marker_properties(struct, rx_atoms, clear=True)[source]

Set the structure properties that store the atoms

Parameters
  • struct (schrodinger.structure.Structure) – The structure with the Rx atoms

  • rx_atoms (dict) – keys are the int value of x in Rx, values are lists of atom indexes set to that Rx value (atom indexes are 1-based)

  • clear (bool) – Clear any existing marker properties before setting new ones

exception schrodinger.application.matsci.buildcomplex.EtaFFAssignmentError[source]

Bases: Exception

Raised when a FF assignment error occurs

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class schrodinger.application.matsci.buildcomplex.Ligand(struct, sites=None, slots=None)[source]

Bases: object

Stores information about a ligand structure

__init__(struct, sites=None, slots=None)[source]

Create a Ligand object

Parameters
  • struct (schrodinger.structure.Structure) – The ligand structure

  • sites (list of tuple) – Each item of the list is a (X, Y) tuple. X is the index of the atom that will attach to the central metal atom in the complex, and Y is the index of the atom that should be removed to make the attachment. The X-Metal bond will be made along the X-Y bond vector. If Y is 0, the bond will be assumed to be a dative bond, and the X-Metal bond will be formed along an angle that is chosen to minimize sterics. If X is negative, the site is an eta-coordination site.

  • slots (list of int) – The coordination slots this ligand will occupy. The coordination slot is the index into the GEOMETRY_LOCATIONS array that specifies the xyz coordinates for this ligand coordination. If not supplied, the slots will be supplied based on the isomer of the complex.

minimizeEtaPosition()[source]

For bidentate eta ligands, orient the eta plane(s) to be face-on to roughly where the metal atom will be

class schrodinger.application.matsci.buildcomplex.ComplexBuilder(metal='Ir', geometry='Octahedral', isomer='facial', homoleptic=True, dentation='Bidentate')[source]

Bases: object

A class used to build an organometallic complex

__init__(metal='Ir', geometry='Octahedral', isomer='facial', homoleptic=True, dentation='Bidentate')[source]

Create a ComplexBuilder instance

Parameters
  • metal (str) – The atomic symbol of the central atom

  • geometry (str) – VESPR geometry of the complex. Should be a module constant: OCTAHEDRAL, TETRAHEDRAL, SQUARE_PLANAR

  • isomer (str or None) – For octahedral complexes, can be module constants FACIAL, MERIDIONAL, or NO_ISOMER. For square planar complexes, can be module constants CIS, TRANS or NO_ISOMER. It is ignored for tetrahedral. None may be used instead of NO_ISOMER.

  • homoleptic (bool) – If True, the complex is homoleptic and only one ligand should be supplied. If False, the complex is heteroleptic and every ligand must be supplied. Homoleptic = all ligands are identical, heteroleptic = ligands may or may not be identical.

  • dentation (int) – Module-level constant describing the dentation type of the ligand - either MONODENTATE or BIDENTATE. Only used to determine the coordination slot order (the order coordination sites are filled) for isomers.

resetSlots(dentation='Bidentate')[source]

Reset the slot order back to ideal slot order

Parameters

dentation (int) – Module-level constant describing the dentation type of the ligand - either MONODENTATE or BIDENTATE

setSlotOrder(slot_order)[source]

Set the order that coordination sites should be used. This should be a list of indexes into the slot_order property. Ligands will be attached at these coordination sites in the order they are added.

Parameters

slot_order (list of int) – List of indexes that specifies the order of coordination sites to use.

Raises
  • IndexError – If the list is not the correct length (6 for octahedral, 4 for tetrahedral/square_planar). An example for square_planar might be [0, 2, 1, 3].

  • ValueError – If the list contains duplicated indexes or indexes outside the allow range of 0 to len(list)-1

getNumUsedCoordSites()[source]

Get the current number of coordination sites required for all copies of all ligands set so far.

Return type

int

Returns

The total number of sites required for all currently set ligands. Accounts for the number of copies requested and mono/bi-dentation of each ligand.

addMonodentateLigand(struct, site, slot=None, copies=1)[source]

Add a monodentate ligand for the complex.

Parameters
  • struct (schrodinger.structure.Structure) – The structure of the ligand

  • site (tuple) – An (X, Y) tuple. X is the index of the atom that will attach to the central metal atom in the complex, and Y is the index of the atom that should be removed to make the attachment. The X-Metal bond will be made along the X-Y bond vector. If Y is 0, the bond will be assumed to be a dative bond, and the X-Metal bond will be formed along an angle that is chosen to minimize sterics. If X is negative, the site is an eta-coordination site.

  • slot (int) – The coordination slot this ligand will occupy. The coordination slot is the index into the GEOMETRY_LOCATIONS array that specifies the xyz coordinates for this ligand coordination.

  • copies (int) – The number of copies of this ligand. It is a ValueError to specify slot & copies > 1.

addBidentateLigand(struct, sites, slots=None, copies=1)[source]

Add a bidentate ligand for the complex.

Parameters
  • struct (schrodinger.structure.Structure) – The structure of the ligand

  • sites (list of tuple) – Each item of the list is a (X, Y) tuple. X is the index of the atom that will attach to the central metal atom in the complex, and Y is the index of the atom that should be removed to make the attachment. The X-Metal bond will be made along the X-Y bond vector. If Y is 0, the bond will be assumed to be a dative bond, and the X-Metal bond will be formed along an angle that is chosen to minimize sterics. If X is negative, the site is an eta-coordination site.

  • slots (list of int) – The coordination slots this ligand will occupy. The coordination slot is the index into the GEOMETRY_LOCATIONS array that specifies the xyz coordinates for this ligand coordination.

  • copies (int) – The number of copies of this ligand. It is a ValueError to specify slot & copies > 1.

clearLigands()[source]

Remove all added ligands

createComplex(force=False)[source]

Create the complex based on the defined ligands

Parameters

force (bool) – If true, create a complex even if all slots are not filled. If False (default), raise IndexError if all slots are not filled.

Raises
  • IndexError – If not all sites are filled and force is not True

  • IndexError – Too many ligands specified for available sites

exception schrodinger.application.matsci.buildcomplex.NoMetalError[source]

Bases: Exception

Emitted when a metal is not found when one is expected

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class schrodinger.application.matsci.buildcomplex.EtaFindingMixin[source]

Bases: object

A mixin with a method for finding eta ligands in a metal complex

findEtaGroups(dummy_style=True)[source]

Find each Eta group

We define an Eta group as 2 or more atoms that are bound together and also bound to a metal atom

Parameters

dummy_style (bool) – Whether to also find eta ligands that are bound by bonding all the ligand atoms to a dummy and then the dummy to the metal. If False, only those ligands that have all eta atoms bound directly to the metal will be found.

Note

The function assumes that the self.metals property is set to a list of metal atoms and it creates the self.eta_groups and self_all_eta_atoms properties

class schrodinger.application.matsci.buildcomplex.ComplexSplitter(struct, asl='metals', metals=None)[source]

Bases: schrodinger.application.matsci.buildcomplex.EtaFindingMixin

Splits a metal complex into a set of ligand structures that bind to the metal

findEtaGroups(dummy_style=True)

Find each Eta group

We define an Eta group as 2 or more atoms that are bound together and also bound to a metal atom

Parameters

dummy_style (bool) – Whether to also find eta ligands that are bound by bonding all the ligand atoms to a dummy and then the dummy to the metal. If False, only those ligands that have all eta atoms bound directly to the metal will be found.

Note

The function assumes that the self.metals property is set to a list of metal atoms and it creates the self.eta_groups and self_all_eta_atoms properties

METAL_BINDER_PROP = 'i_matsci_binding_metal'
__init__(struct, asl='metals', metals=None)[source]

Create a ComplexSplitter instance

Parameters
findBindingAtoms()[source]

Make a list of all atoms that bind to metal atoms

addDummyAtoms()[source]

Add a dummy atom to each binding atom. For eta ligands, a single dummy atom is added at the centroid of the eta atoms. For non-eta ligands, a dummy atom is added along the atom-metal bond vector.

addEtaDummy(group)[source]

Put a dummy atom at the centroid of the haptic ligand

Parameters

group (list) – A list of atom objects that form the haptic ligand

addBinderDummy(atom)[source]

Add a dummy atom on the atom-metal bond vector that will indicate the proper bond direction after the metal atom is deleted.

Parameters

atom (schrodinger.structure._StructureAtom) – An atom that is bound to the metal

createLigandStructures()[source]

Create individual structures for each ligand. A ligand is defined as a molecule that remains intact after deleting the central metal atom.

static markRAtomValues(struct)[source]
splitIntoLigands()[source]

Split the metal complex into ligands

Return type

list

Returns

A list of schrodinger.structure.Structure objects, each one represents a unique ligand from the original complex. The ligands will have binding sites to the metal marked with dummy atoms

static getUniqueLigands(ligands, title=None)[source]

Remove duplicate ligands

Parameters

ligands (list) – A list of schrodinger.structure.Structure objects, each one represents a ligand.

Return type

list

Returns

A list of schrodinger.structure.Structure objects, taken from the input ligands and with duplicates removed.

schrodinger.application.matsci.buildcomplex.are_duplicates(ref, comp, tolerance=1.0, check_optical=True)[source]

Check if both compounds are duplicate structures. Uses canonical SMILES to detect structures with the same chemical bonding, then Works via actual XYZ coordinates to determine if the structures are duplicates. This is slow, but works for metal complexes.

Note: Requires compounds with reasonable (or consistent) 3D coordinates

Note: Rotomers of haptic ligands about the haptic axis are generally found

to be different compounds with the default tolerance of 1.0

Note: Has been tested and seems to work with coordination numbers of 3-6,

and monodentate, bidentate and haptic ligands

Parameters
  • ref (schrodinger.structure.Structure) – The reference complex

  • comp (schrodinger.structure.Structure) – The structure to compare to the reference

  • tolerance (float) – The maximum displacement of any one atom before the compounds are considered different complexes

  • check_optical (bool) – If True, check for optical isomers (and consider them duplicates) by inverting comp about the first atom (assumed to be the metal atom) and performing the same RMSD check against ref. If False, no check is made.

Return type

bool

Returns

True if the compounds are found to be identical, False if not

Raises

ValueError – If there are fewer than 3 usable atoms for the superposiiton

class schrodinger.application.matsci.buildcomplex.ComplexConformerRmsd(reference_structure, test_structure=None, asl_expr='NOT atom.element H', in_place=True)[source]

Bases: schrodinger.structutils.rmsd.ConformerRmsd

__init__(reference_structure, test_structure=None, asl_expr='NOT atom.element H', in_place=True)
Parameters
  • reference_structure (structure.Structure) – Template structure

  • test_structure (structure.Structure) – The mobile structure.

  • asl_expr (string) – Atom Language Expression to identify the the atoms used to calculate the RMSD and base the superimpose alignment.

  • in_place (Boolean) – If True, calculate the RMSD without moving the test_structure. Otherwise, perform the optimal alignment then calculate the RMSD.

calculate()
Returns

Root-mean-squared difference of atom coordinates.

Type

float

Raise

ValueError if working versions of the reference and test structures don’t have the same shape (non-confs).

The order of operations:
  • prepare working copies of the reference and test structures.

    ** copy the structures. ** encode the original atom indexes as atom properties. ** extract substructure of the atoms matching the ASL. ** reduce to heavy atom graph (instance option, non-default). ** normalize numbering scheme (instance option, default).

  • determine molecular symmetry mapping (optional, default).

  • create a numpy coordinate array for the working structures.

  • numpy linear algebra SVD to superimpose (instance option).

    ** transform test_structure

  • numpy array used to calculate RMSD, and max_dist.

  • decode original indexes to identify atoms involve in max dist.

evaluateAsl(st)

Return the atoms of the input structure that match <asl_expr>.

Parameters

st (structure.Structure) – Structure to evaluate

Returns

Atoms matching the ASL

Return type

list of ints

:raise RuntimeError if ASL matching failed.

getRmsdDataname()
Returns

m2io property dataname string. The property name indicates the reference structure, the title, the ASL used to identify comparison atoms and if the structure is in-place or mobile.

Return type

string

orig_index_prop = 'i_confrmsd_original_index'
populatePatternDict(st)

Populates the self._mol_pattern_dict based on the molecules in the given structure.

renumberBySymmetry()

Renumber the atoms in _working_test_st based off the reference structure ussing mmsym.

writeCommand(file_name='rmsd.cmd')

Writes a Maestro command file and structures with the pair wise atom mapping in command file mode. The Maestro file has the same basename as the command file. Clobbers existing files.

Parameters

file_name (string) – Path to the maestro command file with the atom pairings.

Raise

ValueError if file_name does not have ‘.cmd’ extension.

writeStructures(file_name='rmsd.mae', mode='w')

Writes the reference and test structures to file.

Parameters
  • file_name (string) – Path of the structure file to write.

  • mode (string) – ‘w’ => write, clobber as needed ‘a’ => append

renumberWorkingStructures(has_hydrogens)[source]

Renumber the working structure so that it has atoms in the same order as the reference structure

Parameters

has_hydrogens – Ignored