schrodinger.comparison.comparison module

Answers to the question of ‘are these two structures the same?’ using various definitions of ‘the same’

schrodinger.comparison.comparison.are_isomers(st1: Structure, st2: Structure) → bool

Determines if the two structures are isomers (same number of each type of element)

Parameters:
  • st1 – the first structure

  • st2 – the second structure

Return bool:

True if st1 and st2 are isomers (including charge)

schrodinger.comparison.comparison.are_conformers(st1: Structure, st2: Structure, use_lewis_structure: bool = True, use_stereo: bool = False) → bool

Determines if the two structures are conformers (atom order independent). This does not make any assumptions about atom ordering being initially correct and, if that is your case this may not be the appropriate tool.

Parameters:
  • st1 – the first structure

  • st2 – the second structure

  • use_lewis_structure – if True, use atomic symbol, formal charge and bond orders to define equivalence of atoms, else use only atomic symbol. The former definition is more traditional whereas the latter only requires consistent connectivity

  • use_stereo – if True also use atomic stereochemical labels generated by mmstereo to equate atoms. This includes E/Z labels but excludes the labels ANR, ANS. i.e. answer the question of whether these structures are stereoisomers

Returns:

True if st1 and st2 are conformers

schrodinger.comparison.comparison.are_tautomers(st1: Structure, st2: Structure, use_stereo: bool = False) → bool

Determines if the two structures are tautomers by inspecting if the heavy atom connectivity is the same. Here, the definition of the same uses connectivity only, it is not assumed bond orders are the same. This does not make any assumptions about atom ordering being initially correct and, if that is your case this may not be the appropriate tool.

We remove hydrogens that are connected to atoms that are not chiral centers. This is to avoid hydrogen atoms, which are ignored in this procedure, from causing symmetry-breaking at remote heavy atom sites. We leave H’s directly attached to chiral centers effectively as dummy atoms to ensure that chirality of the remaining three substituents is computed.

Parameters:
  • st1 – the first structure

  • st2 – the second structure

  • use_stereo – if True also use atomic stereochemical labels generated by mmstereo to equate atoms.

Returns:

True if st1 and st2 are tautomers

schrodinger.comparison.comparison.are_heavy_atom_conformers(st1: Structure, st2: Structure, use_stereo: bool = False) → bool

Determines if the two structures are heavy-atom conformers (i.e. if, ignoring hydrogens, they are conformers) by inspecting if the heavy atom connectivity is the same. We do not check that the strucutres are isomers, so differently protonated forms (e.g. H2O and -OH and H3O+ would all be considered heavy-atom conformers). Here, the definition of the same uses connectivity only, it is not assumed bond orders are the same. This does not make any assumptions about atom ordering being initially correct and, if that is your case this may not be the appropriate tool.

We remove hydrogens that are connected to atoms that are not chiral centers. This is to avoid hydrogen atoms, which are ignored in this procedure, from causing symmetry-breaking at remote heavy atom sites. We leave H’s directly attached to chiral centers effectively as dummy atoms to ensure that chirality of the remaining three substituents is computed.

Parameters:
Returns:

True if st1 and st2 are heavy atom conformers

schrodinger.comparison.comparison.are_stereoisomers(st1: Structure, st2: Structure, use_lewis_structure: bool = True) → bool

Determines if the two structures are stereoisomers (atom order independent). A molecule is not a stereoisomer of itself, i.e. are_stereoisomers(st, st)==False This does not make any assumptions about atom ordering being initially correct and, if that is your case this may not be the appropriate tool.

Parameters:
  • st1 (Structure) – the first structure

  • st2 (Structure) – the second structure

  • use_lewis_structure (bool) – if True, use atomic symbol, formal charge and bond orders to define equivalence of atoms, else use only atomic symbol. The former definition is more traditional whereas the latter only requires consistent connectivity

Returns:

bool

schrodinger.comparison.comparison.are_enantiomers(st1: Structure, st2: Structure, use_lewis_structure: bool = True) → bool

Determines if the two structures are enantiomers (atom order independent). This does not make any assumptions about atom ordering being initially correct and, if that is your case this may not be the appropriate tool.

