41 Commits

Author SHA1 Message Date
Ricardo Rodriguez
9e301c15d6 Normalize rings (#9208)
* normalize rings

* update tests

* update doctests

* update release notes
2026-04-01 05:37:02 +02:00
Greg Landrum
9d1b988799 Fixes #9143 (#9195)
* Fixes #9143
There is still some weirdness in the matching of ET bonds in macrocycles, but it is not connected to this change.

* adjust test to work on win (and mac?)

* tweak expected results for win ci
2026-03-24 10:03:02 +01:00
Katharina Buchthal
f7a3f044ff Adjust lower bounds to allow intramolecular H-Bonds (#9188)
* added test case

* implemented lower bounds of potential h-bonds

* suggested changes

---------

Co-authored-by: Katharina Buchthal <katharina.buchthal@phys.chem.ethz.ch>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2026-03-20 04:36:28 +01:00
Katharina Buchthal
c5de9f8843 Fix issue 9165 & 9166 (#9184)
* added *S-S* and bounds overwriting tests

* fixed *S-S*

* added bounds overwriting test

* searching for the bug

* added test case

* improved tests + fixed bug 9166

* updated ref mols

* regenerated refs

* clean up

* changed ref data

* removed print statements

* Update Code/GraphMol/DistGeomHelpers/BoundsMatrixBuilder.cpp

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

* Typo

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

* Incooperated suggestions

* applied remaining suggestions

* restored imports

---------

Co-authored-by: Katharina Buchthal <katharina.buchthal@phys.chem.ethz.ch>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2026-03-19 16:47:04 +01:00
Greg Landrum
af4e6c05ec strip whitespace from embedParametersToJSON() (#8989)
* strip whitespace from embedParametersToJSON()

* update expected results in python tests

---------

Co-authored-by: = <=>
2025-12-04 06:57:08 +01:00
Niels Maeder
bc4fffda7b Embed Parameters to JSON (#8977)
* add function to convert embedParams to json

* add catch test

* add function to python wrapper

* test python function

* update copyright

* undo formatting and cleanup

* more cleanup

* remove the map flag and added round trip

* add bounds mat output

* run clang-format
2025-11-29 05:19:44 +01:00
tadhurst-cdd
f00a8cbb4c ScsrHbondMrvError (#8646)
* fix MRV for Hbonds

* add test file

* add test file

* enforce chirality in DistGeom catch test

* Added test for correct hbond retention

* removed debug print statement

* retrigger checks

* testing  java AromaticTests

* testing java aromaticTests

* removed testing code
2025-09-29 17:30:50 +02:00
Niels Maeder
5b1d04d23e Fix grad scaling (#8791)
* fix grad

* adapt tests to pass with fix

---------

Co-authored-by: Niels Maeder <maedern@ethz.ch>
2025-09-21 18:19:50 +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
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
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
Greg Landrum
86141183c1 Moving towards getting all tests to pass when using the new stereo code (#8409)
* Fixes #8379

* check in some working tests

* test passes

* test passes

* test passes

* test passes

* test passes

* ensure that the invariants flush the streams on failure

* tests pass

* test passes

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* Fixes #8391

* tests pass

* fix a test with legacy
not clear why this was not causing problems before

* make a test work

* Fixes #8396

* gcc builds work

* fingerprint tests pass

* mention backwards incompatible change

* fix a problem with FindMolChiralCenters

* more testing details

* enable the test status output

* Fixes #8432

fix a bug in double-bond stereo handling for template matching

* all depictor tests pass

* use the new-stereo chiral ranks in the depiction code

* always assign new-stereo chiral ranks

* make _ChiralAtomRank a computed property
This is analogous to _CIPRank

* tweak to the way the atom ordering is computed for 2D coordinate generation

* update two expected results

* backup

* response to review

* tests pass

* tests pass

---------

Co-authored-by: = <=>
2025-04-15 14:00:32 +02:00
Greg Landrum
c7169eb17c Fixes #8250 (#8254) 2025-02-10 10:04:26 -05:00
Greg Landrum
2fe7573807 support Ctrl-C in conformer generation (#8197) 2025-01-26 16:03:13 -05:00
tadhurst-cdd
7474d2b603 relax two tolerances for ARM64 builds (#8148) 2025-01-09 07:19:36 +01:00
Greg Landrum
7872341b92 fixes #8001 (#8002) 2024-11-14 05:14:51 +01:00
John Mayfield
2553cfce73 Improved handling of SP/TB/OH reording in SMILES/SMARTS. (#6777)
* Improved handling of SP/TB/OH reording in SMILES/SMARTS.

- add a getMaxNbors(tag) utility function to avoid repeated logic in multiple places
- tweak getChiralPermutation() for handling implicit/missing ligands (uses -1), allow inverse lookup
- use the tweaked chiral ordering in the reading/writing from SMILES

* clang-format run

* Reviewer requested changes.
- curly braces on all if conditions
- null check raw pointers with precondition.

* Correct additional test case introduced in the last year
2024-10-21 04:55:08 +02: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
nmaeder
168b111fe3 Ensure 13 bounds constraints are added to angles that are part of an improper torsion (#7729)
* make sure 13 bounds constraints are added to angles that are part of an impropper torsion

* make sure angles are constrained with higher force constant to prevent rings from folding

* adapt tests to new behavior

* move comment to correct place

* add min bounds test

* make sure we are not terribly outside of the bounds matrix
2024-08-21 16:06:29 +02:00
nmaeder
6675315b85 Fix/kminimization (#7535)
* first try

* do over with @greglandrum: fix atomPairs, lower SP angle force constant.

* change test file for 'update parameters from JSON':'ETKDGv2'

* adapt length to fix

* remove overwritten random seed

* adapt test files to changes

* adapt amide test, check with Greg

* fix python tests and remove unused imports

* proposal for new test molecule

* remove double comparison, increase threshold. Check with greg

* remove TODO comments

* remove debugging statements

* same code for both since they are doing the same

* format docstring to make more readable

* remove todo comments

* add indentation to angle param

* adapt doctest to newly generated conformers

* fix test to pass with fewer failures and move mol to mol file for less cluttered test.

* a bit of modernization

* remove cerrs and format correcly

* reverted test to old behavior

* use insert and make force field contribs exception safe

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-07-08 15:29:45 +02:00
Greg Landrum
df0224fb7d Fixes #7552 (#7564)
* Fixes #7552

* Change in response to review

* suppress a warning
2024-06-26 04:42:33 +02:00
Greg Landrum
c0eaba0c3f ConfGen: fix a logic error in one of the chiral volume tests (#7560)
* fix a logic error in one of the chiral volume tests

* check the magnitude of the chiral volume in the atropisomer tests

* make the espression more readable

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-06-26 04:41:07 +02:00
Greg Landrum
81af0dbd63 add option to symmetrize conjugated terminal groups when RMS pruning conformers (#7270)
* expose symmetrizeTerminalAtoms() to the public API

* support symmetrizing terminal groups in RMS pruning in confgen

* add that to the python wrapper

* add backwards compatibility note

* allow JSON config of the new option
2024-03-19 04:38:29 +01:00
Greg Landrum
6f3275f927 Fixes #7181 (#7206)
* Fixes #7181

adds a new constrainedAtoms member to the etkdgdetails structure which is used to propagate info about the coordMap into the ETK minimizations

* Update Code/DistGeom/DistGeomUtils.cpp

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

* Update Code/DistGeom/DistGeomUtils.cpp

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

---------

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2024-03-12 04:47:22 +01:00
Greg Landrum
6bede685e0 Support atropisomers in the conformer generator (#7098)
* change a define to a "using"

* basic atropiosomer support for confgen

currently only supports bonds with two exo substituents on each end

* support systems with two exo bonds

* cleanup

* add test for #7109

Fixes #7109

* clean the tests up a bit
2024-02-06 15:48:25 +01:00
Franz Waibl
de67212fcd Update distance bounds calculation for conjugated double bonds in macrocycles (#7032)
* Fix macrocycle bounds calculation, and make it accessible from Python

* Previously, C=C([#1])-C([#1])=C groups in a macrocycle were always
  cis. Although the bounds within the group allowed cis or trans, the
  1-4 bounds of the H atoms were always set to trans, which forces the
  carbons into the cis position. This change fixes this behavior to
  allow cis or trans conformations
* Previously, the useMacrocycle14config flag could only be used from
  Python by creating an ETKDGv3 object, and defaulted to False
  otherwise. This change adds the flag to EmbedMolecule,
  EmbedMultipleConfs, and the EmbedParameters Python interface.
* The new default for useMacrocycle14config is True to be consistent
  with the default for useMacrocycleTorsions. Since the old default was
  False, this could change the output of existing scripts.

* Add test case for updated macrocycle distance bounds

* Remove 2 unused variables

* Fix a python test that set .seed instead of .randomSeed on an ETKDGv3

---------

Co-authored-by: Franz Waibl <waiblfranz@gmail.com>
2024-01-17 08:42:09 +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
Greg Landrum
2957ab4576 switch to catch2 v3 (#6898)
* switch to catch2 v3
Fixes #6894

* fix a couple of problems noticed in the CI builds

* more warning cleanup

* changes in response to review
2023-11-15 06:45:42 +01:00
Greg Landrum
ec8e637ecd add option to use sequential random seeds in the conformer generator (#6639) 2023-08-19 19:19:56 +02:00
Greg Landrum
c4842af414 Fixes #5145 (#6379) 2023-05-23 17:36:27 +02:00
Greg Landrum
ad92d89d1e Fixes #5883 (#6189)
* Fixes #5883

* add backwards incompatibility comment

* clang-format hates this file
2023-03-14 04:54:15 +01:00
Greg Landrum
0570d3e44f detect bad double bond stereo in conformer generation (#5967)
* fix two problems leading to bad double bond geometries from the conformer generator

* test for violations of double bond stereo in confgen

* some cleanup

* define constants

* better description of the test

* changes in response to review
 - improved docs
 - split linearity check from stereo check
 - always do linearity checks
also: track double-bond stereo failures
2023-01-25 15:51:59 +01:00
Greg Landrum
1dc268bf4a Allow the sources of conformer generation failures to be retrieved (#5960)
* support tracking where the conformer generation code fails

* less verbose  output

* tests now pass

* fix a stupid typo

* fix SWIG wrappers

* changes in response to review
2023-01-24 18:09:15 +01:00
Greg Landrum
202fb1e3e7 Fix a problem when generating conformers for molecules with larger heteroatoms in conjugated 5-rings (#5586)
* fixes problem with bound-matrix smoothing

* a bit more cleanup

* more testing

* add some P tests
2022-10-03 10:26:33 +02:00
Greg Landrum
cd74dc2207 Initial support for non-tetrahedral stereochemistry (#5084)
* very basics: actually parsing the new atom stereochem features

* add some input verification for the chiral permutations

* fix a typo
add quadruple bond SMILES/SMARTS extension

* add forgotten files

* patch from Roger

* add Roger's parsing examples

* typo

* new tests

* adjusted version of next PR from Roger:
- add SP2D hybridization for square planar (this may change)
- some modernizationof Chirality.cpp
- stop using < HybridizationType in Chirality.cpp (should probably do this elsewhere too)
- improved handling of hybridization assignment for new stereochem
- handle new stereo/hybridization in UFF
- tests for the above

* perception of non-tetrahedral stereo from 3D (from Roger S)
Basic testing of SP and TB based on opensmiles docs

* potential fixes for octahedral assignment
more tests

* docs update
need way more!

* map the TH tags directly to @ tags

* very basics of SMILES writing
this does not work with anything that changes the permutation order
like canonicalization or writing things in rings.

* start to support the getChiralAcross API

* more testing

* consistency

* add hasNonTetrahedralStereo() and getIdealAngleBetweenLigands()

* assignStereochemistry should only remove non-tetrahedral stereo

* re-simplify those tests

* cleanup matrix stream output

* initial pass at supporting nontet stereo in distgeom

* backup

* start on the reference docs

* TBP reference

* first pass at Oh finished

* update SP section

* more doc updates

* fix a typo

* add param to not remove Hs connected to non-tetrahedral atoms

* VERY basic coord generation for square planar

* TBP basics

* basic OH depiction

* start testing missing ligands
allow non-tet stereo in rings (ugly, but correct)

* add new TBP functions from Roger

* update depiction code for new API

* backup, the new tests work so far

* Finish the TB tests

* OH tests pass too

* cleanup

* first pass at getting correct SMILES with reordering
need way more testing than this

* ensure permutation 0 is correctly preserved

* some progress towards adding non-tetrahedral stereo to StereoInfo

* doc update

* add non-tet chiral classes to python wrappers

* make sure removeAllHs also gets neighbors of non-tetrahedral centers
more testing

* a bit of depictor cleanup

* make the assignment from 3D more tolerant
more testing

* improve the bulk testing

* cleanup

* remove a bit of redundant code

* ensure we don't write bogus permutation values to SMILES

* fix some rebase problems

* allow assignStereochemistryFrom3D() to be called without sanitization

* allow disabling the non-tetrahedral stereo when it's not explicit

* get that working on windows too
2022-05-20 09:07:16 +02:00
Greg Landrum
4144a813ca Fixes #4346 : trans bonds are now properly honored in macrocycles (#4355)
* remove some compile warnings

* Fixes #4346
2021-07-23 20:30:33 +02:00
Greg Landrum
3a82159b57 Cleanup some problems found during an ASAN build (#4054)
* MolFragmenter: fix a leak when exceptions are thrown

* DistGeomHelpers: fix leaks when exceptions are thrown

* SubstructLibrary: fix usage of invalid memory

* clear up leaks found during ASAN testing
2021-04-21 10:22:04 -04:00
Greg Landrum
f829c877d8 MinimalLib: add CFFI interface (#4018)
* hello world works

* more

* more
minimallib needs to be tested

* parse substructure parameters from JSON

* add substruct search and parameters

* add descriptors

* register more descriptors

* fingerprints, first pass

* stop outputting tiny coord vals

* support generating 2d coords

* coordgen testing

* return nulls

* initial 3d support; add/removeHs; cleanup

* Embedding parameters from JSON

* update

* pattern fp, fps as bytes

* use json to configure MFP

* use json to configure rdkit and pattern fps

* aligned 2d coords

* parsing options

* options for writers

* rename remove_hs

* get this working on windows (kind of)

* silence some msvc warnings

* cmake updates

* update python tests

* add the CFFI code to CI builds

* cleanup line ending mess?

* a couple small fixes

* make this work with URF

* support coordMap in the 3D coordinate generation

* updates in response to review
2021-04-15 21:33:52 +02:00
Greg Landrum
a3b6a10c54 revised version of #3894 (#3903)
* backup

* solves the problem

* expand the testing

* document new constant

* changes in response to review
2021-03-09 17:38:06 +01:00
Greg Landrum
e5c4e87633 Revert "ConfGen: Macrocycle torsion terms not being used with fused macrocycles (#3894)" (#3902)
This reverts commit 971e195b5b.
2021-03-09 14:41:43 +01:00
Greg Landrum
971e195b5b ConfGen: Macrocycle torsion terms not being used with fused macrocycles (#3894)
* backup

* solves the problem

* expand the testing

* document new constant
2021-03-09 14:36:12 +01:00