Thanks Greg,

Looking like everything is OK - I just converted this string back to vector:
ExplicitBitVect vRtn(strSSS)
and got exactly the same vector.

Only one thing still confusing:
This string ("àÿÿÿ") id the same for all of this:
RDKit::RDKFingerprintMol(*mol)
RDKit::RDKFingerprintMol(*mol, 1, 7, 2048,4, true, 0.3)
RDKit::LayeredFingerprintMol(*mol)

but all of them convering back to a DIFFERENT vectors!!!
And are you sure I should write to database this "àÿÿÿ"?

Regards,
Evgueni



2009/4/7 Greg Landrum <[email protected]>

> Dear Evgueni,
>
> On Tue, Apr 7, 2009 at 10:37 AM, Evgueni Kolossov <[email protected]>
> wrote:
> >
> > looking like ToString() method producing some strange result or I am
> doing
> > something wrong.
> > This is the code:
> > strSM   is equal to "CNC(=NC#N)NCCSCc1nc[nH]c1C"
> > RWMol *mol = SmilesToMol(strSM) //not null, contained atoms, bonds, so
> > looking like OK
> > ExplicitBitVect *fpSSS = RDKit::RDKFingerprintMol(*mol); //looking like
> OK -
> > see details in enclosed file
> > std::string strSSS = fpSSS->ToString(); //result is very strange: "àÿÿÿ"
> >
> > Can you help, please?
>
> It's hard to be sure. The output from fpSSS->ToString() is a binary
> string that is really only useful as an input to one of the
> constructors of ExplicitBitVect (or SparseBitVect). It's not intended
> to be printed, so it's not particularly readable.
>
> If you want a string of zeroes and ones (probably less efficient for
> your database, but more human readable), you can get one using
> BitVectToText():
>
> http://www.rdkit.org/C++_Docs/BitOps_8h.html#36835d36d5bd537c22d48f61c15bb9d7
> And convert that back into a BitVector using FromBitString():
>
> http://www.rdkit.org/C++_Docs/BitVectUtils_8h.html#2a9c53ad7c640781d6547cc6b47e75f9
> (These should really be declared in the same header file; that's
> something for the next release)
>
> here's some untested sample code:
>    std::string bits = BitVectToText(fp1);
>    ExplicitBitVect fp2(bits.length());
>    FromBitString(fp2,bits);
>
> Best Regards,
> -greg
>



-- 
Dr. Evgueni Kolossov (PhD)
[email protected]
Tel.   +44(0)1628 627168
Mob. +44(0)7812070446

Reply via email to