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.
|