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

2019-11-15 Thread Greg Landrum
I'm glad to hear you found something that works!

On Fri, Nov 15, 2019 at 10:23 PM Webster Homer <
webster.ho...@milliporesigma.com> wrote:

> I got this to work. The solution is to call the set_config function which
> can be done as:
>
> select set_config('rdkit.do_chiral_sss', 'true', false);
>
> This can be done using JDBC statements apis
>
>
>
> *From:* Webster Homer 
> *Sent:* Friday, November 15, 2019 12:18 PM
> *To:* Greg Landrum 
> *Cc:* rdkit-discuss@lists.sourceforge.net
> *Subject:* Re: [Rdkit-discuss] RD Kit Cartridge setting do_chiral_sss
> flag with Java JDBC
>
>
>
> I do not believe so. In psql the set statement actually sets a variable in
> the database session. It’s not SQL. The PostgreSQL Jdbc BaseDataSource
> class does have methods to set session properties. The problem I discovered
> is that the DataSource returned by the JNDI lookup does not extend
> BaseDataSource. JNDI is a Java technology that allows the database link
>  configuration to be separate from the code. It allows us to be able to
> change the database user, password, host, etc without modifying the
> application code. This is provided by the application server.
>
>
>
> I think my solution is simply to default the do_chiral_sss to true. My
> only concern with that is it could increase the overhead on the search.
>
> I think I can set the default on the JDBC URL. It will not be something
> that the application can modify though. If that is not acceptable I can
> provide an alternative to JNDI, but our administrators won’t like it.
> However if I use the PosgreSQL DataSource class for this I will need to use
> their connection pooling DataSource which is not recommended for production
> even by Postgresql
>
>
>
> Regards,
>
> Webster
>
>
>
> *From:* Greg Landrum 
> *Sent:* Friday, November 15, 2019 10:16 AM
> *To:* Webster Homer 
> *Cc:* rdkit-discuss@lists.sourceforge.net
> *Subject:* Re: [Rdkit-discuss] RD Kit Cartridge setting do_chiral_sss
> flag with Java JDBC
>
>
>
> Hi Webster,
>
>
>
> I am, unfortunately, not familiar enough with the way JDBC works to be
> able to help here.
>
> Isn't there some way you can execute the raw SQL command: "set
> rdkit.do_chiral_sss=true"?
>
>
>
>
>
> On Thu, Nov 14, 2019 at 9:41 PM Webster Homer <
> webster.ho...@milliporesigma.com> wrote:
>
> 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
>
> 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 acce

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

2019-11-15 Thread Webster Homer
I got this to work. The solution is to call the set_config function which can 
be done as:
select set_config('rdkit.do_chiral_sss', 'true', false);
This can be done using JDBC statements apis

From: Webster Homer 
Sent: Friday, November 15, 2019 12:18 PM
To: Greg Landrum 
Cc: rdkit-discuss@lists.sourceforge.net
Subject: Re: [Rdkit-discuss] RD Kit Cartridge setting do_chiral_sss flag with 
Java JDBC

I do not believe so. In psql the set statement actually sets a variable in the 
database session. It’s not SQL. The PostgreSQL Jdbc BaseDataSource class does 
have methods to set session properties. The problem I discovered is that the 
DataSource returned by the JNDI lookup does not extend BaseDataSource. JNDI is 
a Java technology that allows the database link  configuration to be separate 
from the code. It allows us to be able to change the database user, password, 
host, etc without modifying the application code. This is provided by the 
application server.

I think my solution is simply to default the do_chiral_sss to true. My only 
concern with that is it could increase the overhead on the search.
I think I can set the default on the JDBC URL. It will not be something that 
the application can modify though. If that is not acceptable I can provide an 
alternative to JNDI, but our administrators won’t like it. However if I use the 
PosgreSQL DataSource class for this I will need to use their connection pooling 
DataSource which is not recommended for production even by Postgresql

Regards,
Webster

From: Greg Landrum mailto:greg.land...@gmail.com>>
Sent: Friday, November 15, 2019 10:16 AM
To: Webster Homer 
mailto:webster.ho...@milliporesigma.com>>
Cc: 
rdkit-discuss@lists.sourceforge.net
Subject: Re: [Rdkit-discuss] RD Kit Cartridge setting do_chiral_sss flag with 
Java JDBC

