Commit Graph

5714 Commits

Author SHA1 Message Date
Greg Landrum
914ae0a23a Fixes #9117 (#9131) 2026-02-27 04:54:14 +01:00
Rachel Walker
6964d9a6e5 Fix modern stereo performance issue for large structures (#9100) 2026-02-27 04:54:02 +01:00
Ricardo Rodriguez
0ef40d40a6 Exclude Zero order bonds from FindRingFamilies() and add arguments for includeDativeBonds, includeHydrogenBonds (#9118) 2026-02-26 17:21:48 +01:00
Yakov Pechersky
676c0ce599 when shifting double bonds in tautomerization, set double bond stereo to STEREOANY (#9119)
* when shifting double bonds in tautomerization, set double bond stereo to STEREOANY

fixes #9102

notably, do this only to non-ring bonds
move tests over to assert this
avoid index-based bond lookup in test assertions
since bond indexing can move in tautomers

* inchi unittest check

* fast rings
2026-02-26 17:21:34 +01:00
Lauriane Jacot-Descombes
2a7197e9ce Add valence 1 as possible option for sulfur (#9120)
* Add valence 1 as possible option for sulfur

* Add test for DetermineBonds on thiolates
2026-02-26 17:20:56 +01:00
Greg Landrum
b4f54e34cc swap zlib download to use github (#9123) 2026-02-26 17:20:23 +01:00
Paul Pillot
4b44e41544 Cannot build JS bindings with MCS option enabled. (#9110)
* Cannot push_back std::string to boost json array

`boost::json::array.push_back` expects a `value`

* prefer emplace_back to avoid casting

* Ensure every MINIMAL_LIB option is tested in CI

Also remove Chemdraw support from the compilation. This does not change the final size of the output (not exported anyways) but it reduces the compilation time by 1 min (-10% on my local machine)

* Expose MMPA with other options

* Fix MMPA compilation: Implicitly binding raw pointers is illegal

Applying same pattern as in `get_frags_helper`
2026-02-26 16:54:25 +01:00
Ricardo Rodriguez
0563b59bba Further refactoring in SSSR finding (#9104)
* use queues instead of sets for trimBonds

* skip 2 last atoms: if these were in rings, we'd have already noticed

* refactor duplicate detection in findRingsD2nodes

* make smallestRingsBfs a free function

* move things around

* fix paper reference; fix other comments
2026-02-26 16:54:10 +01:00
Ricardo Rodriguez
848c970e9f Modernize loops and clean up ring finding (#9098) 2026-02-26 16:53:45 +01:00
Eisuke Kawashima
112bb25f08 style: apply readability-braces-around-statements (#8136)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-02-26 16:52:56 +01:00
Jessica Braun
adb4e15579 Fix SMARTS for the strict definition of rotatable bonds (#9096) 2026-02-26 16:52:39 +01:00
Greg Landrum
bf159fbb37 fix the python docs for CanonicalRankAtomsInFragment (#9087)
some clang-format reformatting of rdmolfiles.cpp also is in here
2026-02-26 16:52:26 +01:00
Ricardo Rodriguez
d41837ab39 The precondition in Bond::getOtherAtomIdx() is redundant (#9092) 2026-02-26 16:52:02 +01:00
Brian Kelley
c5f1a9d1f1 Don't silently ignore missing or extra atoms/bonds in copyMolSubset (#9089)
* Don't silent ignore missing atoms (and replace them with atom #0) in copymolsubet

* Fail if explicitly set atoms/bonds are not present

* Add tests

* Simplify optimization (copy whole molecule) add test for no bonds
2026-02-26 16:51:33 +01:00
Ricardo Rodriguez
a64b3647f9 Another canonicalization fix (#9082)
* update canonicalization test

* fix
2026-02-26 16:50:56 +01:00
Greg Landrum
3444408692 Get things working with numpy 2.4 and pandas 3.0 (#9072)
* get BertzCT working with numpy 2.4

* test pass with with Pandas 3.0
(on windows at least)

* update testRanker too

* update nb test

* run win32 CI tests with different pandas versions
also updates boost version

* works with pandas 2.0?

* update linux_build_py311 -> linux_build_py312
test both old and new pandas

can't go higher with the python version yet because the older pandas and numpy are not available.

* doctest fix?

---------

Co-authored-by: = <=>
2026-02-26 16:50:40 +01:00
tadhurst-cdd
f6a8017d08 cleanup of stereogroups and wedges for non-chiral sites (#9051)
* cleanup of stereogroups and wedges for non-chiral sites

* fixed testShapeHelpers for Arm64 build

* reorg the tests a bit

* rename and document option

* add to the python wrappers

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2026-01-30 05:13:14 +01:00
Ricardo Rodriguez
e4aea17755 Store CIP-ranked anchors after CIP labeling. (#9056)
* add the _CIPNeighborRanks property

* store CIP-ranked chiral neighbors

* store CIP-ranked SP2 bond and atropisomer anchors

* add a test

* boost headers in test

* add Atom::NOATOM

* add NOATOM test

* amend and clarify implicit H in Tetrahedral

* rename property

* rename property to _CIPNeighborOrder

* deprecate Chirality::StereoInfo::NOATOM
2026-01-30 05:12:46 +01:00
Greg Landrum
f0f80b926c Fixes #8997 (#9060)
I checked isostar to confirm that the degree-three aromatic N in the pyrrole and pyridone are not acceptors
2026-01-30 05:05:26 +01:00
tadhurst-cdd
47db3a6df8 Handle chiral atoms with 2 hydrogens in SCSR parser (#8939)
* added flag to allow chiral settings on Atoms with 2 hydrogens for SCSR treatment

* added parameter to allow chiral 2Hs on template mols in SCSR parser

* fixed testShapeHelpers for arm64 build

* Remove checking for two Hs in chiral atom in atomChiralTypeFromBondDirPseudo3D

* removal of flag for allow2Hs

* remove setup.bat file
2026-01-30 05:05:05 +01:00
Ricardo Rodriguez
e985761118 CXSMILES: do not add separators for unserializable Substance Groups (#9048)
* do not write extra separators

* add a test

* update tests

* Update Code/GraphMol/SmilesParse/CXSmilesOps.cpp

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2026-01-30 05:04:46 +01:00
Ricardo Rodriguez
e13651e0a4 Fix removing (non)redundant bond dir specs when exporting SMILES (#9066)
* increase counts to avoid removing non-redundant bond dirs

* update tests
2026-01-30 05:04:32 +01:00
David Cosgrove
b15a21a0c7 Transform::SetRotationFromQuaternion takes const. (#9063) 2026-01-30 05:04:11 +01:00
Greg Landrum
a6e1242e0c Move some more tests over to catch2 (#9058)
* move testSubstructMatch to catch2

* modernization

* modernization

* switch to catch2

* modernize

* convert to catch2

* update

* move to catch

* please be quiet

* move to catch2

* changes in response to review

---------

Co-authored-by: = <=>
2026-01-30 05:03:57 +01:00
Ricardo Rodriguez
0402ea6792 implement hasPrimaryLabel (#9052) 2026-01-30 05:03:42 +01:00
Chris Von Bargen
03074d3b6e Fix deprecated literal operators and macro redefinition warnings for modern compilers (#9055)
* Fix deprecated literal operator syntax for C++14 compliance

Remove whitespace between "" and identifier in user-defined literal
operators to comply with C++14 standard. Fixes warnings with newer
compilers (emscripten 4.0+, clang 15+) that treat this as deprecated.

Changed operator"" _name to operator""_name for:
- SmilesParse.h: _smiles, _smarts
- ReactionParser.h: _rxnsmarts, _rxnsmiles
- FileParsers.h: _ctab, _mol2, _pdb

* Fix BOOST_CONTAINER_NO_LIB macro redefinition warnings

Add #ifndef guards before defining BOOST_CONTAINER_NO_LIB in Writer.cpp
and Parser.cpp to avoid redefinition warnings when the macro is already
defined via compiler flags in emscripten 4.0+ builds.

Warnings fixed:
- Writer.cpp:32: 'BOOST_CONTAINER_NO_LIB' macro redefined
- Parser.cpp:38: 'BOOST_CONTAINER_NO_LIB' macro redefined
2026-01-30 05:03:29 +01:00
Philip Ullmann
60ca459c19 Update deprecation messages for valence methods (#9050) 2026-01-30 05:03:12 +01:00
tadhurst-cdd
edc43a0212 added FABS to test for issue #4364 (#9053) 2026-01-30 05:02:47 +01:00
Raul Sofia
b1ddbfc41b Performance improvement: Implement buffered reading for SDMolSupplier (#9010) 2026-01-30 05:02:33 +01:00
Ricardo Rodriguez
e536234a41 Read SD property names till the last '>' (#9047)
* add a test

* fix
2026-01-30 05:02:08 +01:00
Yakov Pechersky
2f26e34c25 MolAlign: brace-init BestAlignmentParams in wrapper (#9042)
BestAlignmentParams is an aggregate; paren-init (T(...)) is rejected by Apple Clang (Xcode) and only works on some compilers.
Use brace-init (T{...}) for portable initialization.
2026-01-30 05:01:53 +01:00
Greg Landrum
04901e7824 Allow molzip to position fragments when joining them (#9021)
* move molzip to its own file

* basics working

* more testing

* another test

* minor

* fix doxygen comment format

* fix alignment with co-directional exit vectors;
some modernization

* JSON parsing
python wrapper

* response to review

* response to review

* explicitly test that the first frag does not move

---------

Co-authored-by: = <=>
2026-01-30 05:01:14 +01:00
Brian Kelley
56903b0df6 Check for correctly sized propertylists to avoid dropping molecules (#8921)
* Fixes #8918

* Use only the one check for compatible sizes

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2026-01-30 05:00:55 +01:00
David Cosgrove
96779f2a07 In verbose output, check that the query molecule exists before using it. (#9040)
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2026-01-30 05:00:55 +01:00
Greg Landrum
25ce3f3602 Fixes #9020 (#9025)
* Fixes #9020

* add another test

---------

Co-authored-by: = <=>
2026-01-30 05:00:55 +01:00
Greg Landrum
6ee39bd992 Fixes #9033 (#9036)
Also fixes the other similarity metrics.
A very small amount of refactoring

Co-authored-by: = <=>
2026-01-30 05:00:05 +01:00
David Cosgrove
4a007d4a7a Github9007 (#9022) 2025-12-30 07:27:02 +01:00
David Cosgrove
7293070a49 Better solid triangles (#8943)
* Change the way solid wedges are drawn to use larger polygons.

* Better variable name.
2025-12-30 07:26:27 +01:00
Yakov Pechersky
edbb86d1b3 atropisomer bond atoms are checked explicitly for SP2 hybridization (#8974)
* atropisomer bond atoms are checked explicitly for SP2 hybridization

before, we checked only on totalDegree = 2 or 3,
but this causes false positives for something like a chiral sulfoxide
since the S is tetrahedral (sp3) but has only 3 substituents.
the hybridization code relies on totalDegree,
but modified to include and making sure to include conjugation
so while this is more expensive per molecule, it is closer to intent

Closes #8973

* assert we got no warnings on sulfinamides

* cleanup

* bring back degree based check, quick pass so that we don't run expensive calc on all mols with wedge bonds

* bring conformer back
2025-12-30 07:25:55 +01:00
tadhurst-cdd
374d3a8143 Allow spaces and special chars in SCSR fullname attrs (#8982) 2025-12-30 07:25:07 +01:00
Ricardo Rodriguez
b381491432 Some more cleaning up in SMILES Writing (#8991)
* refactor getting initial bond directions

* fix atom dir counts

* move lambdas to separate functions

* restore increments

These are ok: they mean how many double bonds care about this direction,
not just whether it has been set or not.
2025-12-30 07:24:50 +01:00
Greg Landrum
13c603990f Support serializing/deserializing FP generators to JSON (#9000) 2025-12-30 07:24:36 +01:00
Ricardo Rodriguez
288a3ff919 Fixes #9014 (#9016)
* add a test

* add a fix
2025-12-30 07:24:17 +01:00
Greg Landrum
9201881de6 move molzip to its own file (#9013) 2025-12-30 07:23:47 +01:00
Ricardo Rodriguez
3677e70af0 Convert testMolSupplier to catch2 (#9015)
* update CMake file

* convert to catch
2025-12-30 07:23:32 +01:00
David Cosgrove
b81004602a Fixes Github9009 (#9012)
* Mostly working.

* Clear out debugging writes.

* Avoid a mol copy.

* Left some debugging in.

* Move the fix into fragmentOnBonds.

* Add test.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-12-30 07:22:52 +01:00
David Cosgrove
4c3a8ccfd0 Shape overlay initial start aligned to principal axes (#8999)
* Add MolTransforms library.

* Transform to inertial frame of reference before overlay.

* Vital fix of typo in comment.

* Tidy up debugging cruft.

* Comment in CMakeLists.txt.

* Fix python wrappers.

* Extra tidy.

* Response to review.

* Tidy includes.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-12-30 07:22:25 +01:00
Greg Landrum
1c0d063278 A bunch of modernization of the ShapeHelpers code (#8954)
* modernize testShapeHelpers

* a bunch of modernization of the shape helper code
2025-12-30 07:21:28 +01:00
Ricardo Rodriguez
2bcb51c510 Last leak fixes for 2025! (#9006)
* fix leaked atom on zero chiral permutation

* take bond ownership
2025-12-30 07:21:03 +01:00
Ricardo Rodriguez
0199b62742 convert smiTest1 to catch (#9004) 2025-12-30 07:20:43 +01:00