Skip to content

Commit 44bd932

Browse files
committed
Update fragment.py
1 parent 7236e38 commit 44bd932

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/deepdih/mollib/fragment.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,18 @@ def get_fragment_from_torsion(
361361
self.get_selected_atoms()
362362
print(f"Selected Atoms after adding non-C/H: {self.selected_atoms}")
363363

364+
# Find all the atoms linked to rings if the ring included in layer_1
365+
for nring, ring in enumerate(self.rings):
366+
if layer_1[0] in ring or layer_1[1] in ring:
367+
# loop all the atoms linked to ring
368+
for atom_idx in ring:
369+
atom = self.mol.GetAtomWithIdx(atom_idx)
370+
for neighbor in atom.GetNeighbors():
371+
neighbor_idx = neighbor.GetIdx()
372+
self.add_atom(neighbor_idx)
373+
self.get_selected_atoms()
374+
print(f"Selected Atoms after adding all atoms linked to layer 1 rings: {self.selected_atoms}")
375+
364376
# [start] >>> Functional Groups <<<
365377

366378
# Find P and S atoms in self.selected_atoms linked to O and then add all atoms linked to that S

0 commit comments

Comments
 (0)