Commit Graph

22 Commits

Author SHA1 Message Date
Greg Landrum
908e47cc03 support generalized substructure search in the SubstructLibrary (#6835)
* support generalized substructure search in the SubstructLibrary

* simplify namespaces

* support the new functionality in the swig wrappers

* update mac swig version in CI

* ensure swig4

* switch mac_java ci builds to conda-forge

* change in response to review

* add copy ctor to extendedquerymol

* Back to the way it was
2023-11-01 14:55:28 -04: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
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Brian Kelley
6a16d64169 Adds KeyFromPropHolder to hold user defined indices (#4571)
* Adds KeyFromPropHolder to hold user defined indices

* Add missing file

* I hate swig.  Had to move keyholder classes into main header file, yuck.
But I added tests, so yay?

* Remove removed dependency

* Fix borked test

* Make consistent getKeys function, fix constness

* Fix overloaded call

* Remove GetKey/s from SubstructLibrary
2021-10-02 08:17:50 +02:00
Greg Landrum
3193b76d8c cleanup some compiler warnings (#4521)
* cleanup some clang warnings

* get rid of some VC++ warnings
2021-09-16 04:34:40 +02:00
Greg Landrum
e21c39dcb3 SubstructLibrary improvements (#4403)
* support MolBundles in the SubstructLibrary

* support SubstructMatchParameters in SubstructLibrary

* expose those methods to the python wrapper

* fix non-threadsafe build problem

* be explicit about sorting

* add the option to set the search order

* add example functions for setting the search order
2021-08-24 05:02:41 +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
Brian Kelley
198c7c60e5 Fixes #3881 (#3882) 2021-03-06 04:36:14 +01:00
Brian Kelley
c8aa10c80f Add tautomer query to the substructlibrary (#3808)
* Fixes #3797

* [WIP] Add tautomer queries to the substruct library

* Add TautomerQuery to CMake

* Add missing TautomerQuery functions, python wrapper and tests

* Add python wrappers for Substruct Library Tautomer Queries

* Explictly label non-const pattern function now that we have both

* Use boost::shared_ptr not std::shared_ptr

* Fix java builds

* One more try to fix java builds

* Fix Java Tests

* Run clang format

* Reenable tests

* Fix annoyingly stupid bug and annoying commit of debug code

* Fix documentation

* reenable ifdef threadsafe check

* Throw warning and perform tautomer search instead of bailing with incorrect fingerprints

* Simplfy api with templates

* Fix SubstructLibrary java issues

* minor API cleanup

* simplify the SWIG wrappers

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2021-03-05 04:56:20 +01:00
Brian Kelley
bd00fda39e Fixes crashes when using bad smiles in the cached smiles holders (#3798)
* Fixes #3797

* Update Code/GraphMol/SubstructLibrary/SubstructLibrary.cpp

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

* Update test to include positive and negative results

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-02-15 10:49:19 +01:00
Paolo Tosco
8030c36e5b Minor tweaks to SubstructLibrary (#3564)
* - added some missing const keywords
- added an addFingerprint overload to allow passing pointers
- added a test

* changes in response to review

* removed print

* added missing shared_ptr declaration

* added PatternNumBitsHolder serialization

* - merged with upstream changes and resolved conflicts
- got rid of PatternNumBitsHolder and leveraged the serialization version to get the PatternHolder to be backwards-compatible

* built substructLibV1.pkl with an older version of boost

* reverted serialization version to 1
only write numBits if != 2048 and only read numBits if it exists in the archive

* bogus commit just to trigger a rebuild
2020-12-09 19:42:38 -05:00
Paolo Tosco
c5dc6cc258 A few improvements to SubstructLibrary (#3557)
* - enable SubstructLibrary to build without threading support
- enforce consistency across single- and multi-threaded runs
- improve performance on single-threaded runs avoiding overhead of spawning threads
- consolidate internalCountMatches and internalGetMatches into one function to reduce code duplication
- fix a bug in Python CountMatches whjich would run on 1000 threads

* reverted Code/GraphMol/SubstructLibrary/Wrap/SubstructLibraryWrap.cpp as it is now in its own PR (#3558)

* - added missing cast
- removed unnecessary std::make_move_iterator
- added Brian's test

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2020-11-18 16:07:34 -05:00
Brian Kelley
8fb99abc88 Fix/add patterns reset holders (#3033)
* Reset the mol and fp holders after calling AddPatterns

* Add test for seg fault
2020-03-25 06:36:00 +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
Brian Kelley
c3db12e097 Fixes #2830 (#2831)
* Fixes #2830

* Reenable tests

* Response to review

* Add more tests and C++ tests
2019-12-15 06:42:31 +01:00
Brian Kelley
57a891bff2 Add serialization to SubstructLibrary (#2295)
* WIP - Substruct Library Serialization

* Add serialization to SubstructLibrary

* Add SubstructLibraryDefs

This holds the definition of whether the substruct 
library is serializable

* Wrap serialization in python

* Remove .h file, add .h.in file

* Configure header file into source dir

* Use RDConfig.h to configure serialization

* Move serialization code to seperate header file

* Fixes for review comments

* Removes some code redundancy

* Make pickling mols less memory intensive

* Check if molholders come back as the right types
2019-03-02 16:31:40 +01:00
Brian Kelley
5df4496696 Fix embarassing bug, check the counter each iteration not just after searching (#1939) 2018-06-29 09:02:34 -07: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
Greg Landrum
636a0f6e69 Cleanup a bunch of compiler warnings (#1697)
* remove a bunch of compiler warnings

* remove some more warnings on windows (there are still plenty to go...)
2017-12-22 12:59:52 +01:00
Greg Landrum
1efa8e696e another clang-format run 2017-10-12 06:42:15 +02:00
Greg Landrum
f94e277856 another pass of clang modernize 2017-10-12 06:35:51 +02:00
Brian Kelley
d8722b1c64 First entry of the SubstructLibrary module (#1493)
* First entry of the SubstructLibrary module

* Switch to shared_ptrs for memory safety

* run clang-format and add a test

* only build when threadsafe_sss is enabled, only test when test_multithreaded is enabled

* Adds PRECONDITION

* Adds exceptions for out of range errors

* Changes getQueryBits to makeQueryBits for clarity

* Adds API point to add Binary and Smiles directly

* Replaces 0 with NULL for clarity.

* Removes debugging code.

* Makes endIdx non-inclusive

* Adds substruct searching options

* Adds preconditions

* Small documentation cleanup and removes a line of code.

* Add DataStructs library dependency

* Actually uses passed in parameters

* Adds TrustedSmiles/Binary inputs

* Adds more api testing options/trusted smiles and binary inputs

* Finalizes API adds docs and doctests

* Minor copyright fixes and such
2017-07-19 10:39:42 +02:00