Skip to content

Commit

Permalink
Update topology_builder.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Hong-Rui authored Sep 26, 2023
1 parent 84f3e88 commit 8da5fa3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 8da5fa3

Please sign in to comment.