Hi Guillaume, I confirmed the issue. RemoveHs does not work to invalid molecule. So I updated my code example and uploaded gist. Could you please check new version of my code? https://gist.github.com/iwatobipen/77269b8a10eafe0e0cba8de5c1cae6ec
Any comments or suggestions will be appreciated. Thanks, Taka 2019年11月20日(水) 14:46 Guillaume GODIN <guillaume.go...@firmenich.com>: > Dear community, > > > > I try to reproduce this code > > > > > https://iwatobipen.wordpress.com/2019/01/18/generate-possible-molecules-from-a-dataset-chemoinformatics-rdkit/ > > > > but got an error un panda / rdkit during generation: > > > > frame = frame[["ROMol", "Smiles", "Core", "R1", "R2", "R3"]] > > frame['Core']=frame['Core'].apply(Chem.RemoveHs) > > frame.head(2) > > > > > > > > RDKit ERROR: [05:02:02] > > RDKit ERROR: > > RDKit ERROR: **** > > RDKit ERROR: Pre-condition Violation > > RDKit ERROR: getExplicitValence() called without call to > calcExplicitValence() > > RDKit ERROR: Violation occurred on line 161 in file > /opt/conda/conda-bld/rdkit_1561471048963/work/Code/GraphMol/Atom.cpp > > RDKit ERROR: Failed Expression: d_explicitValence > -1 > > RDKit ERROR: **** > > RDKit ERROR: > > RDKit ERROR: [05:05:04] Explicit valence for atom # 6 N, 5, is greater > than permitted > > > > --------------------------------------------------------------------------- > > ValueError Traceback (most recent call > last) > > <ipython-input-74-d2864fc13f85> in <module> > > * 1* frame = frame[["ROMol", "Smiles", "Core", "R1", "R2", "R3"]] > > ----> 2 frame['Core']=frame['Core'].apply(Chem.RemoveHs) > > * 3* frame.head(2) > > > > ~/miniconda/envs/py37/lib/python3.7/site-packages/pandas/core/series.py > in apply(self, func, convert_dtype, args, **kwds) > > * 3589* else: > > * 3590* values = self.astype(object).values > > -> 3591 mapped = lib.map_infer(values, f, convert= > convert_dtype) > > * 3592* > > * 3593* if len(mapped) and isinstance(mapped[0], Series): > > > > pandas/_libs/lib.pyx in pandas._libs.lib.map_infer() > > > > ValueError: Sanitization error: Explicit valence for atom # 6 N, 5, is > greater than permitted > > > > > > > > Any idea why ? > > > > BR > > > > Guillaume > > > > > > *********************************************************************************** > DISCLAIMER > This email and any files transmitted with it, including replies and > forwarded copies (which may contain alterations) subsequently transmitted > from Firmenich, are confidential and solely for the use of the intended > recipient. The contents do not represent the opinion of Firmenich except to > the extent that it relates to their official business. > > *********************************************************************************** > _______________________________________________ > 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