Hi Navid, Last but not least, recent versions of Chem.RemoveHs accept additional parameters which include an option to remove zero degree Hs http://rdkit.org/docs/source/rdkit.Chem.rdmolops.html#rdkit.Chem.rdmolops.RemoveHsParameters.removeDegreeZero
params = Chem.RemoveHsParameters() > params.removeDegreeZero = True > mol_nohs = Chem.RemoveHs(mol, params) ---- Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl czw., 21 sty 2021 o 16:58 Paolo Tosco <paolo.tosco.m...@gmail.com> napisał(a): > Hi Navid, > > if I interpret correctly your question, either of these should do what you > need: > Chem.DeleteSubstructs(mol, Chem.MolFromSmarts("[#1X0]")) > Chem.DeleteSubstructs(mol, Chem.MolFromSmarts("[#1]"), onlyFrags=True) > > HTH, > p. > > On Wed, Jan 20, 2021 at 5:38 PM Navid Shervani-Tabar <nshe...@gmail.com> > wrote: > >> Dear all, >> >> I was wondering if there is a function to remove "hydrogen atoms without >> neighbors" from the mol object. Thanks! >> >> Regards, >> Navid >> _______________________________________________ >> 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 >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss