schrodinger.molutils.rgroups module

class schrodinger.molutils.rgroups.RGroup(smiles: str)

Bases: object

A class to represent an R-group, where attachment points are the atoms connected to a wildcard atom.

Each wildcard atom must be connected to only one other atom in the molecule by a single bond.

Example:

>>> RGroup('*C(O)C')
RGroup("*C(C)O")
__init__(smiles: str)
Parameters:

smiles – the SMILES for the R-group

Raises:

ValueError – if the SMILES is invalid, has no attachment atoms, or if any attachment atom is connected to more than one atom or not connected by a single bond

property smiles: str
Returns:

canonical SMILES of the R-group

property mol: Mol
Returns:

RDKit molecule for the R-group

attachmentCount() int
Returns:

the number of attachments in the R-group

toSmarts() str

Return a stereochemistry free SMARTS string with queries for atom type, implicit hydrogens, charges and connectivity.

Example:

>>> RGroup('*C(O)C').toSmarts()
'[#6&A&+0&X4;H1,H2]([C&H3&+0&X4])[O&H1&+0&X2]'
toTypedSmarts() str

Return a stereochemistry free SMARTS string with queries for atom types, i.e, element and aromaticity.

Example:

>>> RGroup('*C(O)C').toTypedSmarts()
'[#6&A]([#6&A])[#8&A]'
toSingleAttachmentRGroups() set[Self]

Return a set of RGroup objects that are equivalent to this RGroup but have just a single attachment point.

Example::
>>> rgroups = RGroup('*C(O)C*').toSingleAttachmentRGroups()
>>> rgroups == {RGroup("*C(C)O"), RGroup("*CCO")}
True
>>> RGroup('*C(*)N').toSingleAttachmentRGroups()
{RGroup("*CN")}
schrodinger.molutils.rgroups.smarts_from_smiles(smiles: str) str

Generates a stereochemistry free SMARTS string with queries for the atom type, implicit hydrogens, charges and connectivity.

Wildcard atoms may be used to designate parts of the molecule that are not to be part of the SMARTS. The wildcard atoms may only have a single bond to only one atom in the molecule.

Example:

>>> smarts_from_smiles('CO')
'[C&H3&+0&X4][O&H1&+0&X2]'
>>> smarts_from_smiles('*CO')
'[#6&A&+0&X4;H2,H3][O&H1&+0&X2]'
>>> smarts_from_smiles('*C.O*')
'[#6&A&+0&X4;H3,H4].[#8&A&+0&X2;H1,H2]'
>>> smarts_from_smiles('*[C@@H](Cl)Br')
'[#6&A&+0&X4;H1,H2]([Cl&+0&X1])[Br&+0&X1]'
Parameters:

smiles – the RDKit SMILES string with wildcards for the R-groups

Raises:

ValueError – if the input SMILES is not valid, or if a wildcard atom is not bonded to exactly one atom by a single bond

schrodinger.molutils.rgroups.typed_smarts_from_smiles(smiles: str) str

Return a stereochemistry free SMARTS string with queries for atom types, i.e, element and aromaticity.

Wild card atoms (R-groups) will be excluded from the result.

Example:

>>> typed_smarts_from_smiles('CO')
'[#6&A][#8&A]'
>>> typed_smarts_from_smiles('*C.O*')
'[#6&A].[#8&A]'
>>> typed_smarts_from_smiles('*[C@@H](Cl)Br')
'[#6&A]([#17&A])[#35&A]'
Parameters:

smiles – the RDKit SMILES string

Raises:

ValueError – if the input SMILES is not valid