I know from the subsequent post that you've moved on from this, but it's
probably worth responding here anyway:

On Fri, Sep 1, 2017 at 9:36 AM, Konrad Koehler <konrad.koeh...@icloud.com>
wrote:
>
>
> *First problem*: Null characters.  When I run the example script (using
> the Sheridan bit vector fingerprints), I generate the following error
> message:
>
> *curs.executemany('insert into fps values
> (%s,bfp_from_binary_text(%s))',[(x,DataStructs.BitVectToBinaryText(y)) for
> x,y in fps])*
> *ValueError: A string literal cannot contain NUL (0x00) characters.*
>
> I am not sure what I should do here.  I could strip the null characters
> from the binary text, but are the null characters supposed to be there?
> Should I use the bytea data type on PostgreSQL side?
>
>
I guess that this could also be a Python 2.7 thing. If you try:

*curs.executemany('insert into fps values
(%s,bfp_from_binary_text(%s))',[(x,bytes(DataStructs.BitVectToBinaryText(y)))
for x,y in fps])*

It might work.

-greg


> *Second problem*: convert numpy array into bit vector
>
> The linked example creates a fingerprint as a bit vector:
> fp = Sheridan.GetBTFingerprint(m,fpfn=rdMolDescriptors.
> GetHashedTopologicalTorsionFingerprintAsBitVect)
>
> whereas rdReducedGraphs.GetErGFingerprint method produces a numpy array:
> fp = rdReducedGraphs.GetErGFingerprint(m)
>
> Is there anyway of converting this numpy array into a bit vector?
>
>
> Any suggestions would be greatly appreciated.  Thanks,
>
> Konrad
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to