Hi again,
When I run:
#------------
from rdkit import Chem
molfilename = "lactic2.sdf"
mol = Chem.SDMolSupplier(molfilename, removeHs = False)[0]
Chem.AssignStereochemistry(mol, cleanIt=False, force=False,
flagPossibleStereoCenters=True)
chiralAtoms = [a for a in mol.GetAtoms() if a.HasProp("_ChiralityPossible")]
chiralAtomNums = [a.GetIdx()+1 for a in chiralAtoms]
print "chiral centers: ",
print chiralAtomNums
configs = [a.GetProp("_CIPCode") for a in chiralAtoms]
print configs
smi = Chem.MolToSmiles(mol, isomericSmiles=True, allHsExplicit=True)
print smi
#------------
Two (related?) problems arise.
First, _CIPCode rises a KeyError, even for atoms for which
_ChiralityPossible is defined.
When I comment the lines that define and print the configs variable, the
second problem arises.
The string smi does not contain any '@' or '@@', something I expected
from a chiral molecule
for an isomeric smiles string.
The attached lactic2.sdf file comes from PubChem. I removed (set to 0)
the parity flag for atom 4 (index 3)
because there are no parity flags in the files I will have to deal with
later.
Keeping the parity flag does not change anything.
What did I miss?
All the best,
Jean-Marc
--
Jean-Marc Nuzillard
Institut de Chimie Moléculaire de Reims
CNRS UMR 7312
Moulin de la Housse
CPCBAI, Bâtiment 18
BP 1039
51687 REIMS Cedex 2
France
Tel : 03 26 91 82 10
Fax : 03 26 91 31 66
http://www.univ-reims.fr/ICMR
http://www.univ-reims.fr/LSD/
http://www.univ-reims.fr/LSD/JmnSoft/
Lactic acid. Atom 4 without parity.
-OEChem-12181617163D
12 11 0 1 0 0 0 0 0999 V2000
-1.3875 1.1182 0.1968 O 0 0 0 0 0 0 0 0 0 0 0 0
1.4877 -1.0368 0.2617 O 0 0 0 0 0 0 0 0 0 0 0 0
1.2263 1.1148 -0.4123 O 0 0 0 0 0 0 0 0 0 0 0 0
-0.7078 -0.1118 0.4002 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.3669 -1.1626 -0.4759 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7481 0.0781 0.0295 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7822 -0.3748 1.4601 H 0 0 0 0 0 0 0 0 0 0 0 0
-1.2848 -0.8968 -1.5360 H 0 0 0 0 0 0 0 0 0 0 0 0
-2.4357 -1.2376 -0.2485 H 0 0 0 0 0 0 0 0 0 0 0 0
-0.9100 -2.1472 -0.3365 H 0 0 0 0 0 0 0 0 0 0 0 0
-1.0263 1.7604 0.8318 H 0 0 0 0 0 0 0 0 0 0 0 0
2.4313 -0.9049 0.0279 H 0 0 0 0 0 0 0 0 0 0 0 0
1 4 1 0 0 0 0
1 11 1 0 0 0 0
2 6 1 0 0 0 0
2 12 1 0 0 0 0
3 6 2 0 0 0 0
4 5 1 0 0 0 0
4 6 1 0 0 0 0
4 7 1 0 0 0 0
5 8 1 0 0 0 0
5 9 1 0 0 0 0
5 10 1 0 0 0 0
M END
$$$$
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss