Package schrodinger :: Package structutils :: Module rgroup_enumerate
[hide private]
[frames] | no frames]

Module rgroup_enumerate

Module for R-group enumeration.

Classes [hide private]
  RGroup
RGroup(atom_index, source_index)
  RgroupError
Exception class for errors specific to this module, which the caller may want to present to the user as a simple error message, as opposed to a traceback.
  RgroupEnumerator
Enumerate a structure using R-group sources.
Functions [hide private]
int

@raises ValueError if the atom doesn't have exactly one bond.

_find_neighbor(atom)
Return the index of the atom bonded to a given atom.
int

@raises ValueError if the structure does not contain exactly one dummy atom.

_find_dummy(st)
Return the index of the dummy atom in a structure.
list
find_rgroup_from_smarts(st, smarts, pos)
Find the various ways in which a structure can be split into "R-group" and "functional group" using a SMARTS pattern.
list of int
_find_rgroup_from_atom(st, match_set, atom)
Return the list of atoms reachable from 'atom' following one (and only one) bond such that the path leads to at least one heavy atom not found in 'match_set'.
bool
_has_path_to_non_matching_atoms(st, match_set, atom, seen)
Return True if there is at least one path starting from 'atom' that leads to a heavy atom not in 'match_set', without visiting atoms already in the 'seen' set.
 
_find_reachable_atoms(st, atom, seen)
Find all atoms reachable from a starting atom without visiting atoms already in the 'seen' set.
Variables [hide private]
  __package__ = 'schrodinger.structutils'
Function Details [hide private]

_find_neighbor(atom)

 

Return the index of the atom bonded to a given atom.

Parameters:
Returns: int

@raises ValueError if the atom doesn't have exactly one bond.

neighboring atom index

_find_dummy(st)

 

Return the index of the dummy atom in a structure. Atoms with atomic number -2 (mmat convention) or 0 (RDKit convention) are considered dummies.

Parameters:
Returns: int

@raises ValueError if the structure does not contain exactly one dummy atom.

dummy atom index

find_rgroup_from_smarts(st, smarts, pos)

 

Find the various ways in which a structure can be split into "R-group" and "functional group" using a SMARTS pattern.

The SMARTS pattern describes the functional group, but may include context atoms that are really part of the R-group. The atom matching the SMARTS atom identified by position 'pos' in the "attachment atom" for the functional group.

The R-group comprises all structure atoms reachable from the attachment atom following one (and only one) bond from the attachment atom such that at least one heavy atom is not matched by the SMARTS pattern; all other atoms are considered part of the functional group.

For example, consider the structure c1ccccc1cC(=O)O and the SMARTS pattern C(=O)O. With pos=1, the carboxylate carbon is matched. Of the three bonds starting from that atom, only the one leading to the phenyl ring leads to non-matching atoms; therefore the structure is partitioned into the R-group c1ccccc1* and the functional group *C(=O)O. With pos=3, the result would be c1ccccc1C(=O)* and *O. (The asterisks are shown here only to highlight the bond that was broken.)

The return value is a list of tuples, where the first element is the attachment atom index and the second is a list of the indexes of the atoms comprising the R-group. In the first example above, if we pretend there are no hydrogens, the return value might be [(7, [1,2,3,4,5,6])].

Parameters:
  • st (schrodinger.structure.Structure) - structure to analyze
  • smarts (str) - SMARTS pattern describing the functional group
  • pos (index) - position of the attachment atom in the SMARTS pattern (1-based)
Returns: list
list of tuples (attachment atom, list of R-group atom indexes). If no matches satisfied all the requirements, the list may be empty.

_find_rgroup_from_atom(st, match_set, atom)

 

Return the list of atoms reachable from 'atom' following one (and only one) bond such that the path leads to at least one heavy atom not found in 'match_set'.

Parameters:
Returns: list of int
list of atom indexes satisfying the requirements

_has_path_to_non_matching_atoms(st, match_set, atom, seen)

 

Return True if there is at least one path starting from 'atom' that leads to a heavy atom not in 'match_set', without visiting atoms already in the 'seen' set.

Parameters:
Returns: bool
True if there is a path, False if not

_find_reachable_atoms(st, atom, seen)

 

Find all atoms reachable from a starting atom without visiting atoms already in the 'seen' set. Modifies 'seen' in-place.

Parameters: