[Rdkit-discuss] recent packages for Ubuntu

2017-09-05 Thread Francois BERENGER

Hello,

If the update of the binary packages for Ubuntu/Debian
is documented somewhere, it would help people who
want to make available binary packages of rdkit as soon as there
is a new rdkit release.

I think we should have a ppa for people who want to use
the bleeding edge version of rdkit.

Regards,
F.

--
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


Re: [Rdkit-discuss] Custom fingerprint in PostgreSQL: null character error; convert numpy array into bit vector

2017-09-05 Thread Konrad Koehler
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 " 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  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  > 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


Re: [Rdkit-discuss] remove H using ReactionFromSmarts (i.e. creating radicals)

2017-09-05 Thread Greg Landrum
Hi Jan,

This is a small bug in the code that applies the query properties to the
new molecule.
In your case you can see that things are technically ok by doing:
   newmol[0][0].GetAtomWithIdx(0).SetNoImplicit(True)
before calling Chem.MolToSmiles()

Here's the bug report: https://github.com/rdkit/rdkit/issues/1544

It should be an easy fix.

-greg



On Mon, Aug 28, 2017 at 2:47 PM, Jan Halborg Jensen 
wrote:

> Is it possible to remove hydrogens using ReactionFromSmarts, for example
> changing Cc1c1 to [CH2]c1c1?
>
> I can do it using ReplaceSubstructs but I am trying to write more general
> code that also does other transformations that are better done
> with ReactionFromSmarts.  I can also create [CH2+]c1c1? and then
> remove the + from the SMILES string but that is a hack
>
> Here's sample code that, unfortunately, produces Cc1c1
>
> from rdkit import Chem
> from rdkit.Chem import AllChem
>
> m = Chem.MolFromSmiles("Cc1c1")
> rxn_smarts = '[CX4;H3:1]>>[CX4;H2:1]'
>
> rxn = AllChem.ReactionFromSmarts(rxn_smarts)
> newmol = rxn.RunReactants((m,))
> print Chem.MolToSmiles(newmol[0][0],canonical=False)
>
>
>
> 
> --
> 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