schrodinger.application.jaguar.autots_rmsd module

methods for comparison of structures using rmsd

class schrodinger.application.jaguar.autots_rmsd.MapScore(score, atom_map)

Bases: tuple

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

atom_map

Alias for field number 1

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

score

Alias for field number 0

schrodinger.application.jaguar.autots_rmsd.reform_barely_broken_bonds(st1, st2, fraction_different=0.5, reform_always=False)[source]

Given two structures that have consistently ordered atoms, reform bonds that have not broken very much (stretched by less than fraction_different*d0). Return False if not all broken bonds can be reformed. Structures are run through mmlewis to get new bond orders and formal charges.

Parameters
  • st1 (Structure) – the first structure

  • st2 (Structure) – the second structure

  • fraction_different (float) – if a bond breaks then it is also required that the bond distance increases by a factor of fraction_different*d0 where d0 is the bond distance before breaking

  • reform_always (bool) – If True, reform barely broken bonds even when doing so will not make the two structures into conformers. If False, only reform such bonds if doing so would render the two structures conformers.

schrodinger.application.jaguar.autots_rmsd.molecule_lists_are_conformers(m1, m2, same_molecularity=True)[source]

Compare two non-empty lists of structures and return True if matching pairs of conformers can be found. The structures in m1 and m2 are assumed to be fully connected (molecules) if same_molecularity==True.

Returns False if the number of molecules differs and same_molecularity==True.

Parameters
  • m1 (list of structures) – first list of molecules

  • m2 (list of structures) – first list of molecules

  • same_molecularity (bool) – if True, require that the two lists be the same length (i.e. number of molecules)

Return type

bool

Returns

whether or not the two lists of molecules are conformers

schrodinger.application.jaguar.autots_rmsd.align_all_molecules(st1, st2, sort_rms=True)[source]

Inspects whether or not all the molecules in reactant are conformers of those in product. If they are, each molecule in product is superimposed onto the corresponding reactant molecule.

Parameters
  • st1 (schrodinger.structure.Structure instance) – structure 1

  • st2 (schrodinger.structure.Structure instance) – structure 2

  • sort_rms (boolean) – If True the structure in which the inter-molecule distances are larger is superimposes onto the smaller, see sort_by_centroid_distance, which does the sorting.

schrodinger.application.jaguar.autots_rmsd.sort_by_centroid_distance(strs)[source]

Given a list of structures sort the list in non-decreasing order using the rms distance between molecules in the structures. e.g. for two structures which are each water dimers, the water dimer with the smaller intermolecular distance would appear first in the list

Parameters

strs (list of schrodinger.structure.Structure instances) – list of structures to be sorted

Return type

list of schrodinger.structure.Structure instances

Returns

sorted list

schrodinger.application.jaguar.autots_rmsd.align_path_strs(path_strs)[source]

Align the structures in a path.

Parameters

path_strs (list of structures) – the structures along the path

schrodinger.application.jaguar.autots_rmsd.order_atoms(reactant, product, debug=False)[source]

Renumber atoms in reactant and product in a consistent fashion.

Parameters
Return type

tuple of two structures

Returns

renumbered reactant and product

class schrodinger.application.jaguar.autots_rmsd.AutoTSAtomMapper(optimize_mapping, use_chirality, debug=False)[source]

Bases: schrodinger.comparison.atom_mapper.BaseAtomMapper

RMSD_THRESH = 1e-08
__init__(optimize_mapping, use_chirality, debug=False)[source]
Parameters
  • optimize_mapping (boolean) – if True search over all bijections to find the one with lowest score

  • use_chirality (boolean) – if True, in addition to element type use chirality (where defined) to equate atoms.

initialize_atom_types(st, invert_stereocenters=False)[source]

Initialize the atom types

Parameters
  • st (Structure) – structure containing atoms

  • invert_stereocenters (boolean) – whether or not R/S labels should be flipped

score_mapping(st1, st2, atset)[source]

Scores a particular atom reordering.

Parameters
  • st1 (Structure) – first structure

  • st2 (Structure) – second structure

  • atset (set of integers) – the atoms which have been mapped. This may be a subset of the atoms in the two structures as we test partial as well as full maps.

Returns

any metric which measures the goodness of a particular relative atom ordering in st1 and st2. Can be any type that has the less than operator implemented.

score_is_equivalent(score1, score2)[source]

