Commit Graph

5576 Commits

Author SHA1 Message Date
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
Brian Kelley
58c21baeba ChemDraw Document and read/write support for the RDKit (#8620)
* ChemDraw Document and read/write support for the RDKit

* Add missing test file

* Rev chemdraw version

* Rev chemdraw version

* Rev chemdraw version for g++11

* Update CMakeLists.txt

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

* Build chemdraw from an external CMake file

* Remove unused platform bigendian check

* Revert changes to constants, remove unused ones

* Keep the original constant names

* Remove __main__ section

* Use as much of the ChemDraw CMakeList as possible

* Skip installing expat

* Rev chemdraw version to fix windows issue

* Don't install expat, set the appropriate CHEMDRAW_BUILD definition

* resolve windows builds

* Fix minimal lib builds

* Move ChemDraw document to private header

* Move utility functions to ChemDraw namespace

* Move ChemDraw to v2 unique ptr api namespace

* Make class enum

* Switch to camelCase

* Response to review

* Move ChemDrawToDocument to ChemDraw namespace

* Update External/ChemDraw/Wrap/rdChemDraw.cpp

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

* Fix typo

* Update External/ChemDraw/Wrap/rdChemDraw.cpp

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

* Add better documentation

* Rev chemdraw version

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-07-04 06:36:10 +02:00
Greg Landrum
969b1aadee Revert "ChemDraw Document and read/write support for the RDKit (#8539)" (#8618)
This reverts commit f8fde2f7d8.
2025-07-03 07:57:20 +02:00
Brian Kelley
f8fde2f7d8 ChemDraw Document and read/write support for the RDKit (#8539)
* ChemDraw Document and read/write support for the RDKit

* Add missing test file

* Rev chemdraw version

* Rev chemdraw version

* Rev chemdraw version for g++11

* Update CMakeLists.txt

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

* Build chemdraw from an external CMake file

* Remove unused platform bigendian check

* Revert changes to constants, remove unused ones

* Keep the original constant names

* Remove __main__ section

* Use as much of the ChemDraw CMakeList as possible

* Skip installing expat

* Rev chemdraw version to fix windows issue

* Don't install expat, set the appropriate CHEMDRAW_BUILD definition

* resolve windows builds

* Fix minimal lib builds

* Move ChemDraw document to private header

* Move utility functions to ChemDraw namespace

* Move ChemDraw to v2 unique ptr api namespace

* Make class enum

* Switch to camelCase

* Response to review

* Move ChemDrawToDocument to ChemDraw namespace

* Update External/ChemDraw/Wrap/rdChemDraw.cpp

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

* Fix typo

* Update External/ChemDraw/Wrap/rdChemDraw.cpp

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

* Add better documentation

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-07-03 06:01:58 +02:00
Ricardo Rodriguez
d523c6d818 Make assignCIPLabels Ctrl+c interruptable (#8589)
* add ctrl+c interrupt to assignCIPLabels

* add missing include
2025-06-27 08:27:44 +02:00
Yakov Pechersky
12f3f88036 feed dummy perpendicular point for cross product to prevent zero error in normalization during atropisomer chirality, fixes #8602 (#8603)
* feed dummy perpendicular point for cross product to prevent zero error in normalization during atropisomer chirality, fixes #8602

* remove debug log

* move test, and check that no bonds
2025-06-26 19:34:17 +02:00
Greg Landrum
05be3872f0 Fixes the problems with wiggly bonds and EnumerateStereoisomers from #8508 (#8598) 2025-06-25 09:25:11 +02:00
Paolo Tosco
42a2874045 - expose the onlyWedgeFlags parameter to SWIG ClearSingleBondDirFlags (#8600)
- exercise the flag through a unit test

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-06-25 09:24:10 +02:00
ndickson-nvidia
0d9bd15851 Fixed out of bounds vector access in GetGeodesicMatrix (#8601) 2025-06-25 06:26:41 +02:00
Greg Landrum
f4012abbcd Small cleanups of the MMFF94 code (#8593)
* progress, passes tests, needs more optimization

* passes tests

* minor

* cleanup
set diagonal elements of matrix

* replace numeric consts with enum

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-06-24 08:07:51 +02:00
paconius
284012bd3e Update createStereoGroup to accept bond list (#8587)
* Modify createStereoGroup

add bondIdx list

* update python wrapper

* Add CreateStereoGroup tests w/ bonds

* Update StereoGroup.cpp

* Update StereoGroup.cpp

* Update StereoGroup.cpp

* Update rough_test.py

* Update StereoGroup.cpp

added check if atom and bond lists are both empty

* aded test for empty stereogroup creation
2025-06-16 06:04:34 +02:00
Ricardo Rodriguez
d570dee093 CIP labeler: attempt to resolve "easy" stereo centers first (#8582)
* resolve easy chirality labels first

* add a test
2025-06-15 16:22:22 +02:00
Greg Landrum
7b9c1a9ca9 Fixes #8471 (#8585)
Co-authored-by: = <=>
2025-06-15 16:21:07 +02:00
Michael Blakey
6645d35ad8 docs update to fix stale issue (#8581) 2025-06-12 05:04:15 +02:00
Greg Landrum
00a9dc49f7 Fixes #8559 (#8560)
* Fixes #8559

Also includes some minor refactoring of set14Bounds()

* apply the same change to the cis/trans trackers

* cleanup

---------

Co-authored-by: = <=>
2025-06-06 15:30:07 +02:00
Brian Kelley
a6890baf0f Fixes #8284 (#8556)
* Adds a df_forceStop to stop readers and writers, clears out queues on destructor

* Propery implement close function, requires protected closeStreams

* changes from greg's version

* close() needs to be called in the derived destructors

* Close the writers before the reader to avoid deadlock

* Don't process trailing new lines

* Don't accept pushes if the queue is done

* Add mutex protecting d_threadCounter, remove unneeded forceStop checks

* Update Code/GraphMol/FileParsers/MultithreadedMolSupplier.cpp

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

* Add comment for the d_threadCounterMutex unlock

---------

Co-authored-by: = <=>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-06-06 14:09:57 +02:00
Greg Landrum
dcd317b4f0 Some cleanup of the xyz2mol code (#8567)
* some efficiency/modernization changes

* more modernization

---------

Co-authored-by: = <=>
2025-06-05 08:43:22 -04:00
David Cosgrove
9f446b1fa6 Cpp enumerate stereoisomers (#8563)
* Basic transliteration and tests complete.

* Atropisomers for assigned only.

* Python wrapper.

* Tidy.

* Working with gcc.

* Tidy.

* Rename Python test file.

* Clear other atropisomer bond.

* Fiddle Windows export thing.

* Fiddle Windows export thing.

* Split namespace declaration.

* No export thing.

* More export things, and add it to CMakeLists.txt.

* Response to review.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-06-05 08:29:54 +02:00
David Cosgrove
79403df1b0 Synthon space bad chiral count (#8550)
* Count chiral atoms just counts tetrahedral atoms.

* Put an actual check in.

* Randomly fix some unconnected warnings.

* Curb my enthusiasm for std::cmp_less.

* Trigger Build

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-06-03 13:09:09 +02:00
tadhurst-cdd
8393e26292 allow nested parentheses in tokens (#8553)
* allow nested parens in tokens

* removed commented old code

* add the test file

* changes as per PR review
2025-06-01 12:46:53 +02:00
Greg Landrum
21d694e88a fix a problem with stereogroups involving bonds and getMolFrags() (#8558)
This is a continuation of #8542
2025-05-27 16:43:20 +02:00
Ricardo Rodriguez
1feddc1570 Support Ctrl+C in determineBondOrders (#8557)
* support Ctrl+C in determineBondOrders

* fix typo
2025-05-27 05:01:29 +02:00
David Cosgrove
b418f5974d Fix irritating warning when DrawMolMCHLasso compiled. (#8540)
* Fix irritating warning.

* Don't use back_inserter.
2025-05-27 04:56:35 +02:00
Yi-Shu Tu
18d4d65fb0 Update python def of MolToSVG (Fix #7497) (#8331)
* update python def of MolToSVG

* add unitest for moltosvg
2025-05-27 04:45:00 +02:00
paconius
1147bcbc6d Fixes #8527 (#8542)
* Add getMolFrags test

confirm bond-only stereogroups are preserved during fragmenation

* Update molopstest.cpp

* Prevent deletion of stereogroups

Prevent removeAtomFromGroups from deleting stereogroups that have bonds but no atoms
2025-05-25 14:58:48 +02:00
Paolo Tosco
f7a3bfe4e2 replace incorrect Freetype cmake flags with correct ones (#8543)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-05-25 14:55:55 +02:00
Paolo Tosco
6533bbfaa2 Add missing default values to docker-compose configuration (#8544)
* add missing default values to docker-compose configuration

* remove unnecessary network settings

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-05-24 07:29:06 +02:00
Kevin Keating
2a6307b0aa rdkit-targets.cmake now uses cmake package names for external libraries instead of absolute paths (#8552) 2025-05-24 07:27:03 +02:00
Paolo Tosco
f3cd17ba37 Explicitly construct an emscripten::val object with allow_raw_pointers() policy before setting a JS object key to a raw pointer value (#8555) 2025-05-23 17:29:41 +02:00
tadhurst-cdd
0c70360dab allow limiting the number of stereo groups to process (#8541)
* limit number of stereo groups to process

* limit to stereogroup count added to python wrapper
2025-05-23 04:39:14 +02:00
Ricardo Rodriguez
c6f33913ac Add a "time out" to determineBondOrders (#8548)
* implement max iterations

* add docstrings

* Add a couple of tests
2025-05-22 05:13:45 +02:00