Skip to content

Commit 72dbd73

Browse files
committed
Fix errors interrupted sdf2smi.py script if a wrong molecule was occurred in input
1 parent 12b2d04 commit 72dbd73

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sdf2smi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def calc(input_fname, output_fname, field_name, extract_fields, sep):
1212
if extract_fields is not None:
1313
f.write('smi\tid\t' + '\t'.join(extract_fields) + '\n')
1414
for m in Chem.SDMolSupplier(input_fname):
15-
if m.GetConformer().Is3D():
16-
Chem.AssignStereochemistryFrom3D(m)
1715
if m:
16+
if m.GetConformer().Is3D():
17+
Chem.AssignStereochemistryFrom3D(m)
1818
smi = Chem.MolToSmiles(m, isomericSmiles=True)
1919
if field_name:
2020
n = m.GetProp(field_name)

0 commit comments

Comments
 (0)