Parameters:
  • st1 – the first structure

  • st2 – the second structure

  • use_lewis_structure – if True, use atomic symbol, formal charge and bond orders to define equivalence of atoms, else use only atomic symbol. The former definition is more traditional whereas the latter only requires consistent connectivity

Returns:

True if st1 and st2 are enantiomers

schrodinger.comparison.comparison.are_diastereomers(st1: Structure, st2: Structure, use_lewis_structure: bool = True) → bool

Determines if the two structures are diastereomers (atom order independent). This does not make any assumptions about atom ordering being initially correct and, if that is your case this may not be the appropriate tool.

Parameters:
  • st1 – the first structure

  • st2 – the second structure

  • use_lewis_structure – if True, use atomic symbol, formal charge and bond orders to define equivalence of atoms, else use only atomic symbol. The former definition is more traditional whereas the latter only requires consistent connectivity

Returns:

True if st1 and st2 are diastereomers

schrodinger.comparison.comparison.are_consistently_numbered_conformers(st1: Structure, st2: Structure, use_lewis_structure: bool = False, use_stereo: bool = False) → bool

Determines if two structures are conformers with a consistent atom numbering.

This doesn’t check that the numbering is the one that minimizes RMSD, merely that the two structures’ are conformers including the current atom numbering (i.e. the two structures can be perfectly superposed by rotations, translations, and adjusting internal torsional angles). NOTE: this function does not check atom-numbering chirality.

Parameters:
  • st1 – the first structure

  • st2 – the second structure

  • use_lewis_structure – if True, use atomic symbol, formal charge and bond orders to define equivalence of atoms, else use only atomic symbol. The former definition is more traditional whereas the latter only requires consistent connectivity

  • use_stereo – if True also use atomic stereochemical labels generated by mmstereo to equate atoms. This includes E/Z labels (when use_lewis_structure is True) but excludes the labels ANR, ANS.

Returns:

True if st1 and st2 are consistently numbered conformers

schrodinger.comparison.comparison.are_same_geometry(st1: Structure, st2: Structure, rms_thresh: float = 0.25, use_lewis_structure: bool = False) → bool

Determines if two structures are conformers with the same geometry. Assumes that structures are already consistently numbered.

Parameters:
  • st1 – the first structure

  • st2 – the second structure

  • rms_thresh – Threshold for RMSD to be considered the same geometry

  • use_lewis_structure – if True, use atomic symbol, formal charge and bond orders to define equivalence of atoms, else use only atomic symbol. The former definition is more traditional whereas the latter only requires consistent connectivity

Returns:

True if st1 and st2 are the same geometry

schrodinger.comparison.comparison.have_matching_distance_spectra(st1: Structure, st2: Structure, dist_thresh: float = 0.25) → bool

Determines if two structures have the same interatomic distance spectra.

For each unordered element pair, the sorted distances between atoms of that pair are compared. That spectrum is invariant under any rigid motion, proper or improper, and under permutation of atoms, so unlike are_same_geometry this requires neither a consistent atom numbering nor any bonding, and it accepts a mirror image. Use it on a multi-molecule cluster in which a reflection moves atoms between molecules, or wherever an improper operation is an acceptable match, such as comparing crystal packings in a non-Sohncke space group.

Warning

This is a necessary but not a sufficient condition for congruence. It compares an invariant instead of constructing a superposition, so it returns True for two structures that merely share a spectrum. Two distinct classes of false positive are worth knowing about:

  • Enantiomers. An improper operation leaves every interatomic distance unchanged, so a structure and its mirror image always match. That is the point of the function, but it means a caller who needs to tell two enantiomers apart cannot use it.

  • Homometric structures, which are genuinely non-congruent yet share a spectrum. Collinear points at 0, 1, 4, 10, 12 and 17 Angstroms and at 0, 1, 8, 11, 13 and 17 Angstroms are the standard small example.

Treat a True result as “not ruled out”, and follow it with are_same_geometry or an explicit superposition where congruence actually has to be established.

Parameters:
  • st1 – the first structure

  • st2 – the second structure

  • dist_thresh – threshold, in Angstroms, for two corresponding interatomic distances to be considered the same

Returns:

True if st1 and st2 have matching distance spectra