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, leaving_atoms, staying_atom)
  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, leaving_atom_pos, staying_atom_pos)
Find the various ways in which a structure can be split into "R-group" and "functional group" using a SMARTS pattern.
 
find_staying_atom(st, leaving_atom)
Given a picked "leaving" atom, determine which of the atoms it is bonded to is part of the larger molecule - the "staying" atom.
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, leaving_atom_pos, staying_atom_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 must consist of at least two atoms. Two of the atoms, identified by their position in the SMARTS string, are used to define the bond to be broken between the R group and the "leaving group". If the two atoms are not directly connected, the bond leading to from the leaving atom to the staying atom is broken.

For example, consider the structure c1ccccc1cC(=O)O and the SMARTS pattern *C(=O)O. With leaving_atom_pos=2, staying_atom_pos=1, the entire carboxylate is removed, producing the R-group c1ccccc1*. With leaving_atom_pos=4, staying_atom_pos=2, only the terminal O is removed, leading to the R-group c1ccccc1C(=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])].

Notes: 1) ring bonds can't be broken because they don't split the structure in two. 2) non-single bonds can't be broken because the R-group enumerator currently only works across single bonds. Matches that would require breaking any of these bonds are silently skipped.

Parameters:
  • st (schrodinger.structure.Structure) - structure to analyze
  • smarts (str) - SMARTS pattern describing the functional group
  • leaving_atom_pos (index) - position of the leaving atom in the SMARTS pattern (1-based)
  • staying_atom_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_staying_atom(st, leaving_atom)

 

Given a picked "leaving" atom, determine which of the atoms it is bonded to is part of the larger molecule - the "staying" atom. All other atoms bound to the leaving atom are considered to be part of the leaving group.

Parameters:
Returns:
"staying atom": the core atom bound to the leaving atom