Skip to content

Commit

Permalink
Update rotatable_bond.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Hong-Rui authored Sep 26, 2023
1 parent 8da5fa3 commit ab8ae7a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions unidock_tools/unidock_tools/ligand_prepare/rotatable_bond.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ def __init__(self,
max_breaks=4):

self.rotatable_bond_smarts = '[!$(*#*)&!D1]-&!@[!$(*#*)&!D1]'
self.amide_bond_smarts = '[C&$(C=O)]-[N&$(NC=O);v3;H1,H2;0]'
self.conjugate_bond_smarts = '*=*[*]=,#,:[*]'
self.rotatable_bond_pattern = Chem.MolFromSmarts(self.rotatable_bond_smarts)
self.amide_bond_pattern = Chem.MolFromSmarts(self.amide_bond_smarts)
self.conjugate_bond_pattern = Chem.MolFromSmarts(self.conjugate_bond_smarts)

self.min_macrocycle_size = min_macrocycle_size
Expand All @@ -19,4 +21,13 @@ def __init__(self,

def identify_rotatable_bonds(self, mol):
default_rotatable_bond_info_list = list(mol.GetSubstructMatches(self.rotatable_bond_pattern))
amide_rotatable_bond_info_list = list(mol.GetSubstructMatches(self.amide_bond_pattern))

for amide_rotatable_bond_info in amide_rotatable_bond_info_list:
amide_rotatable_bond_info_reversed = tuple(reversed(amide_rotatable_bond_info))
if amide_rotatable_bond_info in default_rotatable_bond_info_list:
default_rotatable_bond_info_list.remove(amide_rotatable_bond_info)
elif amide_rotatable_bond_info_reversed in default_rotatable_bond_info_list:
default_rotatable_bond_info_list.remove(amide_rotatable_bond_info_reversed)

return default_rotatable_bond_info_list

0 comments on commit ab8ae7a

Please sign in to comment.