Commit Graph

96 Commits

Author SHA1 Message Date
nmaeder
3f3ff3858a Refactor distgeom minimizations (#7652)
* refactor skeleton

* fix contribs

* adapt documentation

* clarify function names

* make variable names more readable and update documentation

* switch boost dynamic bitset with std::vector<bool>

* clearer const name

* fix typo and go back to dynamic bitset

* go back to old function signature

* add inline overload with fewer arguments

* remove unecessary doc lines and add tol to distance directly in function call

* use constexpr for known distance force constant

* update documentation

* enhance documentation

* english

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

* make changes requested by @greglandrum

* make all constexprs

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-07-25 06:14:12 +02:00
Greg Landrum
2c5ae534f2 Optimizations of the DistanceGeometry forcefield (#7600)
* First try at using DistViolationContribs

only the most basic of testing has been done

also add ForceField::distance2 to allow some optimizations

* allow testing using old approach

* optimization

At this point testUFFForceFieldHelpers fails since the check for std::max_element
in the e_contribs vector at Embedder.cpp:513 is now doing something totally different
(instead of a bunch of small distance violation contribs, we have one big one).
We'll need to come up with something for this.

With the benchmarking set that I'm using - 500 DG conformers for ~465 COD molecules
using 10 threads - this runs in almost 10% less time than master.

* backup;
builds, tests do not pass

* all tests pass except the old failure

* more constification

* backup/debugging

* add fourthdim contribs the same way

* tests now pass

* deprecations

* remove unused vars and code

* changes in response to review
2024-07-15 14:14:39 -04: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
5b89586de2 fix a memory overwrite (#7147) 2024-02-07 17:40:41 +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
63c7e85046 Update CI, remove some warnings (#6882)
* ci updates

* forgotten update

* inch by inch

* remove unused variable

* try a gcc bump

* get rid of a bunch of unused-but-set errors in clang16

* be more selective

* disable a test in an obsolete module which is mysteriously failing
2023-11-09 13:14:00 -05: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
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
f29f9a2d70 cleanup a compiler warning (#6016)
this was introduced in one of the recent conformer generator commits
2023-02-01 04:31:45 +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
0147cd8201 Fixes #5210 (#5408)
* revert duplicate chunk in release notes

* replace deprecated ifdefs
This one gets rid of USE_BUILTIN_POPCNT and RDK_THREADSAFE_SS
use RDK_OPTIMIZE_POPCNT or RDK_BUILD_THREADSAFE_SSS instead

* get rid of BUILD_COORDGEN_SUPPORT from ROMol.i

* fix a stupid typo

* update release notes
2022-07-11 11:20:03 +02:00
Eisuke Kawashima
ba6d8e0d3b clang-tidy: readability-simplify-boolean-expr (#4639) 2022-03-17 13:50:50 +01: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
69b143edd0 Swap from RDUNUSED_PARAM to unnamed parameters (#4433)
* cleanup

* more cleanup
2021-08-24 17:19:46 -04: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
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
Greg Landrum
5747c4f283 Issue a warning when embedding a molecule with no Hs (#3807)
* add "needsHs()" query

* add warning for embedding without Hs

* add H checks to UFF and MMFF as well;
a small amount of cleanup in the MMFF atom typing
2021-02-22 06:57:50 +01:00
jasondbiggs
1649029367 Embedder callback (#3668)
* adding a void pointer as a member for the EmbedParameters struct to allow aborting molecule embedder

* revert whitespace chage

* tabs->spaces

* have the callback function receive the iteration number as an argument, for progress monitoring

Co-authored-by: Jason Biggs <jasonb@wolfram.com>
2020-12-29 07:38:11 +01:00
Greg Landrum
edd922c99c Cleanup warnings from clang-10 (#3238)
* stop returning local memory in exceptions

* remove a couple unnecessary copies in loops

* fix a bug in the way the default MMFF aromatic parameters are constructed

* remove a bunch of loop-variable warnings

* remove a bunch of clang warnings

* disable clang warnings in python wrappers

* remove some warnings when building the python wrappers
2020-06-19 17:16:22 -04: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
Greg Landrum
ec366c1ab7 Dev/pvs studio cleanups2 (#2877)
* a round of cleanups courtesy of PVS studio

* add a test to make sure that a warning is a false alarm

* bug fix

* Fix a UFF bug

* more PVS studio cleanups

* next round of PVS studio cleanups

* completely remove the chances for that bug

* changes in response to review

* add an additional test
+ a bit of reformatting that snuck in
2020-01-22 15:10:58 +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
186d24bfb1 Fix for github #2800 (#2828)
* backup

* Fixes #2800
Still needs a bit of tweaking before merge though

* docs

* changes in response to review

* Typo
2019-12-10 06:12:53 +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
8524652a86 Fixes #2246 (#2248)
* Fixes #2246

* Fixes #2247
2019-02-04 10:32:33 -05:00
Greg Landrum
a59997b7e4 Some refactoring of the distance geometry code (#2153)
* move _embedPoints over to use EmbedArgs structure

* move _embedWithExpTorsions over

* a few pointer cleanups

* step by step

* more

* wrap the ETKDG paramaters into a struct

* fix a typo

* additional cleanup

* more

* simplify the embedargs struct

* pass embedParams instead of having them in embedargs

* a bit more cleanup

* response to code review
2019-01-02 06:06:38 +00:00
Greg Landrum
108d84ab1e Switch from boost::thread to std::thread (#1745)
* boost::thread mostly gone... still need to get rid of once
everything compiles

* replace boost::call_once

* remove link-time dependency on boost::thread

* first pass at using async

* switch to using async everywhere
2018-02-22 03:43:07 +01: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
915cf08faa run clang-format with c++-11 style over that 2017-04-22 17:19:10 +02:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +02:00
Greg Landrum
5f7e04fe5d Fix github1240 (#1396)
* add a test (currently fails, of course)

* backup, not really working

* Fixes #1240

* a bit more parameter tweaking to get some more structures to embed
2017-04-18 02:33:23 -04: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
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
2afeb3b086 Dev/cleanup bad confs (#973)
* passes all tests, but is still not 100 percent there

* generalize _centerInVolume for possible future use

* better testing of tetrahedral centers
update tests

* only test ring atoms

* handle 4-coordinate n too

* add a volume check; not all tests pass

* turn off debug printing

* rearrange the order of tests.
if this is not done, we get a seg fault when the github55 test runs.
the whole thing needs to be run under valgrind to track this down

* clear up a memory leak

* a bit more documentation
add a constant for one of the threshold values

* get more permissive on the energy tests.
Only do the extra tetrahedral tests for atoms in at least two rings.

* add a DEBUG_EMBEDDING option to make tracking down failures easier

* enable better debugging when the flag is set

* remove a FIX

* remove some debug printing from the tests
2016-07-25 14:26:19 -04:00
Greg Landrum
29a1a755fc remove warning about non-planar centers 2016-06-29 05:02:28 +02:00
sriniker
7943b8c79d Improved planarity for ETKDG (#967)
* enforce planarity

* increase the force constant for the impropers

* force constant adapted

* reduced tolerance for planarity and force constants changed for some torsions

* tolerance for planarity increased a bit again

* cerr outputs removed

* planarity tolerance increased

* boost log added in planarity check
2016-06-29 05:00:30 +02:00
Greg Landrum
cf7ceab383 remove wave of warnings 2016-03-30 13:09:59 +02: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
26ab552232 fixes based on code review 2015-10-21 14:51:53 +02:00
Sereina
687b464e91 small fixes 2015-10-20 17:04:54 +02:00