mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Sanitize molecules when SMILES needs to be produced (#3818)
This commit is contained in:
committed by
GitHub
parent
703fe5a225
commit
8ebf50f2d2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user