Hi Webster,

I am, unfortunately, not familiar enough with the way JDBC works to be able to 
help here.
Isn't there some way you can execute the raw SQL command: "set 
rdkit.do_chiral_sss=true"?


On Thu, Nov 14, 2019 at 9:41 PM Webster Homer 
mailto:webster.ho...@milliporesigma.com>> 
wrote:
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
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 t

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

2019-11-15 Thread Webster Homer
I do not believe so. In psql the set statement actually sets a variable in the 
database session. It’s not SQL. The PostgreSQL Jdbc BaseDataSource class does 
have methods to set session properties. The problem I discovered is that the 
DataSource returned by the JNDI lookup does not extend BaseDataSource. JNDI is 
a Java technology that allows the database link  configuration to be separate 
from the code. It allows us to be able to change the database user, password, 
host, etc without modifying the application code. This is provided by the 
application server.

I think my solution is simply to default the do_chiral_sss to true. My only 
concern with that is it could increase the overhead on the search.
I think I can set the default on the JDBC URL. It will not be something that 
the application can modify though. If that is not acceptable I can provide an 
alternative to JNDI, but our administrators won’t like it. However if I use the 
PosgreSQL DataSource class for this I will need to use their connection pooling 
DataSource which is not recommended for production even by Postgresql

Regards,
Webster

From: Greg Landrum 
Sent: Friday, November 15, 2019 10:16 AM
To: Webster Homer 
Cc: rdkit-discuss@lists.sourceforge.net
Subject: Re: [Rdkit-discuss] RD Kit Cartridge setting do_chiral_sss flag with 
Java JDBC

Hi Webster,

I am, unfortunately, not familiar enough with the way JDBC works to be able to 
help here.
Isn't there some way you can execute the raw SQL command: "set 
rdkit.do_chiral_sss=true"?


On Thu, Nov 14, 2019 at 9:41 PM Webster Homer 
mailto:webster.ho...@milliporesigma.com>> 
wrote:
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
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] rdkit cartridge stereo search is inconsistent

2019-11-15 Thread Greg Landrum
On Thu, Nov 14, 2019 at 11:24 PM Webster Homer <
webster.ho...@milliporesigma.com> wrote:

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

Yep, I agree. This is a bug and we'll fix it (
https://github.com/rdkit/rdkit/issues/2790)
Unfortunately, there's not really a straightforward work around to this one
until that bug is fixed.

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


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

2019-11-15 Thread Greg Landrum
Hi Webster,

I am, unfortunately, not familiar enough with the way JDBC works to be able
to help here.
Isn't there some way you can execute the raw SQL command: "set
rdkit.do_chiral_sss=true"?


On Thu, Nov 14, 2019 at 9:41 PM Webster Homer <
webster.ho...@milliporesigma.com> wrote:

> 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
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] Second call for mmpdb funding

2019-11-15 Thread Andrew Dalke
Hi all,

  The end of the year is coming up. Perhaps there's extra money in your budget 
which can go to support open source development in cheminformatics? 

As many of you know, I started a crowdfunding effort to fund improvements to 
the matched molecular pair program "mmpdb". I want to see if crowdfunding could 
help pay for long-term project sustainability in our field.

At the institutional level, this effort is very much like a standard 
consortium. If you join the crowdfunding effort, you get new features which are 
not available to the general public, such as a command-line tool to export the 
rules and Postgres support. These are available right now.

As more people join the consortium, I will commit to adding new features. One 
which interests many people is to replace the existing opaque hash environment 
fingerprint with a fragment SMILES. That will be funded if two additional 
corporate members join.

Everyone who joins gets the new features under a permissive open source 
license. If enough people join, then I will commit to releasing the software to 
the public in the fall of next year.

If you want mmpdb to be supported and improved, then you should get your 
organization to join the funding effort.

Full details at http://mmpdb.dalkescientific.com/ .

Best regards,

Andrew
da...@dalkescientific.com




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