[Rdkit-discuss] rdkit cartridge stereo search is inconsistent

2019-11-14 Thread Webster Homer
I have a database which contains these three molecules.
N[C@H](Cc1ccc(B(O)O)cc1)C(=O)O
N[C@@H](Cc1ccc(B(O)O)cc1)C(=O)O
NC(Cc1ccc(B(O)O)cc1)C(=O)O

It seems that the exact search does not respect the rdkit.do_chiral_sss
# select * from rdk.mols where m@= 
mol_from_smiles('NC(Cc1ccc(B(O)O)cc1)C(=O)O');
structure_id | m
--+
 29303328 | NC(Cc1ccc(B(O)O)cc1)C(=O)O
(1 row)
With do_chiral_sss set to false I would expect that all three would be found! 
Instead the @= will only find the those with matching stereochemistry.
The @> operator does return all three, but it also returns hits that contain 
more than what I want.
Moreover the semantics of the operators seem arbitrary.

I think it would be better if chiral searching was done with an option to the 
operator rather than a session variable, but at least chiral searching should 
be consistent!
This message and any attachment are confidential and may be privileged or 
otherwise protected from disclosure. If you are not the intended recipient, you 
must not copy this message or attachment or disclose the contents to any other 
person. If you have received this transmission in error, please notify the 
sender immediately and delete the message and any attachment from your system. 
Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept 
liability for any omissions or errors in this message which may arise as a 
result of E-Mail-transmission or for damages resulting from any unauthorized 
changes of the content of this message and any attachment thereto. Merck KGaA, 
Darmstadt, Germany and any of its subsidiaries do not guarantee that this 
message is free of viruses and does not accept liability for any damages caused 
by any virus transmitted therewith. Click http://www.merckgroup.com/disclaimer 
to access the German, French, Spanish and Portuguese versions of this 
disclaimer.
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] RD Kit Cartridge setting do_chiral_sss flag with Java JDBC

2019-11-14 Thread Webster Homer
I'm trying to understand how to set the rdkit.do_chiral_sss  in Java.

I would like to call RD Kit structure search from a Java application. However 
the way RD Kit depends upon setting some values in Postgresql via SET seems to 
be hard to do using JDBC.  I am using JBoss Wildfly to host the application. 
The normal way to set up the database connection is via JNDI.

It is not clear how to set the rdkit.do_chiral_sss  variable for the search via 
JDBC.

This does not work
Context initCtx = new InitialContext();
ds = (DataSource) initCtx.lookup("java:/jdbc/rdkit-sss");
if (ds instanceof BaseDataSource) {  // never true
   BaseDataSource bds = (BaseDataSource)ds;
   bds.setProperty("rdkit.do_chiral_sss", 
structureSearchRequest.isStereoSearch()? "true" : "false");
} else {
   logger.error("Cannot set RD Kit session variables");
}


This message and any attachment are confidential and may be privileged or 
otherwise protected from disclosure. If you are not the intended recipient, you 
must not copy this message or attachment or disclose the contents to any other 
person. If you have received this transmission in error, please notify the 
sender immediately and delete the message and any attachment from your system. 
Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept 
liability for any omissions or errors in this message which may arise as a 
result of E-Mail-transmission or for damages resulting from any unauthorized 
changes of the content of this message and any attachment thereto. Merck KGaA, 
Darmstadt, Germany and any of its subsidiaries do not guarantee that this 
message is free of viruses and does not accept liability for any damages caused 
by any virus transmitted therewith. Click http://www.merckgroup.com/disclaimer 
to access the German, French, Spanish and Portuguese versions of this 
disclaimer.
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] numpy array to bit vector

2019-11-14 Thread Thomas Evangelidis
Great, thank you! Btw, does RDKit offer any scalar vector similarity
functions apart from the bit vector similarities?

On Thu, 14 Nov 2019 at 16:48, Greg Landrum  wrote:

