9 Commits

Author SHA1 Message Date
Yakov Pechersky
0986d22c58 Deterministic kekulize, independent of atom and bond order (#9125)
* Make kekulization deterministic

* Add tautomer order-independence regression (python)

* Adjust tautomer tests for deterministic kekulization

* Update graphmol wedged-bond kekulization checks

* SmilesParse: update aromatic bond index expectations

* SmilesParse: refresh cxsmilesTest expected files

* Depictor: update testDepictor expected MolBlocks

* Depictor: update depictorCatch expectations

* Depictor Wrap: update expected MolBlock for pyDepictor

* MarvinParse: update testMrvToMol expected outputs

* FileParsers: refresh testAtropisomers expected outputs

* FileParsers: update tests for deterministic kekulization

* MolDraw2D: refresh brittle bond assertions

* RascalMCES: update expected cluster size

* MinimalLib: make cffi wedging check order-independent

* documentation fix

* MinimalLib: update Kekulé bond table in aligned-coords test

* Hoist duplicated lambdas to TEST_CASE scope

* Remove unused originalWedges variable

* Remove redundant bounds check; clarify wedge-end preference

* Pre-sort allAtms by wedge-end + rank

* Use mol.atomNeighbors() for neighbor iteration

* Check inAllAtms before linear-scanning done

* Drop redundant optsV/wedgedOptsV sorts

* Remove unused Canon.h include

* Add canonical parameter to Kekulize; skip ranking during sanitization

* Test canonical re-kekulization preserves stereo across atom orderings

* MinimalLib: update Kekulé bond orders in invertedWedges

* Change Kekulize canonical default to false, expose in Python wrappers

* keep rank order, push_back

* Revert "RascalMCES: update expected cluster size"

This reverts commit a81bb39495.

* docstring change

* expose new flag to python wrapper

* document changes in ReleaseNotes.md

* revert minimallib test changes again

* canonical = true defaults

* Revert "revert minimallib test changes again"

This reverts commit 039e1d84da.

* Reapply "RascalMCES: update expected cluster size"

This reverts commit 7b83a7a3e8.

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2026-03-19 08:43:13 +01:00
Yakov Pechersky
08552e56b1 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-29 18:04:40 +01:00
tadhurst-cdd
bebd2ebbce Fix for removing bad stereo indications from Atropisomer parsing (#7984)
* Fix for removing bad stereo indications

* removed one unneed change

* removed mistaken change
2024-12-22 04:47:18 +01:00
tadhurst-cdd
c2168cd8be Fix for kekuleAtrop wedge error (#7992)
* Fix for kekuleAtrop error

* Consolodate repeating code in new tests

* as per PR review - simplification
2024-11-15 04:39:38 +01:00
Greg Landrum
da6cd73168 Run clang-format across everything (#7849)
* run clang-format-18 across Code/*.cpp and Code/*.h

* run clang-format-18 across External
2024-09-26 13:39:02 +02:00
Yakov Pechersky
c25abde7cf Include macrocycles in atropisomer calculation by not sanitizing them away (#7291)
* Include macrocycles in atropisomer calculation

Previously, atropisomeric bonds were sanitized away if they were part of a "ring bond", which happens in macrocyclic systems.
None of the existing test cases fail if that sanitization check is removed.
The sanitization step is removed to support biaryls that are part of a larger macrocyclic system.
A set of test cases is included that cover potential macrocyclic atropisomeric systems

* Remove unmentioned files

* Keep ring check, and narrow it to when bond is in as many rings as atoms

* exclude atropisomer bonds if in rings < 8 atoms

Co-authored-by: tadhurst-cdd <112502803+tadhurst-cdd@users.noreply.github.com>

* Clarify macrocycle behavior in RDKit book

* fix typo

---------

Co-authored-by: tadhurst-cdd <112502803+tadhurst-cdd@users.noreply.github.com>
2024-04-09 06:05:25 +02:00
tadhurst-cdd
7412566a27 Wedge bond from atrop error (#7321)
* changed string_view to string in catch test

* fix bug in atrop wedge determination

* reverted changes from string_view to string
2024-04-03 15:35:42 +02:00
tadhurst-cdd
73b4da2a44 New tests for specical query atoms and atropisomers (#7010)
* New tests for speical query atoms and atropisomers

* fixed error, and used unique_ptrs

* Removed test that makes GraphMol depend on GenericGroups

* More to remove GraphMol dependency on GenericGroups
2024-01-11 05:54:14 +01:00
tadhurst-cdd
d5d4d194ec atropisomer handling added (#6903)
* atropisomer handling added

* fixed non-used variables,  linking directives

* BOOST LIB start/stop fixes, linking fix

* Fixes for RDKIT CI errors

* minimalLib fix

* changed vector<enum> for java builds

* check for extra chars in CIP labeling

* removed wrong deprecated message

* fix ostrstream output error?

* restored _ChiralAtomRank to lowercase first letter

* changes for merged master

* Fixed catch label for new Catch package

* update expected psql results

* get swig wrappers building

* restore MolFileStereochem to FileParsers

* fix java wrapper for reapplyMolBlockWedging

* some suggestions

* move a couple functions out of Bond

* Merge branch 'master' into pr/atropisomers2

* merged master

* Renamed setStereoanyFromSquiggleBond

* atropisomers in cdxml, rationalize atrop wedging, stereoGroups in drawMol

* fix for CI build

* attempt to fix java build in CI

* attempt to fix java build in CI #2

* New routine to remove non-explicit  3D-geneated chirality

* changed to use pair for atrop atoms and related bonds

* Changes as per PR reviews

* PR review respnses

* PR review reponse - more

* Fix merge from master

* fixing java ci after merge

* Updated the help doc for atripisomers

* update the atropisomer docs

* improve the images

* add the source CXSMILES

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-12-22 04:58:18 +01:00