schrodinger.livedesign.molhash module

class schrodinger.livedesign.molhash.Layers(canonical_smiles, enhanced_stereo_label, escape, formula, no_stereo_smiles, no_stereo_tautomer, sgroup_data, tautomer)[source]

Bases: tuple

canonical_smiles: str

Alias for field number 0

enhanced_stereo_label: str

Alias for field number 1

escape: str

Alias for field number 2

formula: str

Alias for field number 3

no_stereo_smiles: str

Alias for field number 4

no_stereo_tautomer: str

Alias for field number 5

sgroup_data: str

Alias for field number 6

tautomer: str

Alias for field number 7

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

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.

schrodinger.livedesign.molhash.generate_molhash(all_layers, layers_to_hash)[source]

Generates a molecular hash using a specified set of layers. See https://docs.google.com/document/d/13MLGoCPAjD6VhytcJp-F9MHhiEdmNmpjG5blraAtI8s/edit?usp=sharing for explanation the layer idea.

Parameters
  • all_layers – All of the canonicalization layers generated for this molecule

  • layers_to_hash – The names of the layers to base the hash off of

schrodinger.livedesign.molhash.get_mol_layers(original_molecule, sgroup_data='', escape='')[source]

returns a NamedTuple with the layers for a molecule that might be useful in a hash

NOTE the enhanced_stereo_label layer produced by this code uses the atom numbers from the canonical_smiles layer. It is not suitable for combining with the tautomer layer!

TODOs:
  • The sgroup_data layer is just being treated as a string (i.e. not canonicalized) here

schrodinger.livedesign.molhash.get_stereo_tautomer(molecule)[source]
schrodinger.livedesign.molhash.get_canonical_smiles(tautomer_smiles)[source]
schrodinger.livedesign.molhash.get_no_stereo_layers(molecule, canonical_smiles, tautomer)[source]
schrodinger.livedesign.molhash.get_canonical_atom_ranks_and_bonds(mol, useSmilesOrdering=True)[source]

returns a 2-tuple with: 1. the canonical ranks of a molecule’s atoms 2. the bonds expressed as (canonical_atom_rank_1,canonical_atom_rank_2) where

canonical_atom_rank_1 < canonical_atom_rank_2

If useSmilesOrdering is True then the atom indices here correspond to the order of the atoms in the canonical SMILES, otherwise just the canonical atom order is used. useSmilesOrdering=True is a bit slower, but it allows the output to be linked to the canonical SMILES, which can be useful.

schrodinger.livedesign.molhash.canonicalize_data_sgroup(sg, atRanks, bndOrder, fieldNames=None, sortAtomOrder=True)[source]

NOTES: if sortAtomOrder is true then the atom list will be sorted. This assumes that the order of the atoms in that list is not important

schrodinger.livedesign.molhash.getCanonicalBondRep(bond, atomRanks)[source]
schrodinger.livedesign.molhash.canonicalize_sru_sgroup(mol, sg, atRanks, bndOrder, sortAtomAndBondOrder)[source]

NOTES: if sortAtomAndBondOrder is true then the atom and bond lists will be sorted. This assumes that the ordering of those lists is not important

schrodinger.livedesign.molhash.canonicalize_cop_sgroup(mol, sg, atRanks, bndOrder, sortAtomAndBondOrder)[source]

NOTES: if sortAtomAndBondOrder is true then the atom and bond lists will be sorted. This assumes that the ordering of those lists is not important

schrodinger.livedesign.molhash.canonicalize_sgroups(mol, dataFieldNames=None, sortAtomAndBondOrder=True)[source]

NOTES: if sortAtomAndBondOrder is true then the atom and bond lists will be sorted. This assumes that the ordering of those lists is not important

class schrodinger.livedesign.molhash.EnhancedStereoUpdateMode(value)[source]

Bases: enum.Enum

An enumeration.

ADD_WEIGHTS = 1
REMOVE_WEIGHTS = 2
schrodinger.livedesign.molhash.update_enhanced_stereo_group_weights(mol, mode)[source]
schrodinger.livedesign.molhash.canonicalize_stereo_groups(mol)[source]

Returns canonical CXSmiles and the corresponding molecule with the stereo groups canonicalized.

The RDKit canonicalization code does not currently take stereo groups into account. We work around that by using EnumerateStereoisomers() to generate all possible instances of the molecule’s stereogroups and then lexically compare the CXSMILES of those.