Skip to content

Commit

Permalink
Merge pull request #367 from shihchengli/invalid_smiles_fix
Browse files Browse the repository at this point in the history
Ignore invalid atom-mapped SMILES
  • Loading branch information
oscarwumit committed Feb 8, 2023
2 parents 2677112 + 1d8e10f commit 959176d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chemprop/rdkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def make_mol(s: str, keep_h: bool, add_h: bool, keep_atom_map: bool):
if add_h:
mol = Chem.AddHs(mol)

if keep_atom_map:
if keep_atom_map and mol is not None:
atom_map_numbers = tuple(atom.GetAtomMapNum() for atom in mol.GetAtoms())
for idx, map_num in enumerate(atom_map_numbers):
if idx + 1 != map_num:
Expand Down

0 comments on commit 959176d

Please sign in to comment.