Re: [Open Babel] Adding extra information to OBMol

2010-06-17 Thread Noel O'Boyle
On 17 June 2010 15:23, Rob Soe wrote: > Hi > Thanks for the suggestion. I may try using STL map. But here is a summary of > what I am trying to do. > > I am actually trying to optimize my code where I have N molecules and I am > trying to compare every nth molecule to all N molecules and calculate

Re: [Open Babel] Adding extra information to OBMol

2010-06-17 Thread Rob Soe
Hi Thanks for the suggestion. I may try using STL map. But here is a summary of what I am trying to do. I am actually trying to optimize my code where I have N molecules and I am trying to compare every nth molecule to all N molecules and calculate Tanimoto (Tc) similarity scores. So each time I

Re: [Open Babel] Adding extra information to OBMol

2010-06-17 Thread Noel O'Boyle
On 17 June 2010 14:47, Rob Soe wrote: > Hi > Thanks a lot for the suggestions. I can now set and retrieve such data. > > Currently, I am trying to save the fingerprint information to each molecule. > I am using GetFingerprint() (from OBFingerprint) and it generates a vector > of unsigned int (vect

Re: [Open Babel] Adding extra information to OBMol

2010-06-17 Thread Rob Soe
Hi Thanks a lot for the suggestions. I can now set and retrieve such data. Currently, I am trying to save the fingerprint information to each molecule. I am using GetFingerprint() (from OBFingerprint) and it generates a vector of unsigned int (vector). May I ask which OBGenericData class I should

Re: [Open Babel] Adding extra information to OBMol

2010-06-08 Thread Tim Vandermeersch
On Tue, Jun 8, 2010 at 12:06 AM, Rob Soe wrote: > Hi, > Thanks a lot for the suggestions. > > I have this plan that I am trying to work out. I am planning to use > OBSetData() and use SetAttribute() to set a string (converted from a float > number that I want to associate the molecule with). > > H

Re: [Open Babel] Adding extra information to OBMol

2010-06-07 Thread Rob Soe
Hi, Thanks a lot for the suggestions. I have this plan that I am trying to work out. I am planning to use OBSetData() and use SetAttribute() to set a string (converted from a float number that I want to associate the molecule with). Here is the code: //Float to String conversion ostringstream

Re: [Open Babel] Adding extra information to OBMol

2010-06-07 Thread Chris Morley
On 07/06/2010 19:12, Rob Soe wrote: > > I'd like to add information to this molecule, let's say, an arbitrary > floating number as its random ID. > > I saw OBMol class has SetData > > (OBGenericData >

Re: [Open Babel] Adding extra information to OBMol

2010-06-07 Thread Geoffrey Hutchison
> You need create an OBPairData (a subclass of OBGenericData), and apply > it to the molecule using OBMol.SetData. I usually grep the OpenBabel > source for examples of things. There are also working examples in the API documentation, e.g. (see the Detailed Description): http://openbabel.org/api

Re: [Open Babel] Adding extra information to OBMol

2010-06-07 Thread Noel O'Boyle
You need create an OBPairData (a subclass of OBGenericData), and apply it to the molecule using OBMol.SetData. I usually grep the OpenBabel source for examples of things. - Noel On 7 June 2010 19:12, Rob Soe wrote: > Hi all, > > I have one molecule read from SDF and I can successfully store it a

[Open Babel] Adding extra information to OBMol

2010-06-07 Thread Rob Soe
Hi all, I have one molecule read from SDF and I can successfully store it and extract its information using standard OpenBabel function such as GetTitle(), etc. I'd like to add information to this molecule, let's say, an arbitrary floating number as its random ID. I saw OBMol class has SetData