Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fragment_types.py to add SanitizeMol calls #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mmpdblib/fragment_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ def __init__(
self.max_up_enumerations = max_up_enumerations

def normalize(self, mol):
from rdkit import Chem
Chem.SanitizeMol(mol)
# XXX Remove existing isotope labels?
if self.salt_remover is not None:
desalted_mol = self.salt_remover.StripMol(mol)
Expand All @@ -269,6 +271,8 @@ def normalize(self, mol):
return None, desalted_mol

def apply_filters(self, mol):
from rdkit import Chem
Chem.SanitizeMol(mol)
num_heavies = 0
for atom in mol.GetAtoms():
atomic_num = atom.GetAtomicNum()
Expand Down