Here we declare 2 scores equivalent if the same number of chirality mismatches are present and the rmsd difference is within RMSD_THRESH. This resolves machine dependent descrepancies in the chosen map.

Parameters
  • score1 (tuple) – the first score (chirality mismatches, active atoms, rms)

  • score2 (tuple) – the first score (chirality mismatches, active atoms, rms)

Returns

boolean indicating if the score is the same or different

determine_active_bonds_info(st1, st2, atlist)[source]

Determine the number of active bonds after numbering and the number of components.

It is possible for the numbering code to “deactivate” an active bond and such numbering should be considered invalid. The way this might happen is for the numbering to lead to two active bonds to be numbered equivalently. Say you have a reactant water with an O-H active and a product water with an O-H active (for example, in a water wire). The numbering code could decide to number both of these O’s the same and both H’s the same. Thus, the code thinks it has both O-H’s active but, in reality, now neither are because the equivalently numbered atoms have bonds in both reactant and product.

The active bonds have been stored as a binary vector (i.e. an int). An active bond- destroying numbering will have the same two atom numbers as the endpoint of more than one active bond.

We define the number of ‘components’ as the number of disjoint sets of molecules that are involved in active bonds. That is, if all active bonds in reactants and products were drawn in one structure, how many “molecules” would there be? For example, it is possible to number a set of bonds in the reaction A+B+C+D -> E+F, where A+B->E and C+D->F or one in which atoms from all 4 reactant molecules appear among all 2 of the products. The former case is a 2-component reaction (consisting of (A, B, E) and (C, D, F)) and the latter is a 1-component reaction (A, B, C, D, E ,F). We assume that the user put in an irreducible reaction, and hence fewer component renumbered solutions are to be preferred.

Parameters
  • st1 (Structure) – first structure

  • st2 (Structure) – second structure

  • atlist (list of ints) – list of atoms that have been mapped (indexes refer to both structures)

Return type

(int, int)

Returns

number of active bonds from this numbering, number of components

ATOM_TYPE = 's_m_custom_atom_type'
MAPPER_INDEX = 'i_m_atom_mapper_index'
are_conformers(st1, atlist1, st2, atlist2)

Determine if the two substructures, as defined by the atom lists, are conformers but do not explore isomorphisms.

Parameters
  • st1 (Structure) – the first structure

  • atlist1 (list of ints) – list of atom indexes defining the first substructure

  • st2 (Structure) – the second structure

  • atlist2 (list of ints) – list of atom indexes defining the second substructure

Returns

boolean indicating whether or not the two structures are conformers

are_consistently_ordered_conformers(st1, st2, atlist)

Determine if two substructures are consistently ordered conformers. That is, they have the same atom numbering and bonding

Parameters
  • st1 (Structure) – the first structure

  • st2 (Structure) – the second structure

  • atlist (list of ints) – list of atom indexes defining the substructure

Returns

boolean indicating whether or not the two structures are ordered conformers

are_enantiomers(st1, atlist1, st2, atlist2)

Determine if the two substructures, as defined by the atom lists, are enantiomers but do not explore isomorphisms.

Parameters
  • st1 (Structure) – the first structure

  • atlist1 (list of ints) – list of atom indexes defining the first substructure

  • st2 (Structure) – the second structure

  • atlist2 (list of ints) – list of atom indexes defining the second substructure

Returns

boolean indicating whether or not the two structures are conformers

comparator(d1, d2)

Comparison function to be used to determine if two nodes on graph are equivalent.

If this method is not used when constructing a GraphMatcher, node attributes will not be considered for the purpose of determining isomorphism.

Parameters
  • d1 (dict) – key=value dictionary from graph returned from st_to_graph which represents node 1

  • d1 – key=value dictionary from graph returned from st_to_graph which represents node 2

Returns

boolean indicating equilvalence

get_atom_type(at)

This value is used as an atom property

Parameters

at (_StructureAtom) – atom we wish to obtain a type for

Returns

string which identifies atom type

invert_chirality(ch_list)

Invert the chirality (R/S) of an input list of chiralities.

Parameters

ch_list (list of strings) – list of chirality labels for a structure

isomeric_atom_sets(st1, atset1, st2, atset2)

Check that the atom types in atset1 are the same as those in atset2. If not, the two structures cannot be conformers.

