schrodinger.application.jaguar.autots_rmsd module

methods for comparison of structures using rmsd

schrodinger.application.jaguar.autots_rmsd.compare_consistently_ordered_structures(st1, st2, heavy_only=False, fraction_different=0.5, fix_bonds=True)

Compare two structures by individually superimposing the molecules contained in these structures.

raises a ConformerError the two structures are not conformers. It is assumed that the atoms in st1 and st2 are consistently ordered

Parameters:
  • st1 (Structure instance) – structure 1
  • st2 (Structure instance) – structure 2
  • heavy_only (boolean) – if true, only use heavy atoms in computing rms
  • fraction_different (float) – if a bond breaks then it is also required that the bond distance increases by a factor of 0.5*d0 where d0 is the bond distance before breaking
  • fix_bonds (boolean) – if True and if the structures are determined to be conformers then any bonds that are broken but are less than a fraction_difference different are reformed. If this operation is performed we also run any modified structures through mmlewis to get new bond orders and formal charges.
Return type:

RMS difference

schrodinger.application.jaguar.autots_rmsd.are_consistently_ordered_conformers(st1, st2, fraction_different=0.5, fix_bonds=True)

Given two structures that have consistently ordered atoms. Analyze the bonding to see if the two structures are conformers.

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 0.5*d0 where d0 is the bond distance before breaking
  • fix_bonds (boolean) – if True and if the structures are determined to be conformers then any bonds that are broken but are less than a fraction_difference different are reformed. If this operation is performed we also run any modified structures through mmlewis to get new bond orders and formal charges.
schrodinger.application.jaguar.autots_rmsd.are_conformers(st1, st2, consistently_ordered=False)

Determine if two structures are conformers. st1 and st2 can either be lists of Structures or single Structure instances. If they are lists than the Structures in the lists are assumed to be fully connected (molecules, not complexes)

Parameters:
  • st1 (Structure or list of Structures) – first structure
  • st2 (Structure or list of Structures.) – second structure
  • consistently_ordered (boolean) – if True, the atoms in st1 and st2 consistently ordered.
Returns:

True/False if two structures are conformers

schrodinger.application.jaguar.autots_rmsd.are_same_structure(st1, st2, rms_thresh, heavy_only, conformers_only, consistently_ordered=False)

Determine if two structures are the same.

st1 and st2 can either be lists of Structures or single Structure instances. If they are lists than the Structures in the lists are assumed to be fully connected (molecules, not complexes)

If consistently_ordered=True and the consistently ordered comparison returns False we apply the comparison for inconsistently ordered structures as a backup test.

Parameters:
  • st1 (Structure or list of Structures) – first structure
  • st2 (Structure or list of Structures) – second structure
  • rms_thresh (float) – threshold for RMS only used if conformers_only=False
  • heavy_only (boolean) – if True excude hydrogens when computing RMS
  • conformers_only (boolean) – if True, only require that structures are conformers
  • consistently_ordered (boolean) – if True, the atoms in st1 and st2 consistently ordered.
Returns:

True/False whether structures are the same.

schrodinger.application.jaguar.autots_rmsd.compare_structures(st1, st2, heavy_only=False)

Compare two structures by individually superimposing the molecules contained in these structures.

To clarify a structure can contain any number of molecules. A molecule is defined as a set of atoms that are bonded to one another. i.e. for a water dimer, there are two molecules that can be combined in a single structure.

Raises a IsomerError if the number of molecules differs or a ConformerError they are not conformers.

Parameters:
  • st1 (schrodinger.structure.Structure instance) – structure 1
  • st2 (schrodinger.structure.Structure instance) – structure 2
  • heavy_only (boolean) – if true, only use heavy atoms in computing rms
Return type:

float

:return average rms of difference between individual molecules

schrodinger.application.jaguar.autots_rmsd.compare_molecule_lists(m1, m2, heavy_only=False)

Compare two lists of molecules and return an average rms if matching pairs of conformers can be found. The structures in m1 and m2 are assumed to be fully connected (molecules).

Raises a IsomerError if the number of molecules differs or a ConformerError if matching conformers cannot be found.

Parameters:
  • m1 (list of structures) – first list of molecules
  • m2 (list of structures) – first list of molecules
  • heavy_only (boolean) – if true, only use heavy atoms in computing rms
Return type:

float

:return average rms of difference between individual molecules

schrodinger.application.jaguar.autots_rmsd.rms_structures(structure1, structure2, heavy_only=False)

Compute the rms between structures st1 and st2.

Raises a ValueError if the two structures are not isomers. and a ConformerError if the two structures are not conformers.

if nats = 1, we only compare element names if nats = 2 compare element names and return diff in bond length. else call above mentioned functions.

formal charges are removed before comparison.

Parameters:
  • structure1 (schrodinger.structure.Structure instance) – structure 1
  • structure2 (schrodinger.structure.Structure instance) – structure 2
  • heavy_only (boolean) – if true, only use heavy atoms in computing rms
Return type:

float

:return average rms of difference between individual molecules

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

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)

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)

Align the structures in a path.

Parameters:path_strs (list of structures) – the structures along the path
schrodinger.application.jaguar.autots_rmsd.impose_molecules_on_structure(st, mol_list, mol_indx)

Superimpose the molecules in mol_list onto the structure st.

each “molecule” in mol_list is a structure instance that is a substructure in st and must have an accompanying list of indexes in mol_indx. This is useful for optimizing the molecules in st then superimposing them into the same orientation.

Parameters:
  • st (structure instance) – structure object with molecules
  • mol_list (list of structure instances) – each entry is a structure which represents a molecule in st. One way to get this list is the following: mol_list = [mol.extractStructure() for mol in st.mol]
  • mol_indx (list of lists of ints) – list of atom indexes for each molecule. The indexes correspond to atoms in st. That is, it is a map from molecule atoms to structure atoms.
Returns:

A copy of the input structure with the molecules imposed onto their positions and orientations in the input structure (st).

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

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)

Bases: schrodinger.comparison.atom_mapper.BaseAtomMapper

RMSD_THRESH = 1e-08
__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.
initialize_atom_types(st, invert_stereocenters=False)

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)

Scores a particular atom reordering.

Parameters:
@pararm atset: 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)

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, rms)
  • score2 (tuple) – the first score (chirality mismatches, rms)

:return boolean indicating if the score is the same or different

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_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.

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