Hi Alfredo, if that's really what you want to do, the following Python function should help:
from rdkit import Chem bilastine = Chem.AddHs(Chem.MolFromSmiles("O=C(O)C(c1ccc(cc1)CCN4CCC(c2nc3ccccc3n2CCOCC)CC4)(C)C")) bilastine [image: image.png] def removeHsBondedToSp3Carbon(mol): bonds = [] atoms = [] for b in mol.GetBonds(): ba = b.GetBeginAtom() ea = b.GetEndAtom() for a in (ba, ea): oa = b.GetOtherAtom(a) if (a.GetAtomicNum() == 1 and oa.GetAtomicNum() == 6 and oa.GetHybridization() == Chem.HybridizationType.SP3): bonds.append(b.GetIdx()) atoms.append(a.GetIdx()) break if bonds: mol = Chem.RWMol(mol) for bi in sorted(bonds, reverse=True): b = mol.GetBondWithIdx(bi) mol.RemoveBond(b.GetBeginAtomIdx(), b.GetEndAtomIdx()) for ai in sorted(atoms, reverse=True): mol.RemoveAtom(ai) return mol.GetMol() bilastine_no_h = removeHsBondedToSp3Carbon(bilastine) bilastine_no_h [image: image.png] Cheers, p. On Tue, Oct 19, 2021 at 8:08 PM Alfredo Quevedo <maquevedo....@gmail.com> wrote: > Dear all, > > I am trying to figure out if there is a way to remove all hydrogens bond > to sp3 carbons in my molecule? > > thanks in advance for the help, > > kind regards > > Alfredo > > > > _______________________________________________ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss