Commit Graph

298 Commits

Author SHA1 Message Date
Riccardo Vianello
427a54291b Update commutator/negator settings for operator @= (#7596)
* Redefine @='s commutator and negator (fix #7459)

* "Fix" update script for postgres < 17

* bump version to 4.6.0
2024-07-23 06:01:56 +02:00
Riccardo Vianello
38162c222b extend mol_to_smiles mol_to_cxsmiles to support optional non-isomeric output (#7395) 2024-04-29 09:24:43 +02:00
Christoph Berg
779a9e54b2 Code/PgSQL: Fix Pointer vs Datum (#6733)
PostgreSQL 16 got stricter wrt proper Pointer and Datum handling.
2024-04-28 06:17:55 +02:00
tadhurst-cdd
d5d4d194ec atropisomer handling added (#6903)
* atropisomer handling added

* fixed non-used variables,  linking directives

* BOOST LIB start/stop fixes, linking fix

* Fixes for RDKIT CI errors

* minimalLib fix

* changed vector<enum> for java builds

* check for extra chars in CIP labeling

* removed wrong deprecated message

* fix ostrstream output error?

* restored _ChiralAtomRank to lowercase first letter

* changes for merged master

* Fixed catch label for new Catch package

* update expected psql results

* get swig wrappers building

* restore MolFileStereochem to FileParsers

* fix java wrapper for reapplyMolBlockWedging

* some suggestions

* move a couple functions out of Bond

* Merge branch 'master' into pr/atropisomers2

* merged master

* Renamed setStereoanyFromSquiggleBond

* atropisomers in cdxml, rationalize atrop wedging, stereoGroups in drawMol

* fix for CI build

* attempt to fix java build in CI

* attempt to fix java build in CI #2

* New routine to remove non-explicit  3D-geneated chirality

* changed to use pair for atrop atoms and related bonds

* Changes as per PR reviews

* PR review respnses

* PR review reponse - more

* Fix merge from master

* fixing java ci after merge

* Updated the help doc for atripisomers

* update the atropisomer docs

* improve the images

* add the source CXSMILES

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-12-22 04:58:18 +01:00
Greg Landrum
7a50df222f [WIP] get deprecation CI working (#7004)
* Compile time and runtime deprecation warnings

* Used [[deprecated]] attribute to mark deprecation on cpp side
* Used RDLog to escalate deprecation warnings to python
* deprecated non fingerprint generator fingerprint generation functions

* Address build errors

* suppress deprecation warnings in cpps and tests
* experiment with new SWIG versions in the mac azure pipeline

* More deprecation suppression

* revert mac java experiment

* Fix SWIG syntax errors

* Attempt to fix windows unit test

* Remove test because of logging behavior

* Change linux java build to SWIG 4.1

- removes the need for preprocessor interaction

* Change mac java build to SWIG 4.1

* try updating the CI buid

* lock cmake version

needed to find JNI correctly

* update compiler versions

needed for the boost

* Fix typo and unavailable version

* Fix version conflict

* update mac build

* get linux build working?

---------

Co-authored-by: Patrick Penner <patrick@ppenner.com>
2023-12-21 15:01:05 +01:00
Greg Landrum
f797113a16 cmake cleanup (#6814)
* add RDKIT_CFFI_STATIC option
minimallib cmake cleanup

* clean up a lot of boost::iostreams nonsense

* find_package(boost cleanup

* update the swig wrappers

* updates to psql

* get the Qt demo working again

* fix? coordgen

* only use std::regex in moldraw2d test

this is consistent with the other tests

* cleanup the serialization stuff too
2023-11-10 15:32:54 +01:00
Greg Landrum
59fa87a207 make sure bond attachpt info is pickled (#6698)
* store more bond properties (if present) when pickling

* store the attachpts stuff more efficiently in pickles

* better error reporting in the cartridge

* updated cartridge use cases
2023-09-07 12:21:36 +02:00
Greg Landrum
4be7b2a169 we should not be doing adjustqueryprops by default in the cartridge (#6680) 2023-09-05 12:22:55 +02:00
Greg Landrum
b325b3a9bb Support TautomerQuery and MolBundle queries in the cartridge (#6393)
* framework for extended query.

serialization works
to/from text doesn't work

* first pass at getting substructure search working

basic tests

improved error handling (try not to take down the server thread!)

* add serialization to MolBundle

* we really need to pickle mol properties

* basic support for molbundle

including substructure search

* tautomer and molbundle queries to JSON

* remove debug msg

* cleanup debug
initial index steps (not tested)

* remove indexing stuff since it wasn't working

will try to come back to that

* add xqm to update script

* add c++ testing for molbundle serialization

* add serialization of molbundles to python interface

* support expanding molbundles to arrays of tautomer queries

* edge cases

Signed-off-by: greg landrum <greg.landrum@gmail.com>

* change in response to review

* a bunch of updates

* make sure the mol props needed for XQMs are being serialized

* update update script

* fix binary string output from ExtendedQueryMols in python

* tautomer queries should serialize properties

* more testing never hurts

* combo of generic groups and generalized queries works

* Update Code/PgSQL/rdkit/adapter.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/PgSQL/rdkit/adapter.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/PgSQL/rdkit/adapter.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Fix weird quotes?

---------

Signed-off-by: greg landrum <greg.landrum@gmail.com>
Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2023-08-23 06:32:06 +02:00
Paolo Tosco
87a76abc63 allow building the cartridge against PostgreSQL 16 (#6580) 2023-08-10 14:18:33 +02:00
Jonathan Bisson
8a2d034f8f Add a new parameter to mol_adjust_query_properties for generic query parameters (#6332)
* Add a new parameter to mol_adjust_query_properties for generic query parameters (#46)

Adds a new parameter to mol_adjust_query_properties:"setGenericQueryFromProperties"
that defaults to false (so no change of behavior until used).

This PR also removes the previous way of doing it that involved reprocessing the query molecule for every comparison.

On datasets of 200k molecules the speed-up is between 2 (large complex substructure searches with repeating units) to 5 times (tiny substructures search).

Add support for generic query in PG cartridge

* Add generic groups to the lib

* Move the querying with generic groups out of MolOps to not bloat the library.

* Fix Python calls

* Update doc

* Proof that last 3 commits are mine.

* Fix missing headers

* Fix typo

* Fix call

* Fix calls

* suggested changes

* Update Code/GraphMol/GenericGroups/GenericGroups.h

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>

* Add adjustquery test with default parameters.

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-08-03 15:41:43 +02:00
Greg Landrum
a57060225f Fixes #6479 (#6482)
* make sure we don't try to access an SG which no longer exists

* Fixes #6479
updates a bunch of tests to support this

* test ring stereo too

* update expected results from the tests
2023-07-13 19:29:06 +02:00
Riccardo Vianello
5039c88483 Add optional sortsupport methods to the PostgreSQL GiST indices (#6313)
* Add optional sortsupport methods to the bfp and mol/qmol indices

* update the postgres version to be removed

* Revert "update the postgres version to be removed"

This reverts commit 59c6eb12dd.

* install the specific version of postgresql-client

* try pinning postgresql-common too

* try something else

* try something else

* try configuring cmake with explicit paths to version 12

* try uninstalling libpq5

* check if it's possible to run the cartridge test build w/ pg14

* Revert "check if it's possible to run the cartridge test build w/ pg14"

This reverts commit f1c2f9f783.

* fix the updated cartridge version number

* do not by default enable the sort_support method for the bfp gist index
2023-05-18 06:38:08 +02:00
Riccardo Vianello
4f28dfeb69 postgres cartridge: cleanup a few obsolete build options (#6363)
* cleanup (assume PostgreSQL v9.6+)

* cleanup (assume PostgreSQL v9.6+)
2023-05-13 07:07:50 +02:00
Ric
58d135a874 Reformat C/C++ code ahead of 2023.03 release (#6295)
* format files

* format template files too
2023-04-28 04:42:35 +02:00
Greg Landrum
dee9f6cd82 fix the name of the update script (#6319) 2023-04-26 20:54:25 +02:00
Greg Landrum
8559f5d3a9 Add a new tautomer mol hash (#6289)
* backup

* does not work

* backup

* passes all tests

send more tests!

* backup

* seems to mostly work
needs cleanup still

* more tests + python wrappers

* more testing

* some cleanup

* fix problem with newer boost

* be more expansive about unsaturation

* be symmetric in choosing the starting bond
fix a test error

* passes all tests;
passes ChEMBL regression test

* docs

* update cookbook

* expose the new hash function to the cartridge too

* support v2 hash in the registration hash

* better testing

* alternate, simpler approach for that

* remove vestigial docs
2023-04-26 16:57:39 +02:00
Jonathan Bisson
af531a79ca Add support for generic matching in the PgSQL cartridge (#6269)
* Add support for generic matching in the PgSQL cartridge

Two new operators (and their inverse) `mol @>> q?mol` and `q?mol @<< mol` where q?mol getGenericGroups::setGenericQueriesFromProperties is applied to convert sgroups to query atoms and enable useGenericMatchers in the substructure matcher.

(q?mol means qmol or mol)

* Only transform the query once

* Revert "Only transform the query once"

This reverts commit 1873268cf6.
2023-04-09 06:45:02 +02:00
Paolo Tosco
7c9155fadf Updated README for cartridge installation into conda PostgreSQL (#6236)
* updated README for cartridge installation into conda PostgreSQL

* fixed typo

---------

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-03-29 04:11:53 +02:00
Paolo Tosco
b846f122d5 fix markdown typo (#6230)
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-03-23 17:12:54 +01:00
Paolo Tosco
17a64380e2 Updated README to build the PostgreSQL cartridge + bug fix (#6214)
* - renamed Code/PgSQL/rdkit/README to Code/PgSQL/rdkit/README.md such that markdown can be used
- updated Code/PgSQL/rdkit/README.md with updated instructions how to build and install the PostgreSQL on all supported OSs
- fixed an issue with the PgSQL install script on Windows where the path to the update_sql directory was incorrect

* changes in response to review
2023-03-23 05:05:58 +01:00
Greg Landrum
3fdcf6d9ff Fix #6002 (#6120)
* resolves it; needs more testing and cleanup

* still flailing a bit

* update expected test results

* cleanup

* revert extraneous changes

* revert these to master, will do this in a separate PR

* revert these to master, will do this in a separate PR

* back to master
2023-03-05 05:56:01 +01:00
Greg Landrum
a8c8e9a8e1 Add canonicalization of stereo groups (enhanced stereo) (#6051)
* add function to canonicalize enhanced stereo representations

* use enhanced stereo in canonicalization

* Fixes #6045
enables the doc tests for EnumerateStereoisomers.py
Re-enables the BRICS tests

* some things work... tests need to be updated

* c++ and python tests pass

* update expected psql results

* run the canonicalization on SMILES generation;
c++ and python tests pass

* cartridge and java tests pass

* update doctests
2023-02-08 04:21:51 +01:00
David Cosgrove
42782d31cf Change IUPAC metal->non-metal single bonds to dative (#6038)
* Change atom to metal bonds from single to dative if appropriate.

* Pedantic change whilst I was in the area.

* Reinstate all tests, leave in debugging writes to see failing tests.

* Re-did it.  Failing tests now pass.

* Move any positive charge from the non-metal to the metal.
Fix expected test results.

* Write dative bond to JSON.

* Bump currentRDKitJSONVersion to 11, but allow parser to still read 10.

* Only move 1 unit of charge at a time from non-metal to metal.

* Greg's hack to not do it for O+ and N+ etc.
Explicitly exclude H, He, F, Ne from dative bonds.
Fix tests.

* Update expected PostGres json version to 11.

* suggestions for PR

* Correct comment.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-02-06 04:37:32 +01:00
Greg Landrum
44a0ba074f Fixes #5734 (#5875)
I needed to do some historical cleanup here to make this work
We really should never do patch releases... it just makes this super difficult
2023-01-19 09:49:55 +01:00
Greg Landrum
e0b7fc298a Support SubstanceGroups and StereoGroups in JSON (#5909)
* write stereogroups

* Parse stereogroups

* add parameters to python wrappers

* more tests

* write substancegroups

* parse SubstanceGroups

* Fix a crashing bug with null molecules

* more testing

* add some docs

* update expected cffi results

* oh, this is delightful syntax

* adapt minimallib and the cartridge tests
some small cleanups

* stupid padding

* update expected

* changes in response to review
2023-01-04 16:29:36 +01:00
Paolo Tosco
38cfc168b6 - allow building PgSQL RPM and DEB packages by setting the correct DESTDIR path (#5836)
at build stage and creating intermediate directories as needed
2022-12-12 06:19:58 +01:00
Michael Banck
f416456768 Compile clang bytecode with -std=c++17 (#5685) (#5708) 2022-10-31 04:33:17 +01:00
Greg Landrum
bd666957d1 Fixes #5234 (#5415)
* Fixes #5234

* update expected output in tests
2022-07-26 02:39:21 -04:00
Greg Landrum
9fa1df1cf6 Drop usage of CIP information from the canonicalization code (#5385)
* stop using CIP codes in the atomic canonicalization

this will change results in some cases, so lots of tests need to be updated.

* stop breaking string literals... ARGH

* tests now pass

* update double bond canonicalization

* update a python test

* some cleanup

* update expected results for cartridge
2022-07-13 05:40:23 +02:00
Greg Landrum
0147cd8201 Fixes #5210 (#5408)
* revert duplicate chunk in release notes

* replace deprecated ifdefs
This one gets rid of USE_BUILTIN_POPCNT and RDK_THREADSAFE_SS
use RDK_OPTIMIZE_POPCNT or RDK_BUILD_THREADSAFE_SSS instead

* get rid of BUILD_COORDGEN_SUPPORT from ROMol.i

* fix a stupid typo

* update release notes
2022-07-11 11:20:03 +02:00
Greg Landrum
51b03fcdcb Fixes #5095 (#5096)
* Fixes #5095

* add some casts to make that a bit less disruptive

* go back to the simpler form for constructing the test table

* fix release notes

* do cleanup step too

* updates in response to review
2022-03-17 16:36:30 +01:00
Eisuke Kawashima
27f711a658 Run clang-tidy (readability-braces-around-statements) (#4977)
https://github.com/rdkit/rdkit/pull/3024#discussion_r526549843
2022-03-10 08:00:10 +01:00
Maciej Wójcikowski
93282a4bcf Drop gist_qmol_ops in upgrade scripts in case it exists (#5021) 2022-02-22 06:49:54 +01:00
Greg Landrum
7e575db3c4 AssignStereochemistry should remove nonchiral atoms from StereoGroups (#4986)
* Nonchiral atoms should be removed from StereoGroups

This fixes a bug where atoms which have no chirality were left in StereoGroups

In order to make this work, ROMol::setStereoGroups() needed to be made public.
That shouldn't be a problem since it doesn't change connectivity.

* fix some broken old tests

* update cartridge tests
2022-02-08 05:17:34 +01:00
Greg Landrum
e912c8d848 correctly tag unspecified branch-begin bonds in SMARTS (#4811)
These weren't being correctly assigned the SingleOrAromatic shorthand
2021-12-28 04:29:12 +01:00
Greg Landrum
8390dfd181 Fixes #4785: aromatic bonds no longer set aromatic flags on atoms (#4806)
* preliminary

* all tests pass

* cleanup

* more testing!

* we do still want to raise errors for aromatic atoms not in rings
fix one missed change for mol blocks

* update expected results for psql test
2021-12-17 10:26:59 +01:00
Greg Landrum
6225705060 Fixes #4787 (#4788)
* fixes #4787

* additional test

* version bump

* do the same thing with SMILES

* Update Code/PgSQL/rdkit/adapter.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2021-12-10 16:04:28 +01:00
Riccardo Vianello
6b5784c74a generate the sql update files in the binary (build) directory (#4777) 2021-12-08 14:18:15 +01:00
Paolo Tosco
e273967cb1 Improve CMake integration of PgSQL build (#4767)
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2021-12-08 14:16:08 +01:00
Riccardo Vianello
db673b1fee Refactor the memory management of the postgres cartridge cache module (#4755)
* refactor cleanupRDKitCache for readability

* fix the indentation

* add comments

* add some comments

* allocate/deallocate the cache holder in the associated memory context

* exit the cache holder memory context callback once done

* more consistent use of the memory context from ValueCache

* refactor the cleanupRDKitCache callback

* minor changes to comments and renaming variables
2021-12-03 06:41:53 +01:00
Paolo Tosco
9ed1fecc3a Fixes #4681 and a few Windows PgSQL build problems (#4692)
* fixes #4681

* fixes a few Windows build problems

* added comments to adapter.cpp to explain the changes

* get PostgreSQL to build on Windows with both MSVC and MinGW compilers

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2021-11-20 04:28:49 +01:00
Riccardo Vianello
ae9768d0bc fix TopologicalTorsion fingerpring in generateFingerprintAsBitVect (#4631) (#4669) 2021-11-08 06:26:57 +01:00
Greg Landrum
5215914bb9 Do the deprecations for the 2022.03 release (#4626)
* remove deprecated useCountSimulation argument

* remove the mol_from_smarts() function from the cartridge

* remove the balabanj

* a couple final cleanups to the countSimulation thing

* document changes
2021-11-04 04:25:05 +01:00
Riccardo Vianello
2aba8114a1 Fix some compile-time warnings in the postgres cartridge code (#4657)
* remove some unused variables

* add missing inclusion directive for cache.h

* fix a few warnings in the pgsql cartridge fmcs code
2021-11-01 04:35:10 +01:00
Riccardo Vianello
9376d33c44 fix parsing beyond the end of the input string in findMCSsmiles (#4636) 2021-10-26 05:57:11 +02:00
Greg Landrum
924333145a Rename the molLinkNode property to _molLinkNode (#4614)
* make the psql tests version insensitive

* rename the molLinkNode property
2021-10-18 16:04:27 +02:00
Greg Landrum
2c48a13a08 add mol_adjust_query_properties(qmol) (#4543)
add mol_to_svg(qmol)
2021-09-23 04:37:37 +02:00
Maciej Wójcikowski
6ab88f6f49 GiST support to qmol type (#4470)
* Add GiST support to qmol type

* add testing

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2021-09-15 21:15:08 +02:00
Greg Landrum
bf74af4052 Fix/github4442 (#4448)
* Fixes #4442

* add qmol_from_json()

* allow casting from mol->qmol

* avoid repeating ourselves

* add chiral substructure functions and operators
not available with indices yet

* remove the @@> operators
since I can't figure out how to support them in the index
2021-09-13 04:41:31 +02:00