13 Commits

Author SHA1 Message Date
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
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
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
8ea8ec5e3f Fixes #7983 (#8342)
* Fixes #7983

move the call to cleanupAtropisomerStereoGroups() into assignStereochemistry()

* Additional tests from @susanhleung in #8323

* more testing

* changes in response to review

* changes for review
2025-03-20 07:40:33 +01:00
Greg Landrum
fa048eacc5 Replace GetImplicitValence() and GetExplicitValence() with GetValence() (#7926) 2025-01-28 21:09:03 +01:00
tadhurst-cdd
0de215a1f8 Fix canonicalization of stereogroups (#7041)
* 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

* test changes

* 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

* Merge branch 'master' into pr/specialQueries

* changes from previous PR

* Iclude false chiral

* rigorous enhnced stereo canoncalization

* Added more tests and clenup

* removed commented out code

* corrected init of SmilesWriteParams

* added MolFileStereoChem.h to the header files

* Renamed Rxn parser to MrvBlockToChemicalReaction

* To make catch2 work, and match the checksum

* Fixed Structchecker errors

* fix CI for DetermineBonds catch test

* error in catch_test for CI

* Allow custom  smileWriteParams  in GetMolLayers

* misnamed entry point

* ReactionFromMrvString change name

* remove adding writeParams to GetMolLayers

* make rigorous enhanced stereo the default, and fix tests

* only one abs group no longer needs Rigorous Enhanced treatment

* changed string_view to string in catch test

* Canonicalize Enhnaced Stereo only resturne unique smiles

* Now allows or and and groups together

* internal routines inside detail scope

* fix test error

* changed string back to string_view and fixed a CHECK

* Fixes for PR review tests

* Fix RDKit_Book.rst failure on build test

* fix xqm sql test

* updated expected files for cxsmiles_test

* Fixed removal of atom attrs

* Fixed tests after merge of master

* More efficient version of Stereo Groups Canonicalization

* Fixes for ctests

* removed debug code

* readded cipLabel test

* fix generalizedSubstruct/catch_tests.cpp error

* hueristics to improve speed

* Rationaized control of abs groups

* removed unused routine

* added rigorous stereo group treatment to test

* some suggested changes

* Changes per PR review and removed some changes to smiles

* Fixed CI errors

* changes per PR review

* more PR review vhanges and cleanup

* Fixed PSql PKL change

* changes as per PR review

* Restored error type for bad mols for canonicalizeStereoGroups and added a test

* Merge master and fix test in MolDraw2D

* Fix for randomize test error and other PR review comments

* Removed unsued variable to fix mac CI

* do not force aromatization in canonicalizeStereoGroups

* changes as per PR review

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-10-11 17:09:18 +02:00
Ricardo Rodriguez
bedd58e10c Fixes #7367 (#7426)
* make wedgeBondsFromAtropisomers get symm SSSR if not present

* add atropisomer wedging ring info test

* add a test

* update test
2024-05-16 09:24:55 +02:00
Greg Landrum
18d1ff5f8f Prefer wedging ring bonds around atropisomers (#7373)
* prefer wedging ring bonds for atropisomers

* update expected results

* handle 3D as well

* prefer wedging to larger rings

wedging bonds in 5 rings make later attempts at improving kekulization very difficult

update expected results

* extend those changes to 3D

* update tests for those changes

* avoid wedging atropisomers if possible

response to review
2024-05-08 06:04:23 +02:00
tadhurst-cdd
a2b149a806 No coords atropisomers - fix smiles output of atrop wedges after reordering (#7418)
* removed string_view in favor of string for catch test

* add parsing and generation of atropisomers when coords not present

* changed string_view to string in catch test

* more docs

* reformulation of the docs

* make an error message a little bit more useful

* small optimization
clang-format

* add `BondWedgingParameters` to new function

* changes for CIP test errors

* Updated internal doc to match what it does

* changes per PR review

* removed cout statements in tests

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-05-07 17:06:33 +02:00
Greg Landrum
848b57f654 Revert "Support handling atropisomers without coordinates (#7301)" (#7370)
This reverts commit 2159594164.
2024-04-19 06:05:32 +02:00
tadhurst-cdd
2159594164 Support handling atropisomers without coordinates (#7301)
* removed string_view in favor of string for catch test

* add parsing and generation of atropisomers when coords not present

* changed string_view to string in catch test

* more docs

* reformulation of the docs

* make an error message a little bit more useful

* small optimization
clang-format

* add `BondWedgingParameters` to new function

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-04-19 04:38:27 +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
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