Dear Nick,

On Mon, Mar 12, 2012 at 4:32 PM, Nicholas Firth
<nicholas.fi...@icr.ac.uk> wrote:
> I've now got an issue with reading in fingerprints (now that you've helped
> me write them), I've tried a number of different ways. Currently I've got
> the fingerprints as a string made up of bits, i.e. "000001000000000000…",
> although I also had a crack with pickle strings. I think it's a similar
> issue as I had before, getting to grips with the ptr vs structure but the
> code I got to compile is,
>
> ExplicitBitVect *fp;
> getline(fileNam, bit);
> fp= new ExplicitBitVect(bit);
>

If you want to create an ExplicitBitVect from a bit string, the
appropriate invocation is;

  ExplicitBitVect *res=new ExplicitBitVect(bits.length());
  FromBitString(*res,bits);

Note that if you are just interested in storing the bit vectors on
disk in an efficient way and are ok if that's not human readable, then
it would be better to either:
 - write the pickled form into your output files using
BitVectToBinaryText() and then using ExplicitBitVect(text) when you
read them in
or
 - write the FPS form using BitVectToFPSText() and then create new bit
vects like this when you read those in:
  ExplicitBitVect *res=new ExplicitBitVect(fps.length()*4);
  UpdateBitVectFromFPSText(*res,fps);

Both the binary format and the FPS format are smaller on disk.

-greg

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Rdkit-devel mailing list
Rdkit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-devel

Reply via email to