From 8da5fa330ff79d8c45ed2af38f0cbe5e972b6352 Mon Sep 17 00:00:00 2001 From: Hong-Rui Lin Date: Tue, 26 Sep 2023 11:34:50 +0800 Subject: [PATCH] Update topology_builder.py --- .../unidock_tools/ligand_prepare/topology_builder.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)