16 Commits

Author SHA1 Message Date
Brian Kelley
b0ef80d68d Allow labeled atoms to have working queries (#8849)
* Allow labeled atoms to have working queries

* Remove stray keystrokes

* Fix typo

* Apply clang-format

* Move simpler checks first

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2025-10-09 04:46:20 +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
Paolo Tosco
ac19430d1f Code cleanup, minor refactoring and typos (#7742)
* - code cleanup, minor refactoring and typos

* changes in response to the review

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-08-23 12:48:50 +02:00
Paolo Tosco
6c966b4fe5 RGD code cleanup (#7186)
* RGD code cleanup
- made an effort to give more meaningful names to variables (e.g., renamed most instances of attachment (point) to avoid ambiguity as attachment may be interpreted as either the R-group atom or its neighbor atom on the core, which are two different things)
- replaced the old school removeAtom() method with begin/commitBatchEdit()
- added std::move and std::make_move_iterator where relevant to avoid potential unintended copying
- replaced instances of container.size() == 0 and !container.size() with container.empty() for better clarity
- replaced std::map::find() with std::map::at() where the key was not needed
- replaced expensive std::find_if with more efficient alternative
- added some missing const keywords and added references to avoid copying where appropriate
- replaced for loops with modern implicit looping alternatives where convenient
- avoid calling MolToSmiles when VERBOSE is not defined as the result is anyway not used
- removed "oops, exponential is a pain" code snippet as I believe 1. it is never executed 2. it is not tested 3. I do not think it is correct
- removed check for data->matches.size() > 1 as I do not believe it is correct
- Use std::unique_ptr::reset instead of defining a new std::unique_ptr and moving it to the original one

* changes in response to review

* change in response to review

* replaced std::set with boost::dynamic_bitset to save time on std::set::insert and std::set::find

* make sure we do not go out of bounds

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-03-03 05:34:13 +01:00
Gareth Jones
81e9cb2386 Fix stereo bond corruption on RGD. (#6832) 2023-10-28 12:47:58 +02:00
Meng Wu
173f548f8f Remove redundant argument and variable hasCoreDummies (#6779) (#6786) 2023-10-24 04:54:19 +02:00
Gareth Jones
b46fc6e28b RGD with matching on tautomers of core (#6611)
* Support tautomer queries in RGD

* Continuing RGD and tautomer development

* Python and C# tests

* Python and C# tests

* C# test

* Typo fix

* For cire tautomer query update properties instead of full sanitization

* Added query comment

* Code review change

* Support Enumeration of input cores

* Mol enumeration test

* Remove useNormalMatch from RGroupDecomp

* Added comments for handling tautomeric core

* Added comments for handling tautomeric core
2023-08-29 08:50:14 +02:00
Gareth Jones
e6cf9e7768 RGD and Stereo Groups (#6247)
* Copy stereo group information to RGroups and Core

* Fix pointer alignment formatting issues

* Created details::copyStereoGroups
2023-04-01 07:58:52 +02:00
Gareth Jones
0d68b2f50b Bug/github5613 (#5735)
* Undo change to master

* Fixed typo in tests

* Undo change to master

* Initial development and test

* Sort of working tests

* Copy corodinates to new core

* Clear stereochemistry on core atoms with unlabelled rgroups

* Fixed typo in tests

* Undo change to master

* Fixed typo in tests

* Undo change to master

* Fixed typo in tests

* Undo change to master

* Continuing development

* Updated development

* Fixed Chirality Issues

* All tests working

* Remove some unused code

* Fixed typo in tests

* Undo change to master

* Fixed typo in tests

* Undo change to master

* Fixed typo in tests

* Undo change to master

* Working tests

* Tidy test code

* Adjust catch_rgd for stereochemistry in output cores

* Build ring info in output cores

* Fix Mac OS bug

* Fix for MCS and onlyMatchAtRGroups

* Brian's optimization suggestion

* Fix core group coordinate bug

* Test for replaceCore and multiple core bonds to chiral atom

* Fixed typo in tests

* Undo change to master

* Fixed typo in tests

* Undo change to master

* Fixed typo in tests

* Undo change to master

* Fixed typo in tests

* Undo change to master

* Fixed typo in tests

* Undo change to master

* Fixed typo in tests

* Undo change to master

* Update Code/GraphMol/RGroupDecomposition/RGroupDecompParams.cpp

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

* Update Code/GraphMol/RGroupDecomposition/RGroupDecompParams.cpp

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

* Changes in response to Greg's code review

* R group stereo bond attachment fix

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2022-12-16 05:36:49 +01:00
Gareth Jones
afd6586bcf Allow RGD to decompose 2 sidechains on unlabelled core atoms to separate R groups (#5618)
* Initial work preparing the core

* Simple test case working

* Check for labels

* Fix for labels

* Development for core wildcard issue

* Fixed core wildcard issue

* First working test

* Updated tests

* All tests working

* Reorder tests

* Fix failing tests

* Remove uint type

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

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

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

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

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

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

* Update Code/GraphMol/RGroupDecomposition/RGroupUtils.cpp

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

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

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

* Update Code/GraphMol/RGroupDecomposition/RGroupDecomp.h

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

* Update Code/GraphMol/RGroupDecomposition/RGroupDecompParams.cpp

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

* Update Code/GraphMol/RGroupDecomposition/RGroupDecompParams.cpp

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

* AddCore method for RGroupCore

* Revert addCore refactoring (thanks Clion)

* Fixed typo in tests

* Minor fixes

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupDecomp.h

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupDecompData.h

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/GraphMol/RGroupDecomposition/RGroupCore.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2022-10-19 04:36:56 +02:00
Gareth Jones
f8241c89e8 RGroup core output aligned to inout structure (#4709)
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-11-27 09:37:19 +01:00
Gareth Jones
922db38086 Fix for cores with atom lists and unit test (#4695) 2021-11-20 04:30:46 +01:00
Greg Landrum
c55182a8e0 Support using SubstructMatchParameters in RGD (#4318)
* support substructure search parameters in RGD.
Still needs testing/verification of the enhanced stereo stuff

* test enhanced stereo

* add support to python wrapper

unfortunately some python reformatting got mixed in there.
2021-07-09 15:07:43 +02:00
Brian Kelley
8d4b5cb616 Fix memory leak with deleting array (#4211) 2021-06-08 13:57:38 +02:00
Gareth Jones
9622580660 Comments added to RGD core matching (#4189)
* Comments added to RGD core matching

* Reformatted code
2021-06-01 14:49:18 +02:00
Gareth Jones
c2fb57c19f RGD - a fix for the cubane issue (single target atom matches 2 user R group attachments) (#4002)
* Most tests working

* All tests working

* Fixed tests after merge with master

* Create header and implementations for RCore

* Updated comments

* Removed old code

* DLL export for MolMatchFinalCheckFunctor

* Information line for failing Mac test

* Log replace core behaviour

* Ordering fix for OSX

* Possible fuzzer fix

* Removed debug output

* Fix unmatched user R group bug

* Code review changes

* Bug fix and ChemTransforms test
2021-05-23 15:16:03 -04:00