[Rdkit-discuss] Molecular Fragments Invariant Violation
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
From: Konrad K. <kon...@ic...> - 2016-01-21 07:49:33
|
Hi, First of all, thanks to the rdkit developers for making available this incredibly powerful package. I am trying to get an example script taken from the rdkit documentation to work, and it is generating an "Invariant Violation" error. The example script and the exact error message it generates is listed below. Any ideas on what is causing this error? Best regards, Konrad Environment: Rdkit version 2014.09.2, Python 2.7.9, running on Mac OS X, installed with “brew install --HEAD rdkit”. Example script taken from: "identify fragments that distinguish actives from inactive”, Getting Started with the RDKit in Python, Release 2015.09.1, page 54. ======== begin active_fragments.py ======= import os from rdkit import Chem from rdkit.ML.InfoTheory import InfoBitRanker from rdkit.Chem import FragmentCatalog from rdkit import RDConfig fName=os.path.join(RDConfig.RDDataDir,'FunctionalGroups.txt') fparams = FragmentCatalog.FragCatParams(1,6,fName) # fparams.GetNumFuncGroups() fcat = FragmentCatalog.FragCatalog(fparams) fpgen = FragmentCatalog.FragFPGenerator() suppl = Chem.SDMolSupplier('bzr.sdf') sdms = [x for x in suppl] acts = [float(x.GetProp('ACTIVITY')) for x in sdms] fps = [fpgen.GetFPForMol(x,fcat) for x in sdms] ranker = InfoBitRanker(len(fps[0]),2) for i,fp in enumerate(fps): act = int(acts[i]>7) ranker.AccumulateVotes(fp,act) top5 = ranker.GetTopN(5) for id,gain,n0,n1 in top5: print(int(id),'%.3f '%gain,int(n0),int(n1)) ======== end active_fragments.py ======= **** Invariant Violation catalog does not contain any entries of the order specified Violation occurred on line 424 in file /tmp/rdkit-UIZPcR/Code/Catalogs/Catalog.h Failed Expression: elem!=d_orderMap.end() **** Traceback (most recent call last): File "active_fragments.py", line 18, in <module> fps = [fpgen.GetFPForMol(x,fcat) for x in sdms] RuntimeError: Invariant Violation |