Parameters
  • st1 (Structure) – the first structure

  • atset1 (set of ints) – set of atom indexes defining the first substructure

  • st2 (Structure) – the second structure

  • atset2 (set of ints) – set of atom indexes defining the second substructure

Returns

a boolean indicating if these atom lists are isomeric

reorder_structures(st1, atlist1, st2, atlist2, invert_stereocenters=False)

Reorder the atoms in the two structures.

Parameters
  • st1 (Structure) – the first structure

  • atlist1 (list of ints) – list of atom indexes defining the first substructure

  • st2 (Structure) – the second structure

  • atlist2 (list of ints) – list of atom indexes defining the second substructure

Returns

the two structures with structure 2 having had atoms reordered

set_atom_type(at, value)

Set the value of the atom type

Parameters
  • at (_StructureAtom) – atom we wish to set type for

  • value (string) – set the type of atom to this

st_to_graph(st, atset)

Convert Structure instance to a networkx Graph using _StructureAtom instances as nodes and adding an atom type property

Parameters
  • st (Structure) – the structure to convert

  • atset (set of ints) – a set of atoms to use to create the graph

Returns

networkx Graph

unique_job_name(base_name)

Add an integer to the end of the base_name to get a unique name.

Parameters

base_name (str) – base job name

class schrodinger.application.jaguar.autots_rmsd.AutoTSTemplateAtomMapper(optimize_mapping, use_chirality, debug=False)[source]

Bases: schrodinger.application.jaguar.autots_rmsd.AutoTSAtomMapper

RMSD_THRESH = 1e-08
initialize_atom_types(st, active_ats, invert_stereocenters=False)[source]

Initialize the atom types

Parameters
  • st (Structure) – structure containing atoms

  • active_ats (list of ints) – atom indices of the reaction center

  • invert_stereocenters (boolean) – whether or not R/S labels should be flipped

choose_template_map(reactant, product, input_indexes, r_template, p_template, template_indexes)[source]

Determine the optimal map from the input reactant and product structures to the template reactant and product structures.

Parameters
  • reactant (Structure instance) – input reactant structure

  • product (Structure instance) – input product structure

  • input_indexes (RxnIndxDecomp instance) – breakdown of input atom indexes into core, reaction center

  • r_template (Structure instance) – template reactant structure

  • p_template (Structure instance) – template product structure

  • template_indexes (RxnIndxDecomp instance) – breakdown of template atom indexes into core, reaction center

Return type

dict

Returns

mapping from input number to template numbering

ATOM_TYPE = 's_m_custom_atom_type'
MAPPER_INDEX = 'i_m_atom_mapper_index'
__init__(optimize_mapping, use_chirality, debug=False)
Parameters
  • optimize_mapping (boolean) – if True search over all bijections to find the one with lowest score

  • use_chirality (boolean) – if True, in addition to element type use chirality (where defined) to equate atoms.

are_conformers(st1, atlist1, st2, atlist2)

Determine if the two substructures, as defined by the atom lists, are conformers but do not explore isomorphisms.

Parameters
  • st1 (Structure) – the first structure

  • atlist1 (list of ints) – list of atom indexes defining the first substructure

  • st2 (Structure) – the second structure

  • atlist2 (list of ints) – list of atom indexes defining the second substructure

Returns

boolean indicating whether or not the two structures are conformers

are_consistently_ordered_conformers(st1, st2, atlist)

Determine if two substructures are consistently ordered conformers. That is, they have the same atom numbering and bonding

Parameters
  • st1 (Structure) – the first structure

  • st2 (Structure) – the second structure

  • atlist (list of ints) – list of atom indexes defining the substructure

Returns

boolean indicating whether or not the two structures are ordered conformers

are_enantiomers(st1, atlist1, st2, atlist2)

Determine if the two substructures, as defined by the atom lists, are enantiomers but do not explore isomorphisms.

Parameters
  • st1 (Structure) – the first structure

  • atlist1 (list of ints) – list of atom indexes defining the first substructure

  • st2 (Structure) – the second structure

  • atlist2 (list of ints) – list of atom indexes defining the second substructure

Returns

boolean indicating whether or not the two structures are conformers

comparator(d1, d2)

Comparison function to be used to determine if two nodes on graph are equivalent.

If this method is not used when constructing a GraphMatcher, node attributes will not be considered for the purpose of determining isomorphism.