> Yep, that's about 7x faster than what I came up with.
> Thanks Maciek!
>
> -greg
>
>
> On Thu, Nov 14, 2019 at 4:35 PM Maciek Wójcikowski 
> wrote:
>
>> Hi Thomas,
>>
>> You could also use SetBitsFromList() method:
>>
>>> bv.SetBitsFromList(np.where(ar)[0].tolist())
>>>
>>
>> 
>> Pozdrawiam,  |  Best regards,
>> Maciek Wójcikowski
>> mac...@wojcikowski.pl
>>
>>
>> czw., 14 lis 2019 o 16:28 Greg Landrum 
>> napisał(a):
>>
>>> Hi Thomas,
>>>
>>> There may be more efficient ways to do this, but here's something that
>>> works (and isn't the slowest thing I came up with):
>>> def np_to_bv(fv):
>>> bv = DataStructs.ExplicitBitVect(len(fv))
>>> for i,v in enumerate(fv):
>>> if v:
>>> bv.SetBit(i)
>>>return bv
>>>
>>> -greg
>>>
>>>
>>>
>>> On Thu, Nov 14, 2019 at 3:47 PM Thomas Evangelidis 
>>> wrote:
>>>
 Greetings,

 I am opening this old thread again for someone to answer my initial
 question this time, which was "How do I convert numpy.ndarray objects to
 rdkit.DataStructs.ExplicitBitVect objects?". At the time I asked
 the question I circumvented the problem by calculating Tanimoto
 similarities with Scipy, but now I want to utilize all similarity functions
 offered by rdkit.DataStructs. I am struggling with that for quite some time
 although I feel that the answer is simple.

 So basically, I have these arrays and want to calculate their
 DataStructs.McConnaugheySimilarity similarity. How do I do it?

 fv1 = numpy.array([1,1,0,0,1,0,1])


 fv2 = numpy.array([0,1,1,0,1,0,0])

 Thanks in advance.
 Thomas


 --

 ==

 Dr. Thomas Evangelidis

 Research Scientist

 IOCB - Institute of Organic Chemistry and Biochemistry of the Czech
 Academy of Sciences
 , Prague, Czech
 Republic
   &
 CEITEC - Central European Institute of Technology
 , Brno, Czech Republic

 email: teva...@gmail.com, Twitter: tevangelidis
 , LinkedIn: Thomas Evangelidis
 

 website: https://sites.google.com/site/thomasevangelidishomepage/



 ___
 Rdkit-discuss mailing list
 Rdkit-discuss@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

>>> ___
>>> Rdkit-discuss mailing list
>>> Rdkit-discuss@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>
>>

-- 

==

Dr. Thomas Evangelidis

Research Scientist

IOCB - Institute of Organic Chemistry and Biochemistry of the Czech Academy
of Sciences , Prague,
Czech Republic
  &
CEITEC - Central European Institute of Technology
, Brno,
Czech Republic

email: teva...@gmail.com, Twitter: tevangelidis
, LinkedIn: Thomas Evangelidis


website: https://sites.google.com/site/thomasevangelidishomepage/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] numpy array to bit vector

2019-11-14 Thread Greg Landrum
Yep, that's about 7x faster than what I came up with.
Thanks Maciek!

-greg


On Thu, Nov 14, 2019 at 4:35 PM Maciek Wójcikowski 
wrote:

> Hi Thomas,
>
> You could also use SetBitsFromList() method:
>
>> bv.SetBitsFromList(np.where(ar)[0].tolist())
>>
>
> 
> Pozdrawiam,  |  Best regards,
> Maciek Wójcikowski
> mac...@wojcikowski.pl
>
>
> czw., 14 lis 2019 o 16:28 Greg Landrum 
> napisał(a):
>
>> Hi Thomas,
>>
>> There may be more efficient ways to do this, but here's something that
>> works (and isn't the slowest thing I came up with):
>> def np_to_bv(fv):
>> bv = DataStructs.ExplicitBitVect(len(fv))
>> for i,v in enumerate(fv):
>> if v:
>> bv.SetBit(i)
>>return bv
>>
>> -greg
>>
>>
>>
>> On Thu, Nov 14, 2019 at 3:47 PM Thomas Evangelidis 
>> wrote:
>>
>>> Greetings,
>>>
>>> I am opening this old thread again for someone to answer my initial
>>> question this time, which was "How do I convert numpy.ndarray objects to
>>> rdkit.DataStructs.ExplicitBitVect objects?". At the time I asked
>>> the question I circumvented the problem by calculating Tanimoto
>>> similarities with Scipy, but now I want to utilize all similarity functions
>>> offered by rdkit.DataStructs. I am struggling with that for quite some time
>>> although I feel that the answer is simple.
>>>
>>> So basically, I have these arrays and want to calculate their
>>> DataStructs.McConnaugheySimilarity similarity. How do I do it?
>>>
>>> fv1 = numpy.array([1,1,0,0,1,0,1])
>>>
>>>
>>> fv2 = numpy.array([0,1,1,0,1,0,0])
>>>
>>> Thanks in advance.
>>> Thomas
>>>
>>>
>>> --
>>>
>>> ==
>>>
>>> Dr. Thomas Evangelidis
>>>
>>> Research Scientist
>>>
>>> IOCB - Institute of Organic Chemistry and Biochemistry of the Czech
>>> Academy of Sciences 
>>> , Prague, Czech Republic
>>>   &
>>> CEITEC - Central European Institute of Technology
>>> , Brno, Czech Republic
>>>
>>> email: teva...@gmail.com, Twitter: tevangelidis
>>> , LinkedIn: Thomas Evangelidis
>>> 
>>>
>>> website: https://sites.google.com/site/thomasevangelidishomepage/
>>>
>>>
>>>
>>> ___
>>> Rdkit-discuss mailing list
>>> Rdkit-discuss@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] numpy array to bit vector

2019-11-14 Thread Maciek Wójcikowski
Hi Thomas,

You could also use SetBitsFromList() method:

> bv.SetBitsFromList(np.where(ar)[0].tolist())
>


Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
mac...@wojcikowski.pl


czw., 14 lis 2019 o 16:28 Greg Landrum  napisał(a):

> Hi Thomas,
>
> There may be more efficient ways to do this, but here's something that
> works (and isn't the slowest thing I came up with):
> def np_to_bv(fv):
> bv = DataStructs.ExplicitBitVect(len(fv))
> for i,v in enumerate(fv):
> if v:
> bv.SetBit(i)
>return bv
>
> -greg
>
>
>
> On Thu, Nov 14, 2019 at 3:47 PM Thomas Evangelidis 
> wrote:
>
>> Greetings,
>>
>> I am opening this old thread again for someone to answer my initial
>> question this time, which was "How do I convert numpy.ndarray objects to
>> rdkit.DataStructs.ExplicitBitVect objects?". At the time I asked
>> the question I circumvented the problem by calculating Tanimoto
>> similarities with Scipy, but now I want to utilize all similarity functions
>> offered by rdkit.DataStructs. I am struggling with that for quite some time
>> although I feel that the answer is simple.
>>
>> So basically, I have these arrays and want to calculate their
>> DataStructs.McConnaugheySimilarity similarity. How do I do it?
>>
>> fv1 = numpy.array([1,1,0,0,1,0,1])
>>
>>
>> fv2 = numpy.array([0,1,1,0,1,0,0])
>>
>> Thanks in advance.
>> Thomas
>>
>>
>> --
>>
>> ==
>>
>> Dr. Thomas Evangelidis
>>
>> Research Scientist
>>
>> IOCB - Institute of Organic Chemistry and Biochemistry of the Czech
>> Academy of Sciences 
>> , Prague, Czech Republic
>>   &
>> CEITEC - Central European Institute of Technology
>> , Brno, Czech Republic
>>
>> email: teva...@gmail.com, Twitter: tevangelidis
>> , LinkedIn: Thomas Evangelidis
>> 
>>
>> website: https://sites.google.com/site/thomasevangelidishomepage/
>>
>>
>>
>> ___
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] numpy array to bit vector

2019-11-14 Thread Greg Landrum
Hi Thomas,

There may be more efficient ways to do this, but here's something that
works (and isn't the slowest thing I came up with):
def np_to_bv(fv):
bv = DataStructs.ExplicitBitVect(len(fv))
for i,v in enumerate(fv):
if v:
bv.SetBit(i)
   return bv

-greg



On Thu, Nov 14, 2019 at 3:47 PM Thomas Evangelidis 
wrote:

> Greetings,
>
> I am opening this old thread again for someone to answer my initial
> question this time, which was "How do I convert numpy.ndarray objects to
> rdkit.DataStructs.ExplicitBitVect objects?". At the time I asked
> the question I circumvented the problem by calculating Tanimoto
> similarities with Scipy, but now I want to utilize all similarity functions
> offered by rdkit.DataStructs. I am struggling with that for quite some time
> although I feel that the answer is simple.
>
> So basically, I have these arrays and want to calculate their
> DataStructs.McConnaugheySimilarity similarity. How do I do it?
>
> fv1 = numpy.array([1,1,0,0,1,0,1])
>
>
> fv2 = numpy.array([0,1,1,0,1,0,0])
>
> Thanks in advance.
> Thomas
>
>
> --
>
> ==
>
> Dr. Thomas Evangelidis
>
> Research Scientist
>
> IOCB - Institute of Organic Chemistry and Biochemistry of the Czech
> Academy of Sciences , 
> Prague,
> Czech Republic
>   &
> CEITEC - Central European Institute of Technology 
> , Brno, Czech Republic
>
> email: teva...@gmail.com, Twitter: tevangelidis
> , LinkedIn: Thomas Evangelidis
> 
>
> website: https://sites.google.com/site/thomasevangelidishomepage/
>
>
>
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] numpy array to bit vector

2019-11-14 Thread Thomas Evangelidis
Greetings,

I am opening this old thread again for someone to answer my initial
question this time, which was "How do I convert numpy.ndarray objects to
rdkit.DataStructs.ExplicitBitVect objects?". At the time I asked
the question I circumvented the problem by calculating Tanimoto
similarities with Scipy, but now I want to utilize all similarity functions
offered by rdkit.DataStructs. I am struggling with that for quite some time
although I feel that the answer is simple.

So basically, I have these arrays and want to calculate their
DataStructs.McConnaugheySimilarity similarity. How do I do it?

fv1 = numpy.array([1,1,0,0,1,0,1])


fv2 = numpy.array([0,1,1,0,1,0,0])

Thanks in advance.
Thomas


-- 

==

Dr. Thomas Evangelidis

Research Scientist

IOCB - Institute of Organic Chemistry and Biochemistry of the Czech Academy
of Sciences , Prague,
Czech Republic
  &
CEITEC - Central European Institute of Technology
, Brno,
Czech Republic

email: teva...@gmail.com, Twitter: tevangelidis
, LinkedIn: Thomas Evangelidis


website: https://sites.google.com/site/thomasevangelidishomepage/
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss