From 22025a8d1f785cbddf68c2cd22710d19d1d7105e Mon Sep 17 00:00:00 2001 From: Sean Colby Date: Wed, 20 Sep 2023 13:50:41 -0700 Subject: [PATCH] Add method to add implicit hydrogens --- isicle/geometry.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/isicle/geometry.py b/isicle/geometry.py index 3b575d0..ab96012 100644 --- a/isicle/geometry.py +++ b/isicle/geometry.py @@ -317,6 +317,27 @@ def _is_embedded(self): return True except: return False + + + def addHs(self): + """ + Add implicit hydrogens to molecule. + + Returns + ------- + :obj:`~isicle.geometry.Geometry` + Molecule representation. + + """ + + # Get copy of mol object + mol = self.to_mol() + + # Add Hs with coordinates + mol = Chem.AddHs(mol, addCoords=True) + + # Return new geometry instance + return self.__copy__(mol=mol) def initial_optimize(self, embed=False, forcefield="UFF", ff_iter=200): """