Commit Graph

321 Commits

Author SHA1 Message Date
Ricardo Rodriguez
9e301c15d6 Normalize rings (#9208)
* normalize rings

* update tests

* update doctests

* update release notes
2026-04-01 05:37:02 +02:00
Ricardo Rodriguez
f3dd424d28 make ringdecomposerlib a mandatory dependency (#9209) 2026-03-27 18:17:27 +01:00
Eisuke Kawashima
e89c9f656a style: apply readability-braces-around-statements (#8136)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-02-09 12:10:50 +01:00
Rachel Walker
664d3194b3 Move some fields and methods from AtomPDBResidueInfo to base class (#8863)
* fix pickling

* added python wrapping and test

* fix expected pickles

* trigger CI

* Apply suggestions from code review

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

* greg suggestion

* remove additional enum values

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2026-02-04 12:13:33 +01:00
dpdoughe
e9a3eafc9b Set explicit COST=100 for SQL functions as suggested in #8711 (#8784)
* Set explicit COST=100 for SQL functions

* Adjust COST to 100 in current databases and up the cartridge version

* Use CREATE OR REPLACE for consistency

* Update the version number in rdkit.control
2025-09-23 06:15:34 +02:00
paconius
9d0f15172f Make Cartridge @= operator coordinate agnostic (#8488)
* Modified CXSmiles comparison to ignore coords

* Added @= tests for coordinate change in mol

* Added test output for Issue #8465
2025-05-01 05:21:08 +02:00
Greg Landrum
1215922df1 Fixes #8460 (#8468)
* Fixes #8460

Also updates JSON stereogroup handling to support bonds

* fix cartridge tests
2025-04-28 07:38:50 +02:00
Greg Landrum
35c8c54a3a cartridge: expose sanitize options to mol_from_ctab (#8326)
* add sanitize and removeHs options to mol_from_ctab

* bump version to 4.7.0
add update script
fix a bug in the 4.4.0 - 4.5.0 update script

* document the new arguments

Should add argument names to all cartridge functions in a future PR

* fix a mistake

* response to review

* response to review

---------

Co-authored-by: Greg Landrum <glandrum@ethz.ch>
2025-03-11 06:14:44 +01:00
Greg Landrum
4358693afa bump the inchi version to 1.07.2 (#8176)
* bump the inchi version
move to using the github distributions

* update cartridge behavior

* further fix

* typos!
2025-01-17 13:33:26 -05:00
Greg Landrum
162fb9a7ec some cmake cleanups (#8171)
* Fixes #8139

* Fixes #8138
2025-01-15 16:19:48 +01:00
Hussein Faara
8411f4535e remove no-op macros and dead code (pt 2) (#8035)
* remove no-op macros and dead code (pt 2)

* test failures due to whitespace changes?

* actually run the testFeatures tests

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2025-01-11 14:10:00 +01:00
Michael Cho
b16b6026e8 Use .dylib on macOS for PostgreSQL 16+ (#7869)
See b55f62abb2
2024-11-01 06:18:02 +01:00
esiaero
7546167033 Fix 4.3.0--4.4.0 sql upgrade script (#7774)
Updates the script to drop the operator family so the subsequent creation attempt can pass.
2024-10-25 04:57:33 +02:00
tadhurst-cdd
0de215a1f8 Fix canonicalization of stereogroups (#7041)
* 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

* test changes

* 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

* Merge branch 'master' into pr/specialQueries

* changes from previous PR

* Iclude false chiral

* rigorous enhnced stereo canoncalization

* Added more tests and clenup

* removed commented out code

* corrected init of SmilesWriteParams

* added MolFileStereoChem.h to the header files

* Renamed Rxn parser to MrvBlockToChemicalReaction

* To make catch2 work, and match the checksum

* Fixed Structchecker errors

* fix CI for DetermineBonds catch test

* error in catch_test for CI

* Allow custom  smileWriteParams  in GetMolLayers

* misnamed entry point

* ReactionFromMrvString change name

* remove adding writeParams to GetMolLayers

* make rigorous enhanced stereo the default, and fix tests

* only one abs group no longer needs Rigorous Enhanced treatment

* changed string_view to string in catch test

* Canonicalize Enhnaced Stereo only resturne unique smiles

* Now allows or and and groups together

* internal routines inside detail scope

* fix test error

* changed string back to string_view and fixed a CHECK

* Fixes for PR review tests

* Fix RDKit_Book.rst failure on build test

* fix xqm sql test

* updated expected files for cxsmiles_test

* Fixed removal of atom attrs

* Fixed tests after merge of master

* More efficient version of Stereo Groups Canonicalization

* Fixes for ctests

* removed debug code

* readded cipLabel test

* fix generalizedSubstruct/catch_tests.cpp error

* hueristics to improve speed

* Rationaized control of abs groups

* removed unused routine

* added rigorous stereo group treatment to test

* some suggested changes

* Changes per PR review and removed some changes to smiles

* Fixed CI errors

* changes per PR review

* more PR review vhanges and cleanup

* Fixed PSql PKL change

* changes as per PR review

* Restored error type for bad mols for canonicalizeStereoGroups and added a test

* Merge master and fix test in MolDraw2D

* Fix for randomize test error and other PR review comments

* Removed unsued variable to fix mac CI

* do not force aromatization in canonicalizeStereoGroups

* changes as per PR review

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-10-11 17:09:18 +02:00
esiaero
bd79893dd3 Additional compatibility updates for commutator/negator settings for operator @= (#7834)
Allows upgrades from postgres versions < 16 with existing installs to 17.

Bumps cartridge version to 4.6.1.
2024-10-10 16:12:27 +02:00
Greg Landrum
da6cd73168 Run clang-format across everything (#7849)
* run clang-format-18 across Code/*.cpp and Code/*.h

* run clang-format-18 across External
2024-09-26 13:39:02 +02:00
Maciej Wójcikowski
aeb70c4dfc Drop mol_hash for legacy databases to enable upgrade to recent versions (#7804) 2024-09-17 06:09:53 +02:00
esiaero
0be09f8e70 Fix typo in 4.5.0--4.6.0 sql upgrade script (#7775)
The original script references RDKIT_PG_ALTER_OPERATOR_ATEQ_MOL twice instead of RDKIT_PG_ALTER_OPERATOR_ATEQ_REACTION.
2024-08-30 08:53:44 +02:00
Riccardo Vianello
62e3b985e9 fix RDKitEquals strategy of gmol_consistent and greaction_consistent (#7695) 2024-08-13 15:39:06 +02:00
Greg Landrum
b1663052b8 Remove Descriptors as a dependency of many other RDKit libraries (#7700)
* move mol weight and formula calculators to MolOps and refactor them a bit.
The descriptors are still there and should remain.

* remove other unnecessary dependencies on Descriptors

* Update adapter.cpp

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

---------

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2024-08-13 13:22:43 +02:00
Greg Landrum
1790de84d3 Fixes #7675 (#7680)
* Fixes #7675

* update expected psql results
these changed because of the version bump to the pickles
2024-08-02 09:24:34 +02:00
Greg Landrum
4f7a7d0523 Revert "Update rdkit_gist.c fixes #7493 (#7547)" (#7653)
This reverts commit 40d4c55a39.
2024-07-23 12:32:25 +02:00
Ernst-Georg Schmid
40d4c55a39 Update rdkit_gist.c fixes #7493 (#7547)
This fixes #7493, where way too much LEAF-nodes had to be re-checked for structure isomorphism.
2024-07-23 06:09:02 +02:00
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