67 Commits

Author SHA1 Message Date
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
David Cosgrove
dad4d39803 Change docs in Python EmbedMultipleConfs. (#8900)
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-10-28 02:09:14 +01:00
David Cosgrove
dfdddb3fc9 Add extra info about return value. (#8860) 2025-10-10 14:58:20 +02:00
Niels Maeder
686ca3fd6e same docs for same behaviour (#8854) 2025-10-09 04:44:58 +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
Niels Maeder
4f2e61cbd3 expose exceeded timeout (#8816) 2025-09-25 14:07:43 +02:00
David Cosgrove
49995f149c Change default ETversion. (#8414)
* Change default ETversion.

* add an ETDGv2 parameter set

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-05-14 07:42:48 +02:00
Niels Maeder
591748d019 add function to overwrite __setattr__ to only accept valid arguments (#8448) 2025-04-18 05:33:16 +02:00
Niels Maeder
718b0b9000 Expose basinThresh to the python layer (#8283)
* expose basinThresh to the python layer

* docs: add the line about client code

* docs: remove warning
2025-02-20 10:12:17 +01:00
Greg Landrum
2fe7573807 support Ctrl-C in conformer generation (#8197) 2025-01-26 16:03:13 -05:00
Nikitas Rontsis
f20b83bc64 Conformer embedding timeout (#8110)
* Conformer embedding timeout

* Add README for patching

* Don't raise Exception but set EmbedFailureCauses on timeout.

* Fix

* Remove wrongly added README

* Debug segfault

* Improve logging of failures

* Fix pointer reference

* Don't use optional
2025-01-13 10:08:25 +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
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
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
Greg Landrum
9fb7d03960 expose EmbedParameters::coordMap to Python (#7086)
* first pass at allowing setting the coordmap from Python

* plug the memory leak

* implemented tidier coordMap memory management

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-02-06 04:22:49 +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
Greg Landrum
b6361ae684 Change the defaults for the conformer generation to be ETKDGv3 (#6985)
* fix a float comparison in a test

* make ETKDGv3 (i.e. v2 of the torsion parameters) the default.
This should have been done a long time ago.

* change default for onlyHeavyAtomsForRMS too

* release notes update
2023-12-19 04:25:55 +01:00
Paolo Tosco
2b4202867e Add Python modules to generate stubs and automatically patch docstrings (#6919)
* - added gen_rdkit_stubs Python module to generate rdkit-stubs
- added patch_rdkit_docstrings Python module to patch existing C++ sources to fix docstrings missing self parameter and add named parameters taken from C++ signatures where possible
- added rdkit-stubs/CMakeLists.txt to build rdkit-stubs as part of the RDKit build
- added an option to CMakeLists.txt to enable building rdkit-stubs as part of the RDKit build (defaults to OFF)

* fixed CMakeLists.txt, rdkit-stubs/CMakeLists.txt and a doctest

* - added missing cmp_func parameter
- fixed case with overloads with optional parameters
- do not trim params if expected_param_count == -1
- add dummy parameter names if we could not find any
- keep into account member functions when making up parameter names
- address __init__ and make_constructor __init__ functions
- fix incorrectly assigned staticmethods

* patched sources

* address residual few remarks

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2023-11-30 04:54:18 +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
fb1f3def15 expose two missing tags to python (#6372) 2023-05-24 15:39:47 +02:00
Greg Landrum
4eabb532e8 Create getExperimentalTorsions() function (#5969)
* a bit of minor refactoring

* create API function to get experimental torsion bonds

* put the torsion index in the dictionary
in this case it's silly to return tuples to python

* allow passing an EmbedParameters object from python

* capture the torsion index too

* add an atomIndices component
we should typedef the torsionBonds type

* test torsion index

* changers in response to review

* changes in response to review

* fix merge mistake
2023-01-25 12:15:04 +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
Jeff van Santen
73d0d82664 fix: rdkit.Chem.rdDistGeom.EmbedMultipleConfs docstring indentation (#5404) 2022-07-06 06:21:36 +02:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
hjuinj
8857bf8a69 Add custom distance bounds parameter for ETKDG conformer generation (#4516)
* add custom parameter  to tune the relative weights of distance bounds to all the other force terms during ETKDG conformer generation

* fixes as per reviewer comments
2021-09-16 12:32:10 +02:00
Greg Landrum
491fef231a DistanceGeometry: add flag to enforce trans amides (#3794)
* backup

* bug fix: ensure getTotalNumHs() alwasy considers neighbors

* make trans amides the default
ensure it works
cleanup expected tests

* note results-changing fix

* fix docs and run some clang-format

* cleanup in response to review
2021-03-01 13:26:28 +01:00
Greg Landrum
9d4ac580d6 Confgen: add option to use symmetry when doing RMS pruning (#3813)
* add symmetry for RMS pruning during conf gen

* a bit of cleanup

* get the python tests working too
2021-02-24 08:27:47 +01:00
hjuinj
666df68e5b correct handling of amide distances for macrocycles (#3559)
* patch correct handling of amide distances for macrocycles

* higher delta for test
2020-11-24 05:03:00 +01:00
hjuinj
acdfe26dea Improve Conformational Sampling of Small and Large Ring Molecules (#2999)
* improvements for smal anr large ring conformer generation

* add documentation and reorder parameters in EmbedParam

* resolve merge conflict due to coordMap null pointer

* minor changes to address merge comments

* reorder variables in EmbedParameters

* add regression test for small ring and macrocycle torsion preferences

* not apply small ring torsions to bridged ring systems

* fix and test for bridged small rings torsion pattern exclusion

* add ETKDGv3 and srETKDGv3 option to keep compatiblity for original ETKDG

* EKTDG version 3 related minor fix

* add reference to doc string

* Java wrapper for ETKDGv3

* fix doc

* change CPCI to shared_ptr, but it seems to be much slower

* minor modifications to small bridged ring systems, and share_ptr from previous commit is fine

* rollback from shared_ptr(map) to just map

* run clang-format

Co-authored-by: Shuzhe Wang <shuwang@eu-login-10.euler.ethz.ch>
Co-authored-by: Shuzhe Wang <shuwang@eu-login-14.euler.ethz.ch>
Co-authored-by: Shuzhe Wang <shuwang@eu-login-17.euler.ethz.ch>
Co-authored-by: Shuzhe Wang <shuwang@eu-login-45.euler.ethz.ch>
Co-authored-by: Shuzhe Wang <shuwang@eu-login-05.euler.ethz.ch>
Co-authored-by: Shuzhe Wang <shuwang@eu-login-15.euler.ethz.ch>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2020-03-23 14:57:46 +01:00
Greg Landrum
d41752d558 run clang-tidy with readability-braces-around-statements (#2899)
* run clang-tidy with readability-braces-around-statements
clang-format the results
clean up all the parts that clang-tidy-8 broke

* fix problem on windows
2020-01-25 14:19:32 +01:00
Eisuke Kawashima
5cd27a242f Fix typo (#2862)
* Fix typo

* Reflect the comments

* Fix more typos
2019-12-31 06:43:27 +01:00
Greg Landrum
116cebf385 Allow providing a bounds matrix to EmbedMol (#2560)
* Support providing a distance matrix for molecule embedding

* a bit of parameter checking

* allow fragmentation before embedding to be disabled

* fix a build problem on windows
change in response to review
2019-07-30 06:43:42 -04:00
Greg Landrum
1be160baaa Fixes #2057 (#2091)
* Fixes #2057
docs still need to be updated

* docs update

* Update getting started doc.
This still needs to have the doctests run and should probably be
proofread and tweaked

* some doc updates

* change in response to review
2018-10-05 08:18:44 -04:00
Greg Landrum
0f74b0f0be Fixes #1763 (#1765)
rename that test too
2018-03-09 08:38:26 -05:00
Brian Cole
360421e2a8 Make sure EmbedMultipleConfs is deterministic for very large seeds and a seed of 0 (#1635)
* Make sure EmbedMultipleConfs is deterministic for very large seeds and a seed of 0.

Fixing two distinct bugs:

- A randomSeed of 0 didn't use '0' as the seed even though the
  documentation said that it should.

- Very large seeds could overflow the 'int' representation during
  calculation of a new internal seed. This would make
  EmbedMultipleConfs non-deterministic even though the user provided a
  valid seed.

* Adding a C++ test for case pull request #1635.
2017-11-15 06:53:42 +01:00
sriniker
a14f853e56 Version 2 of ETKDG (#1597)
* version 2 of ETKDG

* setting default and changing to unsigned int

* ETversion 2 only via EmbedParams available

* Some refactoring so that the DG functions that take the parameter object are the primaries.
This should allow new parameters to be added without having to modify the API

* test and wrapper changes to go along with that

* update cookbook to use etkdg
2017-11-15 06:50:39 +01:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +02:00
Greg Landrum
e9eb89e4b1 Fix #1227 (#1393)
* Fixes #1227

* make only heavy atoms the default with the pre-defined param sets; this may not be the right answer
2017-04-09 10:20:41 -07:00
Greg Landrum
49bbd95532 Fixes #1385 (#1386) 2017-03-29 08:05:05 +02:00
Greg Landrum
bada20dbaf Expose new default parameter objects to python (#1150)
* Fix a bug in the python DistGeom tests.

* test new features

* add simple parameter objects for ETDG, ETKDG, and KDG

* Update conformation generation documentation to use the new parameter objects.
2016-11-06 10:17:47 +01:00
Greg Landrum
4315388f77 Add a parameters structure for controlling the embedding options. (#1121)
* initial version; no actual testing yet

* start on tests

* rename seed->randomSeed; add tests

* add support in java wrapper

* add support in python wrapper

* initial version; no actual testing yet

* start on tests

* rename seed->randomSeed; add tests

* add support in java wrapper

* add support in python wrapper

* yapf

* document the parameter object;
introduce pre-defined const objects for ETDG, ETKDG, and KDG

* this is why we write tests

* swig did not like the initialization in the header file
2016-11-01 11:39:03 +01:00
Greg Landrum
581d852c99 clean up a couple of missed files 2015-12-03 06:01:09 +01:00
Greg Landrum
79e1f8b1fa compiles without numpy warnings, all tests pass on ubuntu 15.04 with numpy 1.10 2015-11-28 06:49:34 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
5618819c64 merge #641 2015-11-14 05:03:24 +01:00
Sereina
687b464e91 small fixes 2015-10-20 17:04:54 +02:00
Sereina
9cf706b581 enforceChirality flag added back 2015-10-20 15:04:13 +02:00
Sereina
ac7ef34f05 ETKDG implementation 2015-10-20 13:51:43 +02:00
Brian Kelley
403a3d6b7c Suppresses Boost warnings 2015-10-18 13:41:03 -04:00
Sereina
f28ebaf448 chirality test added and flag for them introduced 2015-09-29 11:30:54 +02:00