45 Commits

Author SHA1 Message Date
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
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
d13b002d2d update default ET version to 2 in getExperimentalTorsions (#8798)
* update et version to 2

* Add comment in the release notes.
2025-09-24 05:56:35 +02:00
Eisuke Kawashima
26033b6578 style: apply modernize-use-override (#8137)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-25 12:24:58 +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
a45d4d9857 New contribs for DG (#7711)
* add angles and distances

* add Inversions

* add torsiona angle contribs

* use new contribs in test

* use new inversion and torsion contribs in dg

* use new distance contribs in dg

* use new angle constraints in dg

* use new constraints in FF tests

* update docstrings

* remove unused import

* include new contribs

* cleanup includes

* make changes requested by @greglandrum

* use std::move instead of release
2024-08-21 06:06:58 +02: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
Ric
58d135a874 Reformat C/C++ code ahead of 2023.03 release (#6295)
* format files

* format template files too
2023-04-28 04:42:35 +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
e322928028 swap boost::tuple to std::tuple (#5851) 2022-12-16 16:01:19 +01:00
Greg Landrum
fd1752e006 disable Info and Debug logs by default (#5065)
* disable the info and debug logs by default

* adjust tests to the newly disabled logs

* add LogStateSetter

* namespace reorg

* add some tests

* remove vestigial code

* switch to using std::vector
2022-03-12 10:04:28 +01: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
Eisuke Kawashima
013ba4f21d Run clang-tidy (modernize-use-override) (#4251) 2021-07-01 05:18:56 +02:00
Eisuke Kawashima
78aac3c1bc Run clang-format against header files (#4143) 2021-06-08 07:57:51 +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
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
45b9aef28b clang-tidy modernize-use-default-member-init and modernize-use-emplace (#3190)
* run clang-tidy with modernize-use-default-member-init

* results from modernize-use-emplace

* one uniform initialization per line
otherwise SWIG is unhappy

Co-authored-by: Brian Kelley <fustigator@gmail.com>
2020-05-28 09:07:58 +02:00
Eisuke Kawashima
75f03412ef Modernize deprecated header inclusion (#3137) 2020-05-04 10:40:57 +02:00
Greg Landrum
45bf58754a Cleanup some cmake dependencies (#3077)
* change minimal cmake version to a consistent 3.5

* progress towards a cleanup

* get the basic python deps working

* two more libs

* another round of changes
all tests pass at this point

* next round of changes
all tests pass at this point

* close to done
all tests pass

* very close

* almost done

* shift the RDBoost dependencies around a bit

* remove an extraneous python linkage
this is trying to get the mac builds working again

* Only link to python if it was built shared (#3091)

* change in response to review

Co-Authored-By: Ric <ricrogz@users.noreply.github.com>

* move that suppression of the maybe-uninitialized warning to BoostStartInclude.h

Co-authored-by: Brian Kelley <fustigator@gmail.com>
Co-authored-by: Ric <ricrogz@users.noreply.github.com>
2020-04-17 14:34:23 +02: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
a75018fe38 Cleanups and additional tests to improve test coverage (#2852)
* disable builds of the StructChecker code by default

* operator"" _smarts() doesn't need to catch sanitization errors

* remove unused function

* turn back on some tests that shouldn't have been disabled

* Remove unused code from SMARTS parser and simplify a bit

SmilesParseOps::AddFragToMol is now used only from the SMARTS parser, so we can simplify the API

* Removes obsolete special case code for SMARTS

This was relevant when organic atoms in SMARTS queries were stored as two-part queries.

* improve SMARTS testing

make sure we can generate SMARTS from all the examples and then parse that again.

* Fixes #2814

* Fixes #2815

* some additional smarts tests to improve coverage

* test copy ctor and getPos

* remove obsolete test_list files

* include tests for the morgan invariant generators

* more cleanups and coverage improvements

* remove files that were mistakenly added
2020-01-09 16:07:55 -05:00
Greg Landrum
ec31bea97b clang-tidy-7 pass (#2408) 2019-04-16 12:05:47 -04: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
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
2738c35178 Fixes #1903 (#1971)
* Fixes #1903

* update SWIG bindings too
2018-07-25 09:14:17 +02: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
ba12d98ad0 Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers (#1713)
* Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers

* Actually delete atoms and bonds...

* RWMol::clear now calls destroy to handle atom/bond deletion

* Changes broken Atom lookup for windows/gcc

* Adds tests for running with valgrind

* Adds test designed for valgrind and molecule deletions

* Removes RNG, actually tests bond deletions

* update swig wrappers

* deal with most recent changes on the main branch
2018-01-07 14:19:47 -05: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
87786c08b5 Merge branch 'master' into modern_cxx
# Conflicts:
#	.travis.yml
#	Code/GraphMol/FileParsers/MolFileParser.cpp
#	Code/GraphMol/FileParsers/MolFileStereochem.cpp
#	Code/GraphMol/ForceFieldHelpers/UFF/testUFFHelpers.cpp
#	Code/GraphMol/MolAlign/testMolAlign.cpp
#	Code/GraphMol/MolDraw2D/MolDraw2D.cpp
#	Code/GraphMol/MolDraw2D/Wrap/rdMolDraw2D.cpp
#	Code/GraphMol/QueryOps.cpp
#	Code/GraphMol/ROMol.cpp
#	Code/GraphMol/SmilesParse/test.cpp
#	Code/GraphMol/Trajectory/Trajectory.cpp
#	Code/GraphMol/Wrap/Atom.cpp
#	Code/GraphMol/Wrap/Bond.cpp
#	Code/GraphMol/new_canon.cpp
#	Code/RDGeneral/testDict.cpp
#	Code/SimDivPickers/Wrap/MaxMinPicker.cpp
2017-10-05 05:58:38 +02:00
Brian Kelley
7488840ac4 Fix/urange check (#1506)
* Fixes atom documentation

* Fixes #1461

This is a complicated one.  Basically URANGE_CHECK when
used on unsigned integers has a problem when the size of
the range it’s checking is 0.  The standard operations is
to check

URANGE(num, size-1)

Which (for unsigned integers) obviously rolls over.

This fixes all usage cases to be

URANGE(num+1, size)

And fixes the bugs found.  (addBond and the mmff tests)

* Fixes #1461 - Updates URANGE_CHECK to be 0<=x<hi
2017-09-11 21:17:33 +02: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
gedeck
e9af48ffd7 Issue1071/yapf (#1078)
* Issue #1071: add yapf configuration file

* yapf formatting of Code directory

* yapf formatting of Contrib directory

* yapf formatting of Data directory

* yapf formatting of Docs directory

* yapf formatting of External directory

* yapf formatting of Projects directory

* yapf formatting of Regress directory

* yapf formatting of Scripts directory

* yapf formatting of Web directory

* yapf formatting of rdkit directory
2016-09-23 04:58:46 +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
e04aed8ea8 another batch of warnings squashed 2016-03-30 13:44:21 +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
Paolo Tosco
04c28693d8 - fixed a compilation warning 2015-10-24 01:29:57 +01:00
Paolo Tosco
517de5b5d8 - Fixed a few glitches which caused the build to fail on Windows
- added a few tests for ResonanceMolSupplier
2015-10-24 01:18:10 +01:00
Sereina
26ab552232 fixes based on code review 2015-10-21 14:51:53 +02:00
Sereina
ac7ef34f05 ETKDG implementation 2015-10-20 13:51:43 +02:00