232 Commits

Author SHA1 Message Date
Greg Landrum
4f1b88acbe deprecation (#7272) 2024-03-20 04:43:10 +01:00
Greg Landrum
a8d4912f88 beta release prep (#7271) 2024-03-19 09:05:33 +01:00
Greg Landrum
81af0dbd63 add option to symmetrize conjugated terminal groups when RMS pruning conformers (#7270)
* expose symmetrizeTerminalAtoms() to the public API

* support symmetrizing terminal groups in RMS pruning in confgen

* add that to the python wrapper

* add backwards compatibility note

* allow JSON config of the new option
2024-03-19 04:38:29 +01:00
Greg Landrum
0576f37e4e remove the broken Dbase.DbReport module (#7227) 2024-03-15 20:50:47 -04:00
Greg Landrum
3cff4d08af fix a problem with tautomeric systems being extended too far (#7200)
* fix a problem with tautomeric systems being extended too far

* add backwards incompatibility note
2024-03-15 16:42:22 +01:00
Greg Landrum
6981cb0a39 allow perception of stereo from T-shaped structures (#7183)
* allow perception of stereo from T-shaped structures

* document that in the release notes
2024-03-05 15:59:11 +01:00
Greg Landrum
3a27ca2910 V2 API for the MolSuppliers (#7168)
* backup

* backup

* backup

* new testing file

* reorder things in the SMILES and SMARTS parser
parameters to allow easier struct initialization

* add v2 of SmilesMolSupplier

v1 is not yet there

* add TDTMolSupplier

add some very basic tests for v1 suppliers

* more progress

* all tests passing

I think all the suppliers are now moved over

* check for maeparser before building the tests

* get SWIG builds working

* changes in response to review
2024-02-29 06:46:56 +01:00
Greg Landrum
d1b9331a36 Fixes #7122 (#7126) 2024-02-03 06:47:28 +01:00
Riccardo Vianello
b3cb9cab21 refactoring of MolStandardize validation module (#7085)
* refactoring of MolStandardize validation module

* redefine MolStandardize::ValidationErrorInfo as an alias for std::string

* changes in response to review

* describe the backward incompatible changes to MolStandardize in the release notes
2024-01-24 12:58:25 +01:00
MarioAndWario
9ca7a2e00d Sanitize number of radical electrons in case of invalid value assigned by CXSMILES (#6842)
* Sanitize number of radical electrons in case of invalid value assigned by CXSMILES (#6370)

* static_cast<int> for integer comparison

* Add unittests for 0 explicit hydrogens

* Fix unittests of radical count in fileParsersTest1

* Fix testMolWriter

* Fix testMrvToMol

* Address Greg's comments
2024-01-23 06:21:26 +01:00
Greg Landrum
b6361ae684 Change the defaults for the conformer generation to be ETKDGv3 (#6985)
* fix a float comparison in a test

* make ETKDGv3 (i.e. v2 of the torsion parameters) the default.
This should have been done a long time ago.

* change default for onlyHeavyAtomsForRMS too

* release notes update
2023-12-19 04:25:55 +01:00
Greg Landrum
dd2ffd3b03 Deprecate some of the ancient python-based ML code (#6891)
* working on deprecations

* update release notes
2023-11-14 14:32:11 +01:00
Greg Landrum
ab152a4ed1 Switch over to using pytest to run the python tests (#5916)
* misc adaptations/modernizations
plus a few changes to allow pytest discovery

* get the recap unittests running

* pytest config updates

* all tests pass

* integrate the pytest stuff into ctest

* integrate Projects dir
better cmake integration

* ci build env updates

* ignore more files

* remove six.py

* cleanup UnitTestPandasTools

* cleanup pytest

* remove obsolete use of rdkit.six from doctests

* update release notes

* mysterious CI fix

* add conftest to remove some tests

* remove the old python-based testing infrastructure

---------

Co-authored-by: Ric <ricrogz@gmail.com>
2023-11-03 14:39:24 +01:00
Greg Landrum
086d2deab4 remove the deprecated python MolStandardize implementation (#6819) 2023-10-22 05:24:07 +02:00
Greg Landrum
115317f43e prep for next release cycle (#6803) 2023-10-18 04:05:24 +02:00
Greg Landrum
568b9db0cb tag release (#6801) 2023-10-13 18:00:47 +02:00
Greg Landrum
a9d6642f7d update release notes and cmakelists for beta (#6788) 2023-10-06 13:07:26 +02:00
Greg Landrum
1d0050caee Use the connect-the-dots algorithm by default in DetermineBonds (#6740)
* add connect-the-dots option to xyz2Mol

* make connect-the-dots the default
2023-09-26 06:10:20 +02:00
Greg Landrum
22ac03329d switch from boost::any to std::any (#6662)
* switch from boost::any to std::any

* changes in response to review

* handle the slightly different error messages from different compilers

* document changed error message

* try to use g++10 for the linux builds

* remove those CXX defns

* another spelling

* stupid typo

* bump all linux builds to g++-10

* some day this will be done

* small steps

* increase mac ci builds runtime
2023-08-25 17:55:33 +02:00
Paolo Tosco
350370abe3 - Changed all unsigned to unsigned int for clarity (#6646)
- Switched from dynamic to static allocation for an instance of `MCSParameters`
- Switched to using `auto` where possible
- Added a few `CHECK_INVARIANT` where appropriate before dereferencing pointers
- Moved some inline comments to the previous line to improve readability
- Added a early check for `CompleteRingsOnly` in `checkBondRingMatch()` to improve computational efficiency
- Removed `RingMatchTableSet` entirely as 1) it is unnecessary since its functionality is already provided by `RingInfo` 2) it abused the `userData` pointer. This allows cleaning up and simplifying the code, particularly the Python wrappers which had a significant amount of added complexity to support it
- Removed all the code that was deprecated several releases ago
- Reimplemented ringFusionCheck() from scratch to address several bug reports; also switched from std::set to boost::dynamic_bitset for better efficiency
- Replaced boost::tie with boost::make_iterator_range
- Modernized `for` loops where possible
- Removed entirely the QueryRings structure as its functionality is already available in RingInfo
- Removed entirely the _DFS() function since the same algorithm can be implemented in a simpler and more efficient way using RingInfo (from 2m28.441s to 2m9.859s for the same task)
- Replaced std::vector<bool> with boost::dynamic_bitset
- Replaced C-style casts with C++ casts
- Replaced some size_t with unsigned int
- Refactored checkIfRingsAreClosed() such that checkNoLoneRingAtoms() is not needed anymore
- Added a test for slow runtimes with CompleteRingsOnly
- Setting Timeout to 0 means no timeout, as it should be
- Removed unused `steps` variable from `MaximumCommonSubgraph::growSeeds`
- Storing both Atom and Bond pointers and their indices on Seed and MCS data structures is time-consuming and a potential source of incons
istencies; storing pointers is sufficient
- Promoted `MaximumCommonSubgraph::match` from `private` to `public`
- `NewBonds` was declared `mutable`, but `Seed::fillNewBonds()` was incorrectly declared as `non-const`, which caused the need for an ugly
(and unnecessary) `const_cast`.
I have now removed the `const_cast` and correctly declared functions that alter `NewBonds` as `const`, since `NewBonds` is explicitly `mut
able`
- Removed some useless random scoping that was peppering the MCS code
- Removed a significant amount of duplicate code from the Python wrappers by inheriting from a base `PyMCSWrapper` class
- Fixed #6082
- Fixed #5510
- Fixed #5457
- Fixed #5440
- Fixed #5411
- Fixed #3965
- Fixed #6578

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2023-08-25 06:09:19 +02:00
Greg Landrum
155bee2f87 Deprecate the pure python MolStandardize implementations. (#6548)
* add a deprecation

* add a bunch of deprecation warnings
2023-07-20 18:41:55 +02:00
Greg Landrum
fcfbb7b083 Fix a couple CDXML issues (#6463)
* Scale bonds, make the Wedge detection cleaner, add more tests

* Readd comment

* Use document bond length

* Adds roundtrip test through a molblock

* a bit of cleanup

* change expected results for a bogus structure
add a non-ambiguous version of it

* fixes #6462

* document incompatibility

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2023-06-15 05:05:33 +02:00
Paolo Tosco
13a2c9ecb0 Deprecate JSMol::is_valid() and JSReaction::is_valid() and return nullptr instead (#6392)
* - deprecate JSMol::is_valid() and JSReaction::is_valid()
- methods returning JSMol and JSReaction objects now return nullptr upon failure rather than an invalid object

* changes in response to review

* unexposed JSReaction::is_valid given it was not exposed before this PR

---------

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-06-08 05:28:46 +02:00
Paolo Tosco
312fa9a703 Optionally expose MCS to JS and extend optional compilation to JSReaction and JSSubstructLibrary (#6409)
* reverted all changes that did not really belong to this PR

* I had forgotten ChemReactions_static

* changes in response to review

---------

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-06-07 12:35:55 +02:00
Greg Landrum
7c480e9376 prep for next release cycle (#6331)
* prep for next release cycle

* a bit cleaner
2023-05-04 05:08:26 +02:00
Greg Landrum
218b0b5f9c Infrastructure updates for 2023.03 release (#6324)
* prep for release

* add highlights

* typo
2023-04-28 16:01:32 +02:00
Greg Landrum
14623de550 release prep (#6293)
* release prep

* typo
2023-04-14 13:18:28 +02:00
Greg Landrum
bfea269b38 Fixes #6241 (#6257)
* handle the cases when the flag is set

* add python wrapper

* Fixes #6241

update and finish?

* set the chiral flag to 0 in the mol file parsers

* adjust to the chiral flag always being present

* add note
2023-04-13 15:38:29 +02:00
Greg Landrum
93428d5048 Do not include dative bonds in ring finding by default (#6231)
* change default behavior so that dative bonds are not included in ring finding

* make sure that generating 2D coords does not lose the rings

* cleanup some leftover problems
2023-03-30 18:09:24 +02:00
Greg Landrum
ad92d89d1e Fixes #5883 (#6189)
* Fixes #5883

* add backwards incompatibility comment

* clang-format hates this file
2023-03-14 04:54:15 +01:00
Greg Landrum
58b79c6f8e BondDir not cleared from bonds that aren't stereoactive (#6162)
* backup

* update .gitignore

* passes tests

* all tests now pass

* update release notes

* cleanup

* changes in response to review
2023-03-07 15:15:11 +01:00
Paolo Tosco
3326a620a2 Stereochemistry-related SWIG updates (#6127)
* - expose [sg]etUseLegacyStereo()
- In MolToSmiles() doIsomericSmiles should default to true as in C++ and Python
- added missing parameters to MolToSmiles() and MolToMolBlock()
- added SmilesWriteParams MolToSmiles() overload
- added and updated Java tests

* - changes in response to review
- exposed the same functionality also in MinimalLib and CFFI and added tests

---------

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-02-28 06:44:50 +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
Greg Landrum
d883803a4b stop caching ring-finding results (#5955)
* stop caching ring-rinding results

* add backwards incompatibility note

* changes in response to review
2023-01-11 09:32:54 -05:00
Greg Landrum
6372a7b201 Do deprecations for the 2023.03 release (#5675)
* remove SmilesParserParams::useLegacyStereo

* MinimalLib JS deprecations

* PandasTools deprecations

* update release notes
2022-11-01 13:29:58 +01:00
Greg Landrum
6227d7579e set things up for the next release (#5673) 2022-10-21 18:30:34 +02:00
Greg Landrum
dc16d0e160 Tag release and do final doc updates (#5669)
* tag release

* add registration hash to docs

* doc update for release
2022-10-21 07:52:30 +02:00
Greg Landrum
0fcc1f4841 Updates for the beta release. (#5627)
* updates for the beta

* updates for the beta

* update

* add last PR
2022-10-10 04:48:38 +02:00
Paolo Tosco
156a75c005 PandasTools and InteractiveRenderer improvements (#5628)
* - Avoid that Jupyter Notebooks become painfully slow when using PandasTools with hundreds of molecules by using pandas formatters rather than patching Chem.Mol.__str__
- Make sure that static PNG images in pandas DataDrames honor PandasTools.molSize
- Make sure that PandasTools works on the whole range of pandas versions
- Improved and more robust loading of rdkit-structure-renderer
- MolsToGridImage is now also interactive
- Interactive rendering now displays highlights and query molecules correctly

* changes in response to review

* fix special character HTML escaping

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-10-10 04:27:53 +02:00
Greg Landrum
867c2976f9 Fix bad interaction between the useLegacyStereo options in the SMILES parser (#5576)
* partial fix

* prepare testing code for the deprecation

* more detail in the release notes
2022-10-07 16:53:59 +02:00
Paolo Tosco
97bb4a7f37 Improvements to 2D depiction and alignment/RMSD calculation (#5598)
* update AvalonTools to version 2.0.1

* Improvements to 2D depiction and alignment/RMSD calculation
- Refactored the straightenDepiction code which is now much simpler and more readable and supports a minimizeRotation parameter
- added C++, Python and JS tests for the new minimizeRotation parameter
- refactored tests to use CalcRMS rather than an internal implementation to compute RMS deviations
- Removed duplicated code in CalcRMS() and getBestRMS() and made their APIs consistent with respect to supported parameters
  IMPORTANT NOTE: for backwards compatibility I set the CalcRMS() default for the  new symmetrizeConjugatedTerminalGroups
  to false as this parameter was not originally supported. @greg: I would be very much in favor of setting this to true instead
  if you agree, even though it might change results for existing scripts, as I think it is a much more sensible default.
- Improved documentation to clarify the difference between CalcRMS() and getBestRMS()
- Added unit tests for CalcRMS() as there was none previously
- Added tests for the additional CalcRMS() and getBestRMS() parameters
- Added a new getBestAlignmentTransform() function
- The CFFI function set_2d_coords_aligned() now returns the matching atoms similarly to the C++, Python and JS counterparts
  IMPORTANT NOTE: this required an API change for the additional char ** parameter used to return the match.
  Existing code using set_2d_coords_aligned() will fail to compile and will require a last NULL parameter to be added to compile again
- Removed duplicated code between CFFI set_2d_coords_aligned() and JS generate_aligned_coords()
- Added has_2d_coords() to the CFFI library
- generate_aligned_coords() now supports JSON parameters and the previous versions are deprecated
- set_2d_coords_aligned() and generate_aligned_coords() both support an alignOnly parameter (which defaults to false).
  If set to true, rather than re-generating a fresh 2D layout around templateMol, the existing coordinates (if any) are simply aligned
  to the provided templateMol. If the molecule has no coordinates, a set of 2D coordinates is generated independently of templateMol
  and then aligned to the provided templateMol
- avoid that when acceptFailure is false set_2d_coords_aligned() and generate_aligned_coords() overwrite existing coordinates

* - explicitly link testDepictor to MolAlign library

* - add MolAlign dependency to testDepictor (rather than to the catch test as in the previous commit)
- add a couple of tweaks

* suppress compiler warnings (1st pass)

* warnings: 2nd pass

* warnings: 3rd pass

* - alignOnly mode should also support allowRGroups

* - fixed C++ build
- added tests for allowRGroups+alignOnly combination

* changes in response to review

* added an entry to backward incompatible changes regarding set_2d_coords_aligned()

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-10-02 06:24:01 +02:00
Greg Landrum
eec737b432 Fixes #5395 (#5437)
* Fixes #5395

* fix a failing doctest
2022-07-20 16:05:11 +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
f7a98cf718 Support conjugated terminal groups in GetBestRMS() (#5322)
* add symmetrizeConjugatedTerminalGroups to GetBestRMS()

* make the tests clearer
2022-06-21 15:08:47 +02:00
greg landrum
227801897c add forgotten issue 2022-04-15 06:06:25 +02:00
Greg Landrum
4fafb72212 update release notes, do deprecations (#5161) 2022-04-08 04:51:07 +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
Greg Landrum
fd1752e006 disable Info and Debug logs by default (#5065)
* disable the info and debug logs by default

* adjust tests to the newly disabled logs

* add LogStateSetter

* namespace reorg

* add some tests

* remove vestigial code

* switch to using std::vector
2022-03-12 10:04:28 +01:00
Greg Landrum
4bbbc6611d Add a CXSMILES option to the MolHash (#5058)
* 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.

* support CXSmiles extensions in the hashes

* initial tests for that

* some cleanup

* copyright header cleanup

* minor refactoring

* call out the changes in the release notes

* extension and more testing

* add python wrappers
2022-03-03 16:00:38 +01:00
Kevin Burk
f8cf31068e Support for logging via Python's logging module. (#4846)
* Support for logging via Python's logging module.

* Avoid the Python 3.9+ PyObject_CallOneArg function.

* Move logging functions to RDBase; Python logger by default; clean up tests.

* See if removing NOGIL fixes the Windows stall.

* get tests running on windows

* Reset to using C++ logging; whiespace tweaks.

* Longer timestamp grace period; try tempfile vs Windows logging stall.

* Clean up commented code; get details for log count bug.

* SubstructLibrary: Fix c++ threads calling into python

* FilterCatalog: Fix c++ threads calling into python

* Release notes; make sure Jupyter still logs to sys.stderr.

* Always use thread-local log buffers.

* de-verbosify a test

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
Co-authored-by: Brian Kelley <fustigator@gmail.com>
2022-01-24 04:49:27 +01:00