Commit Graph

350 Commits

Author SHA1 Message Date
Max Rietmann
3802eaaac9 Fix potential iterator invalidation (#8944)
The iterator in the loop over bonds (changed in utils.cpp) is potentially
invalidated by adding bonds to the molecule. We copy the bonds into a vector to
ensure safety.
2025-11-11 17:03:05 +01:00
Ricardo Rodriguez
350c22f7dd Install expat lib in static builds (#8832)
* install expat in static builds

* specify destination

* also fix a windows build issue
2025-10-09 05:25:11 +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
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
Greg Landrum
6b30df1e40 run clang-tidy and clang-format on the chemdraw files (#8837)
* git tidy

* clang-format
2025-10-03 11:21:56 -04:00
Ricardo Rodriguez
158db5d1a7 link expat to ChemDraw_static (#8839) 2025-10-03 17:12:49 +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
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
Brian Kelley
7e9293ed25 Fix an out of bounds access when replacing fragments (#8767)
* Fix an out of bounds access when replacing fragments

* Add segfaulting US patent CDXs

* Return false when we can't find the bond idx for better handling

* Remove useless REQUIRE

* Only sniff when in format AUTO

* Add test for reading wrong format

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2025-09-25 15:53:50 +02:00
Greg Landrum
a5bcf726e1 allow custom shape points (#8799)
* support providing custom features

* expose that to python

* switch to tuples (on get) and objects (on set) for attributes

* allow aligning mols directly with ShapeInputOptions

* changes for review

* add warning
2025-09-23 18:56:03 +02:00
Chris Von Bargen
8b8d6a3fe2 RDKit's InChi build tries to guess whether the C compiler provides (#8764)
isascii() (which is the standard) or __isascii(), but it guesses wrong for
Emscripten builds (which I do during sketcher compilation). This change
passes -D__isascii=isascii when building InChi,
which means that the wrong guess will still wind up with the right
function name.
2025-09-12 17:15:19 +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
Greg Landrum
dbd972497f patch the pubchem alignment code (#8733)
Co-authored-by: = <=>
2025-08-28 09:18:03 +02:00
Greg Landrum
81226d84ad Fixes a bug with bad H positions in output conformer (#8731)
* Fixes a bug with bad H positions in output conformer

This would only trigger when the number of H atoms is equal
to the number of features, but it was terrible when it happened.

* spell that better

* docs

---------

Co-authored-by: = <=>
2025-08-27 13:28:50 +02:00
Pat Riley
4cc9d6f2e6 Update documentation for rdShapeAlign.AlignMol opt_param (#8724)
* Update documentation for opt_param

* Revert default to 1.0

* revert all 0.5 default changes
2025-08-25 16:56:59 +02:00
badisa
53a01430e0 Fix documentation errors for rdShapeAlign (#8685) 2025-08-10 07:51:09 +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
0ce4600f59 bump maeparser to 1.3.3 (#8580) 2025-06-12 05:02:36 +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
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
Greg Landrum
7467fe005f Fixes #8508 (#8514)
* Fixes #8508

* suggestion from review

* Update inchi.cpp
2025-05-11 05:10:18 +02:00
Yakov Pechersky
1356292c08 Set default Eigen3 version to 3.4.0 (#8477)
That is C++20 compatible

Fixes #8476
2025-05-05 09:00:20 +02:00
David Cosgrove
2de1dabdc1 ShapeInput from subset of atoms in molecule (#8449)
* Make shape on subset of atoms in molecule.
Optional radius for dummy atoms.

* Re-factor.
Add ShapeInputOptions.

* Python wrapper for options.

* Add non-standard radii option.
Add function to align a shape on a shape.
Add function to align conformer based on shape-shape transformation.

* Python wrappers for AlignShapes and TransformConformer.

* Add the new thing for Python options.

* Add option for excluding atoms from color features.
No partial color features if using atomSubset.

* In AlignShapes, don't change the fit shape (apart from transforming it) in case it will be used again.

* Rename it AlignShape to be consistent with AlignMolecule.

* Response to review.

* Undo clang-format

* Fix botched merge.

* Typo.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-04-27 06:51:53 +02:00
David Cosgrove
fee128300c Only apply transformation to reference centre when overlaying molecule onto molecule. (#8463) 2025-04-25 10:57:32 +02:00
David Cosgrove
a88ef96b33 Set useCutOff in PrepareConformer. (#8446) 2025-04-16 12:14:59 +02:00
David Cosgrove
4ea67c70a5 Support pickling Shape inputs (#8434)
* Stash for transfer.

* Basic serialization.

* Serialization of ShapeInput.

* Default c'tor and operator=.

* Response to review.

* Add cmake to macOS CI image.

* Add make, not cmake.

* Conditional serialization test.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-04-14 18:03:50 +02:00
Greg Landrum
8eb02b8bed switch to C++20 (#8039)
* c++20 builds working

* get MolStandardize building with clang19

* get FMCS building with clang-19

* set cxx version to c++20

* remove a few more compiler warnings

* bump min boost version, CI cleanup

* boost 1.81 is not available from conda-forge

* remove unused constants

* bump linux version for CI

* remove another unused variable

* fix (hopefully) cartridge CI builds

* simplify cartridge environment

* try postgresql14 in CI

* start the postgresql service

* change the columns used in the pandastools nbtest

* remove missed merge conflict artifact

* get github4823 test to pass with numpy 2.2

* remove a compiler warning/error with g++13
2025-04-09 11:57:17 +02:00
David Cosgrove
73382748bc Fix indexing of heavy atoms in PubChemShape (#8417)
* Fix indexing of heavy atoms.

* Increment j. Doh!

* Add include guard for the hpp.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-04-08 09:41:46 +02:00
Paolo Tosco
d8dc968eaa Avoid a segfault in CoordGen when a double bond has stereo spec but no stereo atoms (#8415)
* avoid a segfault in CoordGen when a double bond has stereo spec but no stereo atoms

* changes in response to review

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-04-08 09:32:59 +02:00
Paolo Tosco
030bd976de bump MaeParser version to 1.3.2 (enable building without boost::iostreams) (#8404)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-04-02 15:56:14 +02:00
Paolo Tosco
71c4103475 Suppress large amounts of 'BOOST_NO_CXX98_FUNCTION_BASE macro redefined' warnings in clang/emcc builds (#7747) 2025-03-29 20:04:58 +01:00
Greg Landrum
32608ae0b4 Atoms bonded to metal atoms should always have their H counts explicit in SMILES (#8318)
* refactor the code to determine whether or not an atom is in brackets

* move the definition of isMetal to QueryOps

* atoms bound to metals in SMILES should always be in square brackets

Implementation and some test updates

needs confirmation that all of tests run

* basic tests pass

* java tests pass

* update js tests

* doc updates

* Update Code/GraphMol/catch_graphmol.cpp

Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>

* Update Code/GraphMol/SmilesParse/test.cpp

Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>

* finish fixing tests

* bump yaehmop version to allow compilation to work

---------

Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>
2025-03-29 07:26:03 +01:00
Ricardo Rodriguez
55dc5c73e3 fix inchi conversion leak 1 (#8291) 2025-02-24 17:14:38 +01:00
Ricardo Rodriguez
1a67fefcc6 mem fixes (#8276) 2025-02-20 05:59:30 +01:00
Yakov Pechersky
b9f7d4787b When ignoring tetrahedral chirality for inchi, case on degree, not valence (#8266)
Fixes #8238
Fixes #8239
Modification of #8126
2025-02-13 19:14:57 +01:00
Greg Landrum
fa048eacc5 Replace GetImplicitValence() and GetExplicitValence() with GetValence() (#7926) 2025-01-28 21:09:03 +01:00
Rubén Chaves
cf8e7692fa Update InChi links (#8187)
For the user manual https://www.inchi-trust.org/download/104/InChI_UserGuide.pdf can be also used, but is an older one.
2025-01-20 17:20:49 +01:00
Greg Landrum
162fb9a7ec some cmake cleanups (#8171)
* Fixes #8139

* Fixes #8138
2025-01-15 16:19:48 +01:00
Greg Landrum
e6a45a8d17 Fixes two out-of-bounds bugs in the InChI wrapper (#8126) 2024-12-25 21:32:35 +01:00
Greg Landrum
5aed3d886b Fixes #8096 (#8104)
* add test

* Fixes #8096

* change in response to review
2024-12-16 16:59:13 +01:00
Greg Landrum
a4cdf5d21d Fixes #8092 (#8094)
* Fixes #8092
cross-platform file stuff is just soooooo fun

* response to review

* works on windows
2024-12-15 05:58:03 +01:00
Jessica Braun
e66be93f1b fixing the doc string in the shape alignment code (#8040) 2024-11-26 17:13:46 +01:00
Greg Landrum
112fc3e453 improve defaults for the shape-based alignment (#8029) 2024-11-23 03:58:04 +01:00
Greg Landrum
e7b79fe4f9 Fix probe molecule transformation for ShapeAlign (#8016)
* fix output molecule transformation bug

* fix test mistake
2024-11-22 09:23:48 -05:00
Paolo Tosco
614116a398 Make sure that FreeSASA can be built as DLL on Windows (#7985)
* - Make sure that FreeSASA can be built as DLL on Windows (MSVC & MinGW
compilers)
- avoid an unnecessary code patch by using only a .def file for
  exporting symbols

* get the Windows DLL build to work with either MSVC or MinGW compilers
2024-11-20 16:17:11 +01:00
Greg Landrum
cf29f0895f Documentation updates (#7933)
* doc updates

* add rdShapeAlign to the docs

* fix shape docs

* let's not add too much here, revert deprecation

* response to review
2024-10-19 17:19:59 +02:00
Yakov Pechersky
470df8cd2f FindPython Development.Module instead of Development (#7881)
* FindPython Development.Module instead of Development

`Development` grabs `Development.Embed` since CMake 3.18
which is too much, and doesn't work on a manylinux build context

* Set CMake minimum version to 3.18
2024-10-17 08:22:18 +02:00