Commit Graph

5606 Commits

Author SHA1 Message Date
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
Niels Maeder
d13b002d2d update default ET version to 2 in getExperimentalTorsions (#8798)
* update et version to 2

* Add comment in the release notes.
2025-09-24 05:56:35 +02:00
Paolo Tosco
805294c27f - move MolDrawOptions JSON parsing code to a separate compilation unit (#8783)
- implement drawingExtentsInclude MolDrawOption taking as parameter DrawElement enum values
- add unit tests for drawingExtentsInclude option (C++, Python, CFFI)

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-09-23 09:27:13 +02: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
Vandan Revanur
cded6cc4e0 ForceFieldHelpers: fix “No Python class registered” error (#8800)
Fixes github issue #8597.

* UFFGetMoleculeForceField was returning
PyForceField* before the class was registered via rdForceField,
which caused “No Python class registered” errors in Python when
using multiple conformers.

* This patch forces rdForceField to be
imported during rdForceFieldHelpers module init, ensuring the
class is always registered before helper functions are used.

* Add unit test
2025-09-23 06:03:57 +02:00
Greg Landrum
951be4f06e fixes #5078 (#8795)
* fixes #5078

* add some more tests
2025-09-22 11:06:42 +02:00
Niels Maeder
5b1d04d23e Fix grad scaling (#8791)
* fix grad

* adapt tests to pass with fix

---------

Co-authored-by: Niels Maeder <maedern@ethz.ch>
2025-09-21 18:19:50 +02:00
Greg Landrum
97e1a764eb fix a mistake caused by a dumb suggestion (#8792) 2025-09-19 09:33:32 +02:00
badisa
d392c755b7 Document Options in RGroupDcompose and other minor docs fixes (#8757)
* Adds missing options docstring

* Always be cleaning

* Fix typos in RGroupDecomposition module

* Update documentation on configuring doxygen

* Was a step that I couldn't find reference to besides in the Makefile

* Undo american spelling of labelling

* British spelling appears more consistent

* Fix style of RGroupDecompositionParameters parameter

* Also fixes a typo

* Remove unintentional use of docstring

* Was assigning documentation about the parameters to the
  RGroupDecomposition

* Remove empty string

* Apply suggestions from code review

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

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-09-18 16:41:16 +02:00
Greg Landrum
d12932f13e support bond property lists in SDF (#8778)
* backup
builds but no tests

* deprecate old form

* initial basic tests for bond property lists

* Tests pass

Fixes #8777

* add deprecations to release notes

* - avoid computing size of a constant at runtime
- replace multiple instances of a numeric constant with a literal constant
- avoid unnecessary copying of strings in iterations and function calls

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-09-17 16:17:12 +02:00
Paolo Tosco
5ed6c56cc8 Avoid code duplication through a templated function and improve JSON parsing of Boolean flags (#8773)
* - avoid code duplication through a templated function
- enable switching off boolean flags via JSON and not just on as before

* ran clang-format

* change in response to review

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-09-16 16:29:04 +02:00
Greg Landrum
b693c5d4df Revert "Fixes #8644 (#8768)" (#8787)
This reverts commit a47a5d91aa.
2025-09-16 16:28:01 +02:00
Ricardo Rodriguez
a47a5d91aa Fixes #8644 (#8768)
* potential satisfactory solution

* fix typo

* update testMultithreadedMolSupplier.py

* revert first patch

* better fix

* add test
2025-09-16 05:24:45 +02:00
Chris Von Bargen
475c892215 When building RDKit on Windows Server 2022 (the windows-latest GitHub runner) (#8763)
a couple of headers needed #include <cstdint> to compile properly
2025-09-12 17:24:15 +02:00
Brian Kelley
bf35a4204e Fix non matching if(x) end(x) statement (#8769) 2025-09-12 11:08:16 -04:00
Ricardo Rodriguez
6da61ce9ac Fixes #8712 (#8736)
* fix secondary bug involving ring stereo clearing

* refactor test

* update ring stereo for last atom
2025-09-11 05:01:08 +02:00
Greg Landrum
6d8fca2fbf Fixes #8689 (#8738)
* add test

* potential fix

* whops\!

* support disabling ring stereo in rankMolAtoms

* pass atom ranks into the ring-stereo detection code

* all tests pass

* forgot a file

---------

Co-authored-by: Ric R. <ricrogz@gmail.com>
2025-09-03 12:15:09 +02:00
Brian Kelley
cf269aa813 Expose CDX support to FileParsers and ChemDraw to SWIG (#8681)
* Fist pass at CDX support

* Enable CDX support for reading (also) in the CDXMLParser API

* Add cdxml test files

* Update swig wrappers for CDXMLFormat and Parameters

* Add constructor to ChemDrawParserParams

* Add Java SWIG support for ChemDraw

* Add chemdraw define to rdconfig

* Add missing chemdraw deps

* Remove direct expat link

* Fix Java linkages for ChemDraw

* Remove bad merge code

* Remove bad merge code

* Fix csharp builds

* Add sniffer for the ChemDraw DataStream

* Include filesystem

* Fix test on windows

* Add more CDX tests

* Ensure streams are open in binary mode to support CDX on windows

* Fix text to show that a Block is the text input, not a file

* Fix CSharp test

* Disable CDX tests when not building chemdraw

* Turn back on chemdraw

* Response to review

* Turn off chemdraw support for the limited external test

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2025-08-29 04:39:22 +02:00
David Cosgrove
d54d0c5a10 CanonicalizeConformer inverts structure (#8734)
* Different test for possible coords inversion.

* Typo.

* Comment in test.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-08-27 17:12:08 +02:00
Ricardo Rodriguez
be2b1899ae Add the useRingTemplates option to generateDepictionMatching2DStructure (#8688)
* Add the param

* add a C++ test

* wrap it for Python

* mirror the C++ test in Python
2025-08-25 19:39:57 +02:00
Paolo Tosco
dd044522c1 - expose RDK_BUILD_MINIMAL_LIB_RGROUPDECOMP in Code/MinimalLib/CMakeLists.txt (#8729)
- explicitly wrap raw pointer into emscripten::val with allow_raw_pointers() policy

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-08-25 19:37:59 +02:00
tadhurst-cdd
3f60cb5674 Fix for Issue 8602 (#8668)
* Fix for Issue 8602

* Simlified generation of 3d from of ref for atropisomers
2025-08-20 10:10:47 +02:00
David Cosgrove
f90b4382ca Fix drawing of very short arcs in lasso. (#8706) 2025-08-15 08:25:32 +02:00
David Cosgrove
b9666d93b8 Fix offsets for DrawMoleculeWithHighlights. (#8680)
* Fix offsets for DrawMoleculeWithHighlights.

* No Freetype test.

* Trigger Build

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-08-14 07:17:31 +02:00
Greg Landrum
4007e0c555 Fixes #7264 (#8696) 2025-08-12 16:27:18 +02:00
Hussein Faara
9b73ebf2d3 Fix parse error messages for bad characters (#8675)
* Fix parse error messages for bad characters

This updates the SMILES and SMARTS parser error messages to include the token
position for "bad" characters.

* copy generated files

* add test
2025-08-11 15:20:55 +02:00
Greg Landrum
ccefda882d Fixes #8654 (#8657)
* Fixes #8654

* fix a logic error

* SWIG is sooooo much fun
2025-07-30 05:56:52 +02:00
Patrick Kunzmann
c20b2a906b Fix #8638 (#8639)
* Fix #8638

* add a test

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2025-07-25 14:33:32 +02:00
David Cosgrove
34e80ab764 Fixes Github8650 - spaces in columns in tab-separated synthon space files (#8652)
* Try tab-separated before space-separated when reading synthon lines.
Fix bug in looking up reactions by name.
amino_acid.txt had a mixture of tab-separated and space-separated lines which is no longer allowed.

* Typo

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-07-25 06:35:35 +02:00
paconius
1fe07a5eb7 Add option to draw all CIP codes in DrawMol.cpp (#8609)
* enable showAllCIPCodes in DrawMol code

* Made consistent with old behavior + add test

* Added python test

* Fixed FREETYPE=OFF tests

* Fixed FREETYPE=OFF tests

* Adjusted pytest

* Enabled JSON drawer option setting + new JSON test

* update JS docs
2025-07-24 16:46:15 +02:00
David Cosgrove
e712d201a6 Fix Rascal out of memory bug. (#8648)
* Make test

* Cap number of equivalent cliques that will be produced.

* Oh FFFS!

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-07-24 16:43:09 +02:00
Paolo Tosco
9c7ffb33e9 Expose reading/writing PNG metadata to CFFI and MinimalLib (#8381)
* get SynthonSpace.cpp to build also when RDK_USE_BOOST_SERIALIZATION is
not defined

* test should not fail when RDK_USE_BOOST_SERIALIZATION is not defined

* - expose reading/writing PNG metadata to CFFI and MinimalLib
- add relevant CFFI and MinimalLib unit tests
- add RDK_USE_BOOST_PROGRAM_OPTIONS CMake option
- enable using standalone zlib in the absence of boost::iostreams for parsing PNG files
- enable linking against maeparser in the absence of boost::iostreams also on Windows
- enable building RDKit in the absence of boost::program_options

* add check for boost::program_options

* change size_t into std::uint64_t in SearchResults for consistency with doTheSearch() which uses std::uint64_t

* change size_t into std::uint64_t in SearchResults for consistency with
SynthonSpaceSearcher::doTheSearch()

* set CMake policy to allow YAeHMOP to require a version which is not
actually supported

* reverted External/YAeHMOP/CMakeLists.txt to master version

* check if Windows build will work

* fix build

* configure zlib install location

* build zlib dependency

* include zlib header directory

* explicitly set PropertyFlags.AllProps so the test does not fail on
static builds

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-07-23 17:10:38 +02:00
Paolo Tosco
3542b3ffbb Fixes #8569 (#8588) 2025-07-21 23:45:09 -04:00
Ricardo Rodriguez
397d19e676 Mem fixes (#8640)
* fix leaking mol in rdEnumerateStereoisomers.cpp

* clang-format Code/GraphMol/FileParsers/MultithreadedMolSupplier.cpp

* fix leaking mols in MultithreadedMolSupplier output queue
2025-07-21 05:57:50 +02:00
Greg Landrum
ebd7dad122 Switch a bunch of C++ tests to use catch2 (#8625) 2025-07-18 11:50:38 +02:00
Hussein Faara
82586a0114 Update SMARTS parsing syntax error to include bad token position (#8610) 2025-07-16 03:06:59 +02:00
Greg Landrum
768a71a638 Fixes #8586 (#8604) 2025-07-13 21:28:45 +02:00
tadhurst-cdd
9055646b54 Scsr sgroup error (#8623)
* fix scsr parsing for non-template SUP groups

* Rempoved two tests not related to this PR

* Update Code/GraphMol/FileParsers/SCSRMolFileParser.cpp

added the constexpr as suggested

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

* changed constrexpr to const for std:string

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-07-13 11:05:29 +02:00
tadhurst-cdd
20a8e8eb62 fix mrv parsing for Rgroups to make smiles work (#8617)
* fix mvv parsing for Rgroups to make smiles work

* changes as per PR review
2025-07-10 11:22:26 +02:00