5794 Commits

Author SHA1 Message Date
Greg Landrum
60940f5e53 Fixes a bug with chirality perception of T-shaped centers in very large rings (#8930)
* Fixes a bug with chirality perception of T-shaped centers in very large rings

* remove those files from the chemdraw tests
should be added later once we figure out and fix what the problem on the chemdraw side is (it is not directly connected to this PR)

* be more systematic about the tolerance values
carry the same tolerances over into the bond wedging code

* re-enable those chemdraw tests

* typo
2025-11-10 13:02:42 -05:00
Greg Landrum
1a43f1cbef Fixes for nontetrahedral stereo parsing from SMILES/SMARTS (#8932)
* backup

* fix nontet stereo parsing in SMARTS
2025-11-09 05:31:12 +01:00
Justin Gullingsrud
bda9ffbeec Incremental synthon search (#8855)
* Iterated interface to substructure search

* Add a test

* Add python unit test

* Expose the toTryChunkSize parameter to python

* Respect the maxHits parameter; sort the hitset

* Treat maxHits=-1 as infinite

* Add callback versions of fp and rascal search; conform to C++ style

* Add fp and rascal C++ tests

* maxHits=-1 tripped me up again

* Add fp and rascal python wrappers.

Changed the name of the callback-based method to have "Incremental"
in the name because the overloaded versions with default arguments
can't be reliably selected by the boost python runtime.  Probably
better to have a different method name anyway since the return type
is None instead of a results object.

* Delete stray printf.

* Run clang-format

* Use std::int64_t instead of ssize_t for portability

* Make docstrings on callback-based methods more descriptive

* Stop incremental search if the callback returns true.

* Add an example of incremental synthon search to the getting started docs

* trivial commit to force CI rerun

* Reformat single line if statements.

* Make SearchResultsCallback take const ref input

* Fix another one-liner

* Oops - another one-liner
2025-11-08 04:27:16 +01:00
Greg Landrum
adf72c984f Do not reset the ringInfo information when adding bonds to RWMol (#8934)
* Do not reset the ringInfo information when adding bonds

This call was inconsistent (for example, the version of addBond() in ROMol did not do it)
and is unnecessary since the standard assumption is molecules need
to be re-sanitized after adding atoms and bonds

* response to review

clear the property cache on atoms after adding a bond.

* add a property cache update to the reaction runner

* add something to the release notes
2025-11-07 14:41:01 +01:00
Chris Von Bargen
732a63356a Change extern types to static consts (#8765)
* When building RDKit as a static library, Ricardo found that the externs aren't
being resolved correctly causing a number of bad std::any casts. This is his
patch (which we apply in the context of the sketcher build) which moves the
definitions up from the types.cpp file, and make them static.

* Use inline keyword to avoid duplication overhead; this still allows the
use of the static keyword to resolve the issue with static libs
https://en.cppreference.com/w/cpp/language/inline.html

* static inline doesn't work in my static builds; inline only does though

* inline constexpr std::string_view

* casting

* inline-constexpr

* add string_view to python converter

* propagate string_view after static types

---------

Co-authored-by: Ric <ricrogz@gmail.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-11-07 05:15:22 +01:00
Greg Landrum
9a4cca3967 Allow using generators for similarity maps (#8912)
* add option to track atoms involved in each bit for morgan FP

Needs test still

* support similarity maps using fingerprint generators

* support RDKit, AP, and TT

still need tests

* add some testing

* response to review
2025-11-06 19:12:29 +01:00
Greg Landrum
84bef7a66e Allow abbreviations without XBonds (#8933)
* coding error checking on extraAttachAtoms

* Allow abbreviations that do not include XBonds

Fixes #8902
2025-11-06 16:33:25 +01:00
tadhurst-cdd
c948297d98 added new attributes for scsr template as per BIOVIA doc 2023 (#8911)
* added new attributes for scsr template as per BIOVIA doc 2003

* changed to allow any attributes for an SCSR Template def

* removed unneeded defs for TEMPLATE attribute names
2025-11-06 12:24:45 +01:00
Ricardo Rodriguez
9a4b3e2fc6 Implements #8873 (#8904)
* merge ABS groups on setStereoGroups

* warn/fail on multiple ABS groups on strict parsing

* add a test for setStereoGroups

* add a test for multiple ABS groups in mol blocks

* Drop the warning
2025-11-04 16:10:56 +01:00
Anton Siomchen
d3756fc9a2 add conditional logic for GETAWAY test (#8923) 2025-11-04 16:05:56 +01:00
Ricardo Rodriguez
c354ff11dc ignore whitespace in patch (#8927) 2025-11-04 16:04:39 +01:00
David Cosgrove
b9b6078137 Extra explanation of getPosition() and getReagents(). (#8909) 2025-11-01 06:18:08 +01:00
Brian Kelley
c4678568a9 Use adjustQueryProperties logic when dealing with dummy atoms in cxsmiles (#8907) 2025-11-01 05:38:17 +01:00
David Cosgrove
a5347e725e Allow Multiple Core Hits in the Same Molecule in RGroupDecomposition (#8813)
* Allow the same core to match more than once in a molecule.

* Update annotation.

* Changes after review.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-10-29 21:50:19 +01:00
David Cosgrove
dad4d39803 Change docs in Python EmbedMultipleConfs. (#8900)
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-10-28 02:09:14 +01:00
Greg Landrum
0ee90279b5 Partial fix to a problem with implicit Hs being written to SMARTS (#8893)
* Partially resolve a problem with implicit Hs ending up in SMARTS

* update doctest

* document in release notes
2025-10-24 07:50:06 +02:00
Greg Landrum
8844c55572 Fixes #8890 (#8891)
stop stripping string properties
updates doc string
adds a test for autoConvertStrings
2025-10-23 08:52:27 -04:00
Ricardo Rodriguez
e4c8ed7765 remove (#8872) 2025-10-23 11:21:36 +02:00
Greg Landrum
e625bdb95c make Point2D and Point3D constexpr (#8882)
* constexpr Point, Point2D, and Point3D

* constexpr Vector

* cleanup

* rollback overzealous constexpring

* dial back the constexpr to get windows builds working

the math stuff isn't constexpr with MSVC++

* add [[nodiscard]]
2025-10-23 10:57:33 +02:00
Greg Landrum
20907d3ba9 Fixes #8877 (#8886) 2025-10-22 07:59:35 -04:00
Andrew Dirksen
1ea159ce65 set up performance benchmarks (#8865) 2025-10-18 08:07:49 +02:00
Ricardo Rodriguez
d9850596aa Fixes #8726 (#8874)
* do not remove hydrides by default

* add a minimal test

* add release note about behavior change

* require Hydrides to have degree 1

* also allow hydrides with degree 0 (ionic bond)

* suggested changes

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2025-10-17 16:51:22 +02:00
Greg Landrum
93d0f8bb74 Fixes #8776 (#8875)
* Fixes #8776

don't call the pseudo-CIP perception code if we really don't need to

* allow calling the pseudo-CIP code from Python

* update doctests
2025-10-17 05:52:27 +02:00
Ricardo Rodriguez
af4e8cf01f propagate string_view (#8858) 2025-10-14 19:15:37 +02:00
Greg Landrum
3a4d4df17e allow default radii in the DCLV calculation (#8836) 2025-10-11 20:35:20 +02:00
Greg Landrum
9fd5595f98 use bond labels in the ranking in MolFragmentToSmiles (#8861) 2025-10-10 14:58:45 +02:00
David Cosgrove
dfdddb3fc9 Add extra info about return value. (#8860) 2025-10-10 14:58:20 +02:00
Ricardo Rodriguez
7d1e662bc7 Use std::string_view for property keys (#8844)
* string_view props API

* wip

* fix leak

* add string_view to swig

* fix comment

* add backwards incompatibilty note

* fix rebase issue

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-10-09 16:14:48 +02:00
Greg Landrum
ad1fcb5b7b Use properties in the MolDrawOptions python wrappers to make setting/getting colours easier (#8857)
* support direct property setting/getting in MolDraw2DOptions

* same thing for contourParams

* add getAtomPalette()
2025-10-09 14:14:19 +02:00
Greg Landrum
00583fc1ab Fix a couple issues related to atom list handling in V3000 mol blocks (#8824)
Fixes #8820
Fixes #8823
2025-10-09 05:26:01 +02:00
Brian Kelley
b0ef80d68d Allow labeled atoms to have working queries (#8849)
* Allow labeled atoms to have working queries

* Remove stray keystrokes

* Fix typo

* Apply clang-format

* Move simpler checks first

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2025-10-09 04:46:20 +02:00
Niels Maeder
686ca3fd6e same docs for same behaviour (#8854) 2025-10-09 04:44:58 +02:00
Ricardo Rodriguez
9eaa193186 Merge simple AND queries onto atoms. (#8830)
* duplicate parser code

* regenerate smarts.tab files

* update test

* add release note

* restore pregenerated header

* Suggested changes (#23)

* add a generic flags interface to atoms and bonds

* suggested changes

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-10-09 04:38:42 +02:00
Niels Maeder
db93262a3e Add safeSetattr to more params / options objects (#8842)
* add safeSetattr to varios params objects

* added safeSetattr to further params / options
2025-10-08 16:15:20 +02:00
Rachael Pirie
b2fe43a9ad add Reaction From Smiles python wrapper (#8843)
* add Reaction From Smiles python wrapper

* Update Code/GraphMol/ChemReactions/Wrap/rdChemReactions.cpp

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

* fix Greg changes

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-10-08 16:13:06 +02:00
Ricardo Rodriguez
7b7a8a4e17 Refactor iostreams includes (#8846)
* refactor iostreams includes

* restore ostream to MonomerInfo.cpp
2025-10-08 16:08:01 +02:00
Ricardo Rodriguez
a4b63d7df5 Minor refactor of the python wrappers (#8847)
* refactor python wrappers

* fix FilterHierarchyMatcher converted already registered warning
2025-10-05 09:42:31 +02:00
Ricardo Rodriguez
fbf4990709 Fixes a leak in ChemDraw code (#8828)
* clang format

* refactor code

* fix typos

* do not leak bonds when deleting in batch mode

* check sizes
2025-10-02 06:04:24 +02:00
Paolo Tosco
23ffd85f60 - fix #8481 (#8808)
- implement get_v2Kmolblock() in MinimalLib
- add the possibility to specify the MDL version preference as a get_molblock() forceMDLVersion JSON parameter, which is ignored by get_v3Kmolblock() and get_v2Kmolblock()
- changes in response to review

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-09-29 17:33:02 +02:00
tadhurst-cdd
f00a8cbb4c ScsrHbondMrvError (#8646)
* fix MRV for Hbonds

* add test file

* add test file

* enforce chirality in DistGeom catch test

* Added test for correct hbond retention

* removed debug print statement

* retrigger checks

* testing  java AromaticTests

* testing java aromaticTests

* removed testing code
2025-09-29 17:30:50 +02:00
Paolo Tosco
24b2039040 Implement returnDrawCoords JSON option in MinimalLib to return 2D drawing coordinates when SVG or canvas depictions are generated (#8815)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-09-29 09:36:06 +02:00
Ricardo Rodriguez
56df4de046 fix (#8829) 2025-09-29 09:25:14 +02:00
Rachael Pirie
2e1d946f6d DCLV updates (#8756)
* first pass speed up of DCLV method

* drop to 320 surface points, add polar surface area v1

* suggested changes

* add John's GridKey implementation

* revert standard dots to float array

* pass simple variables by value

* stable pass radii as param

* final DCLV updates

- update max radius
- includeHs flag for polar surface area/volume
- fix silly include ligand mistake in checkExcludeAtoms
- update tests

* add missing break statements

* missing ;

* Greg changes 1

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

* Greg changes 2

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

* Greg changes 3

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

* Greg changes 4

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

* Greg changes 5

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

* Greg changes 6

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

* Greg changes 7

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

* Greg changes 7

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

* missing return false

* Greg changes 8

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

* fix incomplete doc string

* fix pytests

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2025-09-26 16:40:11 +02:00
Brian Kelley
d304f9f416 Trim spaces from RDProp strings to simulate reading from SDFiles (#8760)
* Trim spaces from RDProp strings to simulate reading from SDFiles

* Update documentation

* Use the correct doc strings

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2025-09-26 06:14:23 +02:00
Greg Landrum
c15eb1a143 Fixes #8633 (#8794)
* Fixes #8633

* changes in response to review
2025-09-26 05:33:13 +02:00
Paolo Tosco
053a0283f7 Patch RapidJSON to make sure it builds on all platforms (#8818)
* patch RapidJSON to make sure it builds on all platforms

* remove unnecessary sed command from Docker recipe

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-09-26 05:28:46 +02:00
Niels Maeder
4f2e61cbd3 expose exceeded timeout (#8816) 2025-09-25 14:07:43 +02:00
Joshua Black
64f7a5456f Stop External/rapidjson-1.1.0 and Code/RDGeneral going to ${CMAKE_SOURCE_DIR} (#8810)
* set export.h and test.h to go to the correct places in RDKitUtils

* use cmake_source_dir so cmake files are picked up in list

* use cmake_current_source_dir in MolInterchange

* use rdkit variables to place rapidjson and headers in correct places
2025-09-25 14:05:35 +02:00
Brian Kelley
553424d6b6 Revert "Create a function to extract some specified atoms from a ROMol as a new ROMol by creating new graph (#8742) (#8743)" (#8814)
This reverts commit 040bdb61c7.

During testing of using this as a replacement for portions of
getTheFrags in getMolFrags, several issues came up regarding
how copies should actually work in practice.  These are being
corrected in a new pr:  https://github.com/rdkit/rdkit/pull/8811

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2025-09-25 10:54:36 +02:00
Hussein Faara
040bdb61c7 Create a function to extract some specified atoms from a ROMol as a new ROMol by creating new graph (#8742) (#8743)
* Create a function to extract some specified atoms from a ROMol as a new ROMol by creating new graph (#8742)

This adds a new api, `RDKit::MolOps::ExtractMolFragment`, to allow efficient
extractions of mol fragments from large mols. Compared to the approach where
we delete "unwanted" atoms/bonds from the input mol, this api is faster for
small mols (about 2x faster) and at least 3x faster for big mols
(was 10x faster for "CCC"*1000).

* clang-format

* review comments

* cleanup

* review comments

* fix build failure

---------

Co-authored-by: Your Name <you@example.com>
2025-09-24 06:39:52 +02:00