Commit Graph

5563 Commits

Author SHA1 Message Date
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
Paolo Tosco
73a7378ddb Avoid a large number of warnings when building MinimalLib with emscripten (#8545)
* - avoid a large number of warnings when building MinimalLib with emscripten, which does not support SHARED
- fix indentation in CoordGen CMakeLists.txt

* disable RDK_USE_BOOST_STACKTRACE on emscripten platform

* revert change done by mistake

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-05-22 05:08:01 +02:00
Niels Maeder
22dfa85110 Fix ETKDG double bond check from #8518 (#8528)
* only exclude multiple double bonds from check if degree of center atom is 2

* clang-format

* add test for fix

* try fixing DLL build

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

* fix Widnows build as suggested by @greglandrum

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-05-19 14:28:15 +02:00
Greg Landrum
9d4afd0e08 add clearPropertyCache() (#8533) 2025-05-18 08:14:05 +02:00
David Cosgrove
440171cb1d DrawShapeArrow::doesRectClash uses origPts_. (#8535) 2025-05-18 08:13:00 +02:00
tadhurst-cdd
ca41fa5bfd Add SCSR parsing to RDKit (#8147)
* Parsing SCSR

* add scsrol to mol

* removed bad include file

* loosen distGeom test slightly

* add wrap test for SCSRMol

* Add test for scsr in python

* tests added for scsr and strict parsing removed

* remove extra stuff

* More fully specified use of SCSRMol for PR CI build

* Added flags for SCSR expansion to not include any leaving groups

* Added MolFromScsrParams to Wrap for python

* added SCSRMol destructor

* Added two tests for RNA macromols, and fixed a bug they revealed

* Added new tests abd expected files

* changes as per PR review

* SCSR Chnages for leaving groups

* fixed testScsr.py

* hydrogen bond treatment

* in SCSR expand, allow Hbond to be autoatically detected

* changes as per code review

* Adding new test file

* chages for SCSR contructors, destructors for CI build

* fixed pyton for SCSR hydrogen bond modes, and added tests

* Added new test files

* fixed edge case for SCSR

* fix checksum for inchi

* consistent capitalization of SCSR throughout

* switch to enum class

* make things shorter

* simplify

* get rid of the ATTCHORD class

* New section for SCSR in RDKit_book

* addeed section to RDKit_Book

* SCSRMol is no longer exposed in Python

* fix leak in MolFromSCSRFile()
light refactoring

* expose MolFromSCSRFile() to python
make the MolFromSCSR functions work with default args
a bit more testing

* removed C++ access to SCSRMol

* CXMsiles now ouputs hbonds, fix to template matching, and a few other things

* Addl fix for bad aromaticity in Hbond rings

* Test files needed

* Test files needed

* try to fix a CI build errors

* CI error fix

* Added missing test file

* CMake version - for CI build

* remove full file compoarison from macromol test file

* accidental change to debug restored to release

* Code review changes

* As per PR review

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-05-14 13:37:59 +02:00
David Cosgrove
49995f149c Change default ETversion. (#8414)
* Change default ETversion.

* add an ETDGv2 parameter set

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-05-14 07:42:48 +02:00
Inwan Yoo
7d452ebe93 Fixes 8327 (#8328)
* apply root id correctly for each fragment

* add missing rootedAtAtom assignment

* add tests for rootedAtAtom with multiple fragments

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-05-13 12:27:13 +02:00
Ricardo Rodriguez
3eb71c50ca A few mem fixes in tests (#8521)
* mol suppliers leaking mols on multiple tests

* test leaks query
2025-05-13 12:17:52 +02:00
Greg Landrum
a9477d2694 Modernization of some substructure code (#8450)
* use std::span for substruct match callbacks

This removes a copy from every evaluation of potential matches

* some cleanup/modernization

* some modernization

* deprecate chiralAtomCompat

* small optimization

* remove naked pointers

* improve new_timings.py script

* changes suggested in review

* response to review

* response to review
2025-05-12 06:33:25 +02:00
Greg Landrum
123875aadd add support for allene- and cumulene-like structures to KDG (#8518)
* add support for allene- and cumulene-like structures to the K terms in KDG

* Update Code/GraphMol/DistGeomHelpers/BoundsMatrixBuilder.cpp

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

* Update Code/GraphMol/DistGeomHelpers/Embedder.cpp

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

---------

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2025-05-12 06:32:54 +02:00
Jeremy Monat
7b729a670f Explain DrawArrow and rawCoords=True (#8517)
* Add to DrawArrow documentation: Explain rawCoords, frac, angle, color.

* Fix formatting of DrawArrow docstring

* Enhance Draw functions documentation: Clarify rawCoords behavior for pixel vs molecule frame coordinates.

* Remove Catch2 subproject dependency
2025-05-11 05:21:44 +02:00
David Cosgrove
5861d503e5 Synthon space hit filters (#8473)
* Add filters to hits.

* Add safeSetattr to Python wrapper.

* Fix chiral centres filter.

* Defaults of -1 for int max filters.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-05-11 05:14:12 +02:00
Greg Landrum
ab1ef7c267 expose cleanupStereoGroups to python (#8515)
Fixes #8467
2025-05-11 05:08:38 +02:00