schrodinger.structutils.markush_enumerate module¶
Support for “R-group” enumeration as in ENUM-108.
-
class
schrodinger.structutils.markush_enumerate.PlaceHolder(group_id, atom, bonds)¶ Bases:
tuple-
__contains__(key, /)¶ Return key in self.
-
__len__()¶ Return len(self).
-
atom¶ Alias for field number 1
-
bonds¶ Alias for field number 2
-
count(value, /)¶ Return number of occurrences of value.
-
group_id¶ Alias for field number 0
-
index(value, start=0, stop=9223372036854775807, /)¶ Return first index of value.
Raises ValueError if the value is not present.
-
-
schrodinger.structutils.markush_enumerate.get_placeholders(st, groups=None)[source]¶ Gathers placeholders metadata.
- Parameters
st (
schrodinger.structure.Structure) – Structure.groups – Dictionary that maps placeholder atom indices onto their group IDs. If
None, regard atoms that carry the “GROUP_ID_PROP” property as “placeholders”.
- Returns
List of the placeholders records.
- Return type
list(PlaceHolder)
- Raises
ValueError if something about
stlooks not right.
-
schrodinger.structutils.markush_enumerate.get_attachment_points(st)[source]¶ Returns ordered list of attachment points in
st. The order is either based upon atom labels (“ATTACHMENT_PROP”, if available) or decided by the bond order and the peer atom atomic number.- Returns
List of atoms.
- Return type
list(int)
-
class
schrodinger.structutils.markush_enumerate.Scaffold(st, groups=None)[source]¶ Bases:
objectHolds reference to the “scaffold” structure. Knows how to join R-groups to the core.
-
__init__(st, groups=None)[source]¶ - Parameters
groups (dict(int, int) or None) – Dictionary that maps atom indices onto “group IDs”. If
None, use “GROUP_ID_PROP” to identify the “placeholder” atoms.
-
property
fragmentIDs¶ Returns set of fragment IDs.
-
populate(fragments)[source]¶ Replaces placeholders with fragments.
- Parameters
fragments (dict(int,
schrodinger.structure.Structure)) – Indexable that maps fragment IDs onto structures.
-
-
schrodinger.structutils.markush_enumerate.validate_fragment(st)[source]¶ - Parameters
st (
schrodinger.structure.Structure) – Structure.- Raises
ValueError if there is no attachment points.
-
schrodinger.structutils.markush_enumerate.validate_scaffold(st)[source]¶ - Parameters
st (
schrodinger.structure.Structure) – Structure.- Raises
ValueError if there is no placeholders.
-
schrodinger.structutils.markush_enumerate.convert_fragment_from_v3000(st)[source]¶ Converts fragment metadata from MDL V3000 conventions to the ones expected by this module.
- Parameters
st (
schrodinger.structure.Structure) – Structure.- Raises
ValueError if something goes wrong.
-
schrodinger.structutils.markush_enumerate.convert_scaffold_from_v3000(st)[source]¶ Converts scaffold metadata from MDL V3000 conventions to the ones expected by this module.
- Parameters
st (
schrodinger.structure.Structure) – Structure.
-
class
schrodinger.structutils.markush_enumerate.FragmentReader(filename, logger=None)[source]¶ Bases:
objectReads structures from file, skips “invalid” (in context of ENUM-108) fragments.
-
schrodinger.structutils.markush_enumerate.read_scaffold(filename)[source]¶ Reads scaffold from file.
- Parameters
filename (str) – File name.
- Returns
Scaffold instance.
- Return type
- Raises
ValueError on errors.
-
class
schrodinger.structutils.markush_enumerate.FragmentsIterator(sources, random=None)[source]¶ Bases:
objectIterator over Cartesian product of fragment collections.
-
class
schrodinger.structutils.markush_enumerate.VirtualLibrary(scaffold, sources, random=None, logger=None)[source]¶ Bases:
objectImplements common intended use case logic.
-
__init__(scaffold, sources, random=None, logger=None)[source]¶ - Parameters
scaffold (
Scaffold) – Scaffold.sources (list of list) – List of [iterable over fragments, id1, id2, …] lists (see
r_group_enumerate.parse_rgroups). Or list of [filename, id1, id2, …] lists.random (None or int) – If None, enumerate sequentially. If integer, enumerate randomly using
randomas a seed.
-