Commit Graph

88 Commits

Author SHA1 Message Date
Ricardo Rodriguez
92d5d2c657 Refactor to stop using iterator definitions in types.h (#9275)
* clean up iterator defs in types.h

* do not use auto for inline constexpr

* restore undef max,min

* restore types.h declarations
2026-05-21 19:19:38 +02:00
Ricardo Rodriguez
7b7a8a4e17 Refactor iostreams includes (#8846)
* refactor iostreams includes

* restore ostream to MonomerInfo.cpp
2025-10-08 16:08:01 +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
Hussein Faara
8411f4535e remove no-op macros and dead code (pt 2) (#8035)
* remove no-op macros and dead code (pt 2)

* test failures due to whitespace changes?

* actually run the testFeatures tests

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2025-01-11 14:10:00 +01:00
Greg Landrum
7872341b92 fixes #8001 (#8002) 2024-11-14 05:14:51 +01: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
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
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
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
69b143edd0 Swap from RDUNUSED_PARAM to unnamed parameters (#4433)
* cleanup

* more cleanup
2021-08-24 17:19:46 -04: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
36c7c04344 basic h bond support (#3871) 2021-03-06 09:39:13 -05: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
0e89b2dbea cleanup a bunch of compiler warnings (#3849)
* cleanup a bunch of g++ warnings

* make it work with clang

* remove some additional warnings based on CI builds

* fix that version number

* stop being verbose when building
2021-02-26 05:10:02 +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
Eisuke Kawashima
75f03412ef Modernize deprecated header inclusion (#3137) 2020-05-04 10:40:57 +02:00
Greg Landrum
7c580e90d7 Fixes #3019 (#3037)
* Fixes #3019

Use an unsigned long for the index into cisPaths and transPaths

* change in response to review

* typo fix

good grief

* another typo
2020-03-27 13:21:51 -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
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
Francois Berenger
7ec8ec0bb9 Vdv radii from blue obelisk (#2154)
* updated atomic radii to follow the Blue Obelisk Data Repository

Ubuntu package bodr version 10-1; radii are from file
/usr/share/bodr/elements.xml

* typo

* use 2.0 as default VDW radius instead of 1.7

for elements missing from the Blue Obelisk Data Repository

* Document the atomic_data

* update expected test results

* update java tests

* allow a bit more slop when comparing confs

For cross-platform stability
2019-05-29 09:23:27 +02:00
Ric
6224a42516 Build warnings revisited (#2318)
* unused vars in bison parser cleanup

* initialization order in TopologicalTorsionGenerator

* unused params in SLN bison

* sln flex unused params

* throwing destructor in TDTWriter

* signed comparison in substructmethods

* unused input param in smiles/smarts bison

* unused ms param in sln bison

* signed comparison in FingerprintGenerator

* store return of fscanf in StructCheckerOptions

* unreferenced var in catch

* uninitialized value in FileParserUtils

* avoid override overload warning in MolDraw2DSVG

* non-final overrides in Validate.h

* unused static var in Avalon

* unused vars in catch blocks

* make AvalonTools avalonSimilarityBits & avalonSSSBits const int

* assert fscanf result in StructCheckerOptions
2019-03-08 16:42:54 +01:00
Greg Landrum
8524652a86 Fixes #2246 (#2248)
* Fixes #2246

* Fixes #2247
2019-02-04 10:32:33 -05:00
Ric
a6b26253ff Fix (most of) mem problems (#2123)
* do not use new on loggers

* del pointers in testDistGeom

* Update Dict hasNonPOD status on bulk update

* delete new Dicts in memtest1.cpp

* fixes in MolSuppliers and testFMCS

* PeriodicTable singleton as unique_ptr

* fix EEM_arrays leak

* fix leaks in testPBF

* fix ParamCollection leak in test UFF

* fix leaks in MMFF

* clear prop dict before read in in pickler

* fix leaks in testFreeSASA

* fix leaks in test3D

* modernize Dict.h & SmilesParse.cpp

* fix leaks in testQuery

* fix leaks in testCrystalFF

* fix leaks in cxsmilesTest

* fix leaks in Catalog & mol cat test

* fix leaks in ShapeUtils & tests

* fix leaks in testSubgraphs1

* fix leaks testFingerprintGenerators

* fix leaks in Catalog/FilterCatalog

* fix leaks in graphmolqueryTest

* these changes reduce bison parse leaks

* fixed leaks in testChirality.cpp

* fix leaks + 2 tests in testMolWriter

* fix 4m leaks in substructLibraryTest

* small improvements to molTautomerTest; still leaks

* fix leaks in testRGroupDecomp

* fix leaks in test; parser still leaks

* fix leaks in itertest

* fix 4m leaks in testDepictor

* fixes in smatest; still leaking due to parser

* fixes in testSLNParse; still leaking due to parser

* flex/bison: always add atoms with ownership; smarts error cleanup

* fix leaks in testReaction

* fix leaks in testSubstructMatch

* fix leaks in resMolSupplierTest

* fix leaks in testChemTransforms + bug in ChemTransforms

* fix leaks in testPickler

* fix leaks in testMolTransform

* fix leaks in testFragCatalog

* fix leak in testSLNParse. Still leaks due to Smiles

* fixed most leaks in testMolSupplier

* pre bison fix

* fix some atom & bond parse problems; others still fail

* bison smiles & smarts, atoms & bonds more or less fixed

* fix leaks in molopstest.cpp

* fix leaks in testFingerprints, MACCS.cpp & AtomPairs.cpp

* fix leaks in moldraw2Dtest1

* fix leaks in testDescriptors

* fix leaks in testInchi

* fix leaks in testUFFForceFieldHelpers

* fix leaks in hanoiTest & new_canon.h

* fix leaks in testMMFFForceField

* fix leaks in graphmolTest1

* fix leaks in testMMFFForceFieldHelpers

* fix leaks in testDistGeomHelpers

* fix leaks in testMolAlign

* initialize occupancy & temp facto with default values

* fix leak in TautomerTransform

* updated suppressions

* fix testStructChecker

* fix logging & py tests

* fix TautomerTransform class/struct issue

* remove misplaced delete in testSLNParse

* deinit in testAvalonLib1

* fix Avalon-triggered(?) bug in StructChecker/Pattern.cpp

* fix random testMolWriter/Supplier fails

- diversify output file names to avoid clashing.
- unify Writers close/destruct behavior.
- flushing/closing in tests.

* use reset in FFs Params.cpp

* comments on testMMFFForceField

* unrequired 'if's added to mol suppliers

* correct cast in FilterCatalog.h

* use unique_ptr in MACCS Patterns

* remove unrequred if in new_canon

* update & move suppressions
2018-10-29 14:33:26 +00:00
Paolo Tosco
f7c888844d moved test.h from RDBoost to RDGeneral for consistency with export.h (#2074) 2018-10-11 17:35:23 -04:00
Greg Landrum
8a08c326e0 Fixes #1990 (#1992)
* Fixes #1990
makes sure we don't destroy a double bond's StereoAtoms just because a bond connected to one of its atoms is removed

* change in response to review
2018-08-13 09:03:21 -04:00
Paolo Tosco
c08ea49bda - enable building DLLs on Windows (#1861)
* - enable building DLLs on Windows

* - export.h and test.h are now auto-generated by CMake
2018-05-16 08:42:41 +02: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
534a5293ef Improved regression test for ETKDG version 2 (#1640)
* 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

* regression test for ETKDG version 2 improved
2017-11-15 06:51:05 +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
Brian Kelley
7440ac082f Fixes rounding errors in test (#1001) 2016-08-02 06:07:47 +02: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
Paolo Tosco
e642c46525 Made DistGeomHelpers test robust against small 3D coordinate variations (#961)
* - made Code/GraphMol/DistGeomHelpers/testDgeomHelpers.cpp and Code/GraphMol/DistGeomHelpers/Wrap/testDistGeom.py
  more robust against very small coordinate variations which may induce UFF energy variations in the 1-kcal/mol range.
  This was observed in a single case using the MinGW 32-bit g++ compiler. The check for identity of conformations
  between single- and multi-threaded runs is now complemented by a 3D coordinate MSD check

* - lowered the energy tolerance to 1.0 kcal/mol

* - added rdkitBuild string with compile-time information
- added runtime check in Code/GraphMol/DistGeomHelpers/testDgeomHelpers.cpp
  and Code/GraphMol/DistGeomHelpers/Wrap/testDistGeom.py
  to use more lenient tolerances with MinGW compilers
2016-06-28 20:11:31 +02:00
Greg Landrum
8232181746 cleanup an extra bit of printing 2015-12-14 16:37:24 +01:00
Greg Landrum
ad87bc6c0c Fixes #697 2015-12-14 15:44:11 +01:00
Greg Landrum
e5311fa7aa Fixes #696 2015-12-11 05:58:28 +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
239527f8a6 small fix 2015-10-21 07:21:03 +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