Parameters
  • d1 (dict) – key=value dictionary from graph returned from st_to_graph which represents node 1

  • d1 – key=value dictionary from graph returned from st_to_graph which represents node 2

Returns

boolean indicating equilvalence

determine_active_bonds_info(st1, st2, atlist)

Determine the number of active bonds after numbering and the number of components.

It is possible for the numbering code to “deactivate” an active bond and such numbering should be considered invalid. The way this might happen is for the numbering to lead to two active bonds to be numbered equivalently. Say you have a reactant water with an O-H active and a product water with an O-H active (for example, in a water wire). The numbering code could decide to number both of these O’s the same and both H’s the same. Thus, the code thinks it has both O-H’s active but, in reality, now neither are because the equivalently numbered atoms have bonds in both reactant and product.

The active bonds have been stored as a binary vector (i.e. an int). An active bond- destroying numbering will have the same two atom numbers as the endpoint of more than one active bond.

We define the number of ‘components’ as the number of disjoint sets of molecules that are involved in active bonds. That is, if all active bonds in reactants and products were drawn in one structure, how many “molecules” would there be? For example, it is possible to number a set of bonds in the reaction A+B+C+D -> E+F, where A+B->E and C+D->F or one in which atoms from all 4 reactant molecules appear among all 2 of the products. The former case is a 2-component reaction (consisting of (A, B, E) and (C, D, F)) and the latter is a 1-component reaction (A, B, C, D, E ,F). We assume that the user put in an irreducible reaction, and hence fewer component renumbered solutions are to be preferred.

Parameters
  • st1 (Structure) – first structure

  • st2 (Structure) – second structure

  • atlist (list of ints) – list of atoms that have been mapped (indexes refer to both structures)

Return type

(int, int)

Returns

number of active bonds from this numbering, number of components

get_atom_type(at)

This value is used as an atom property

Parameters

at (_StructureAtom) – atom we wish to obtain a type for

Returns

string which identifies atom type

invert_chirality(ch_list)

Invert the chirality (R/S) of an input list of chiralities.

Parameters

ch_list (list of strings) – list of chirality labels for a structure

isomeric_atom_sets(st1, atset1, st2, atset2)

Check that the atom types in atset1 are the same as those in atset2. If not, the two structures cannot be conformers.

Parameters
  • st1 (Structure) – the first structure

  • atset1 (set of ints) – set of atom indexes defining the first substructure

  • st2 (Structure) – the second structure

  • atset2 (set of ints) – set of atom indexes defining the second substructure

Returns

a boolean indicating if these atom lists are isomeric

reorder_structures(st1, atlist1, st2, atlist2, invert_stereocenters=False)

Reorder the atoms in the two structures.

Parameters
  • st1 (Structure) – the first structure

  • atlist1 (list of ints) – list of atom indexes defining the first substructure

  • st2 (Structure) – the second structure

  • atlist2 (list of ints) – list of atom indexes defining the second substructure

Returns

the two structures with structure 2 having had atoms reordered

score_is_equivalent(score1, score2)

Here we declare 2 scores equivalent if the same number of chirality mismatches are present and the rmsd difference is within RMSD_THRESH. This resolves machine dependent descrepancies in the chosen map.

Parameters
  • score1 (tuple) – the first score (chirality mismatches, active atoms, rms)

  • score2 (tuple) – the first score (chirality mismatches, active atoms, rms)

Returns

boolean indicating if the score is the same or different

score_mapping(st1, st2, atset)

Scores a particular atom reordering.

Parameters
  • st1 (Structure) – first structure

  • st2 (Structure) – second structure

  • atset (set of integers) – the atoms which have been mapped. This may be a subset of the atoms in the two structures as we test partial as well as full maps.

Returns

any metric which measures the goodness of a particular relative atom ordering in st1 and st2. Can be any type that has the less than operator implemented.

set_atom_type(at, value)

Set the value of the atom type

Parameters
  • at (_StructureAtom) – atom we wish to set type for

  • value (string) – set the type of atom to this

st_to_graph(st, atset)

Convert Structure instance to a networkx Graph using _StructureAtom instances as nodes and adding an atom type property

Parameters
  • st (Structure) – the structure to convert

  • atset (set of ints) – a set of atoms to use to create the graph

Returns

networkx Graph

unique_job_name(base_name)

Add an integer to the end of the base_name to get a unique name.

Parameters

base_name (str) – base job name