rdkit.Chem package

Subpackages

Submodules

Module contents

A module for molecules and stuff

see Chem/index.html in the doc tree for documentation

rdkit.Chem.CanonSmiles(smi, useChiral=1)
rdkit.Chem.FindMolChiralCenters(mol, force=True, includeUnassigned=False, includeCIP=True, useLegacyImplementation=None)
>>> from rdkit import Chem
>>> mol = Chem.MolFromSmiles('[C@H](Cl)(F)Br')
>>> Chem.FindMolChiralCenters(mol)
[(0, 'R')]
>>> mol = Chem.MolFromSmiles('[C@@H](Cl)(F)Br')
>>> Chem.FindMolChiralCenters(mol)
[(0, 'S')]
>>> Chem.FindMolChiralCenters(Chem.MolFromSmiles('CCC'))
[]

By default unassigned stereo centers are not reported:

>>> mol = Chem.MolFromSmiles('C[C@H](F)C(F)(Cl)Br')
>>> Chem.FindMolChiralCenters(mol,force=True)
[(1, 'S')]

but this can be changed:

>>> Chem.FindMolChiralCenters(mol,force=True,includeUnassigned=True)
[(1, 'S'), (3, '?')]

The handling of unassigned stereocenters for dependent stereochemistry is not correct using the legacy implementation:

>>> Chem.FindMolChiralCenters(Chem.MolFromSmiles('C1CC(C)C(C)C(C)C1'),includeUnassigned=True)
[(2, '?'), (6, '?')]
>>> Chem.FindMolChiralCenters(Chem.MolFromSmiles('C1C[C@H](C)C(C)[C@H](C)C1'),includeUnassigned=True)
[(2, 'S'), (4, '?'), (6, 'R')]

But works with the new implementation:

>>> Chem.FindMolChiralCenters(Chem.MolFromSmiles('C1CC(C)C(C)C(C)C1'),includeUnassigned=True, useLegacyImplementation=False)
[(2, '?'), (4, '?'), (6, '?')]

Note that the new implementation also gets the correct descriptors for para-stereochemistry:

>>> Chem.FindMolChiralCenters(Chem.MolFromSmiles('C1C[C@H](C)[C@H](C)[C@H](C)C1'),useLegacyImplementation=False)
[(2, 'S'), (4, 's'), (6, 'R')]

With the new implementation, if you don’t care about the CIP labels of stereocenters, you can save some time by disabling those:

>>> Chem.FindMolChiralCenters(Chem.MolFromSmiles('C1C[C@H](C)[C@H](C)[C@H](C)C1'), includeCIP=False, useLegacyImplementation=False)
[(2, 'Tet_CCW'), (4, 'Tet_CCW'), (6, 'Tet_CCW')]
rdkit.Chem.QuickSmartsMatch(smi, sma, unique=True, display=False)
rdkit.Chem.SupplierFromFilename(fileN, delim='', **kwargs)