From 8ebf50f2d2950db794b4158e4df1d3d258f487ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcikowski?= Date: Wed, 17 Feb 2021 14:22:20 +0100 Subject: [PATCH] Sanitize molecules when SMILES needs to be produced (#3818) --- rdkit/Chem/PandasTools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rdkit/Chem/PandasTools.py b/rdkit/Chem/PandasTools.py index 2f16923dd..6d2d9bfc8 100644 --- a/rdkit/Chem/PandasTools.py +++ b/rdkit/Chem/PandasTools.py @@ -469,8 +469,9 @@ def LoadSDF(filename, idName='ID', molColName='ROMol', includeFingerprints=False close = None # don't close an open file that was passed in records = [] indices = [] + sanitize = bool(molColName is not None or smilesName is not None) for i, mol in enumerate( - Chem.ForwardSDMolSupplier(f, sanitize=(molColName is not None), removeHs=removeHs, + Chem.ForwardSDMolSupplier(f, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)): if mol is None: continue