schrodinger.application.scaffold_enumeration.common module¶
- schrodinger.application.scaffold_enumeration.common.get_atom_id(atom)¶
Returns atom ID obtained either from the CML ID property or derived from the atom index in case the ID property is not available.
- Parameters
atom (rdkit.Chem.Atom) – Atom.
- Returns
Atom ID.
- Return type
str
- schrodinger.application.scaffold_enumeration.common.get_atom_id_map(mol)¶
Returns a dictionary that maps “atom IDs” (obtained via
get_atom_id()
) onto atom indices.- Parameters
mol (rdkit.Chem.Mol) – Molecule.
- Returns
Map between atom IDs and their indices in
mol
.- Return type
dict(str, int)
- schrodinger.application.scaffold_enumeration.common.get_bond_id(bond)¶
Returns bond ID obtained either from the CML ID property or derived from the bond index in case the ID property is not available.
- Parameters
bond (rdkit.Chem.Bond) – Bond.
- Returns
Bond ID.
- Return type
str
- schrodinger.application.scaffold_enumeration.common.get_sgroups(mol)¶
Returns list of dictionaries that represent “S-groups” from CML input. CML reader stores this data as a molecule-level property in JSON format.
- Parameters
mol (rdkit.Chem.Mol) – Molecule.
- Returns
List of dictionaries that contain “S-groups” as captured from CML input (XML attributes stored as key/value pairs).
- Return type
list(dict(str, str))
- schrodinger.application.scaffold_enumeration.common.set_sgroups(mol, sgroups)¶
Serializes list of dictionaries
sgroups
as JSON and stores the outcome as a molecular-level property (CML_SGROUPS_PROP).- Parameters
mol (rdkit.Chem.Mol) – Molecule.
sgroups (list(dict(str, str))) – List of dictionaries that meant to represent “S-groups”.
- schrodinger.application.scaffold_enumeration.common.product_of_ranges(extents)¶
Returns iterator over Cartesian product of ranges.
- Parameters
extents (iterable over positive int) – Iterable over the range extents. For example, if extents is (3, 8), iterator domain is going to be [0, 3) x [0, 8).
- Returns
Iterator over tuples of integers.
- class schrodinger.application.scaffold_enumeration.common.EnumerableMixin¶
Bases:
object
Methods common to several “enumerables”.
- getIter()¶
Returns iterator over realizations.
- Returns
Iterator over
getRealization()
returns.- Return type
iterator
- getRandomRealization(prng)¶
Returns random realization.
- Parameters
prng (
numpy.random.RandomState
) – mt19937 pseudorandom number generator from numpy.