Thanks for the suggestion Greg.  Unfortunately that did not work either.  So I 
bit the bullet and installed anaconda python 3 and then the example in your 
blog works without modification.

I had some trouble installing rdkit and rdkit-postgresql with conda:

conda install -c rdkit rdkit-postgresql
Fetching package metadata ...........
Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:
  - python 3.6*
  - rdkit-postgresql -> postgresql >=9.4,<9.5 -> python 2.7*
Use "conda info <package>" to see the dependencies for each package.

But I was able to install it this way:

conda install python=3.5.1
conda install --offline rdkit-2016.09.4-np111py35_1.tar.bz2
conda install --offline rdkit-postgresql95-2016.09.4-py35_1.tar.bz2
conda install --offline boost-1.56.0-py35_3.tar.bz2
condo install psycopg2

-Konrad

> On 5 Sep 2017, at 06:37, Greg Landrum <greg.land...@gmail.com> wrote:
> 
> 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 
> <mailto: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 
> <http://sdm.link/slashdot>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net 
> <mailto:Rdkit-discuss@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss 
> <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