diff --git a/unidock_tools/unidock_tools/ligand_prepare/rotatable_bond.py b/unidock_tools/unidock_tools/ligand_prepare/rotatable_bond.py index 7f31627..8ee2eb6 100644 --- a/unidock_tools/unidock_tools/ligand_prepare/rotatable_bond.py +++ b/unidock_tools/unidock_tools/ligand_prepare/rotatable_bond.py @@ -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 @@ -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 diff --git a/unidock_tools/unidock_tools/ligand_prepare/topology_builder.py b/unidock_tools/unidock_tools/ligand_prepare/topology_builder.py index 0068b12..552a65f 100644 --- a/unidock_tools/unidock_tools/ligand_prepare/topology_builder.py +++ b/unidock_tools/unidock_tools/ligand_prepare/topology_builder.py @@ -55,8 +55,11 @@ def build_molecular_graph(self): if bond_info in rotatable_bond_info_list or bond_info_reversed in rotatable_bond_info_list: rotatable_bond_idx_list.append(bond.GetIdx()) - splitted_mol = FragmentOnBonds(mol, rotatable_bond_idx_list, addDummies=False) - splitted_mol_list = list(GetMolFrags(splitted_mol, asMols=True, sanitizeFrags=False)) + if len(rotatable_bond_idx_list) != 0: + splitted_mol = FragmentOnBonds(mol, rotatable_bond_idx_list, addDummies=False) + splitted_mol_list = list(GetMolFrags(splitted_mol, asMols=True, sanitizeFrags=False)) + else: + splitted_mol_list = [mol] num_fragments = len(splitted_mol_list)