Skip to content

Commit

Permalink
Update generate_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Saoge123 authored Nov 29, 2023
1 parent 1020511 commit b70b997
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pocket_flow/utils/generate_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ def remove_triangle(pos_to_add, ligand_context_pos, ligand_context_bond_index, l
Chem.MolFromSmarts('[C]1~&@[C]~&@[C]~&@[C]~&@[C]~&@[C]~&@1')
]
PATTERNS_1 = [
[Chem.MolFromSmarts('[#6,7,8]-[#7]1~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@1'),
[Chem.MolFromSmarts('[#6,#7,#8]-[#7]1~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@1'),
Chem.MolFromSmarts('[C,N,O]-[N]1~&@[C,N]~&@[C,N]~&@[C,N]~&@[C,N]~&@[C,N]~&@1')],
[Chem.MolFromSmarts('[#6,7,8]-[#6]1(-[#6,7,8])~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@1'),
[Chem.MolFromSmarts('[#6,#7,#8]-[#6]1(-[#6,#7,#8])~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@1'),
Chem.MolFromSmarts('[C,N,O]-[C]1(-[C,N,O])~&@[C,N]~&@[C,N]~&@[C,N]~&@[C,N]~&@[C,N]~&@1')]
#Chem.MolFromSmarts('[C,N,O]-[N]1~&@[C]~&@[C]~&@[N]~&@[C]~&@[C]-1'),
#Chem.MolFromSmarts('[C,N,O]-[N]1~&@[C]~&@[C]~&@[C]~&@[C]~&@[C]-1'),
Expand All @@ -258,7 +258,7 @@ def modify(mol, max_double_in_6ring=0):
mol_copy = copy.deepcopy(mol)
mw = Chem.RWMol(mol)

p1 = Chem.MolFromSmarts('[#6,7]=[#6]1-[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]-1')
p1 = Chem.MolFromSmarts('[#6,#7]=[#6]1-[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]-1')
p1_ = Chem.MolFromSmarts('[C,N]=[C]1-[C,N]~&@[C,N]~&@[C,N]~&@[C,N]~&@[C,N]-1')
subs = set(list(mw.GetSubstructMatches(p1)) + list(mw.GetSubstructMatches(p1_)))
subs_set_1 = [set(s) for s in subs]
Expand Down Expand Up @@ -309,7 +309,7 @@ def modify(mol, max_double_in_6ring=0):
mw.AddBond(*b[0], Chem.rdchem.BondType.SINGLE)

Chem.GetSSSR(mw)
p3 = Chem.MolFromSmarts('[#8]=[#6]1-[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]-1')
p3 = Chem.MolFromSmarts('[#8]=[#6]1-[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]-1')
p3_ = Chem.MolFromSmarts('[O]=[C]1-[C,N]~&@[C,N]~&@[C,N]~&@[C,N]~&@[C,N]-1')
subs = set(list(mw.GetSubstructMatches(p3)) + list(mw.GetSubstructMatches(p3_)))
subs_set_2 = [set(s) for s in subs]
Expand All @@ -321,7 +321,7 @@ def modify(mol, max_double_in_6ring=0):
mw.RemoveBond(*b[0])
mw.AddBond(*b[0], Chem.rdchem.BondType.SINGLE)

p = Chem.MolFromSmarts('[#6,7]1~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@[#6,7]~&@1')
p = Chem.MolFromSmarts('[#6,#7]1~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@[#6,#7]~&@1')
p_ = Chem.MolFromSmarts('[C,N]1~&@[C,N]~&@[C,N]~&@[C,N]~&@[C,N]~&@[C,N]~&@1')
Chem.GetSSSR(mw)
subs = set(list(mw.GetSubstructMatches(p)) + list(mw.GetSubstructMatches(p_)))
Expand Down Expand Up @@ -414,4 +414,4 @@ def check_alert_structures(mol, alert_smarts_list):
if len(subs) != 0:
return True
else:
return False
return False

0 comments on commit b70b997

Please sign in to comment.