Re: [Rdkit-devel] Writing Fingerprints
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2012-03-08 20:05:10
|
On Thu, Mar 8, 2012 at 6:04 PM, Nicholas Firth <Nic...@ic...> wrote: > Hi All, > I've run into a few more problems with Fingerprinting, I'm trying to create > a database of these fingerprints, I've tried a few different methods to > write the fingerprints > > SparseIntVect<boost::uint32_t> *finger; > mol=SmilesToMol(line); > finger = MorganFingerprints::getFingerprint(*mol, 2); > cout << finger.toString() << endl; > > Which returns > > Fingerprint.cpp:49: error: request for member ‘toString’ in ‘finger’, which > is of non-class type ‘RDKit::SparseIntVect<unsigned int>*’ > > Then as a fix i tried intreated over the entries in the vector however > firstly I can't use the getLength function because of the same error above, > and when I put in an arbitrary depth and managed to get some output, however > it seemed only to output a huge amount of zero's Uwe already pointed out the problem with pointer syntax versus structure syntax (you want finger->toString()), but I think you may want another change as well: getFingerprint() gives you a count-based fingerprint, but you might want getFingerprintAsBitVect() (http://www.rdkit.org/docs/cppapi/namespaceRDKit_1_1MorganFingerprints.html#a1bf757d66784abf5a4ebf2c869be8261), which returns a bit vector. -greg |