13 Commits

Author SHA1 Message Date
Greg Landrum
e35f7db009 Cleanup/get atoms and bonds (#9243) 2026-04-18 05:22:09 +02:00
Paolo Tosco
08cc96336c Enable chemist-friendly depiction of R-groups (#6866)
* - added a convenience function to relabel R-groups in a chemist-friendly fashion
- exposed functionality to MinimalLib through a JSON option at molecule creation time
- added relevant unit tests

* changes in response to review

* added missing library

* fixed Python test

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2023-11-11 07:16:54 +01: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
Eisuke Kawashima
27f711a658 Run clang-tidy (readability-braces-around-statements) (#4977)
https://github.com/rdkit/rdkit/pull/3024#discussion_r526549843
2022-03-10 08:00:10 +01:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +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
Paolo Tosco
d6ac27e2ea Fixes issues with unlabelled groups on aromatic nitrogens (#3908)
* make sure that unlabelled R-groups on aromatic nitrogens have correct valence and formal charge to avoid kekulization failures

* change in response to review

Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
2021-03-12 14:39:52 +01:00
Gareth Jones
81d3705358 R group match any issue (#3767)
* RGD modifications for any atom and index labels

* Continued development

* All tests working

* Added comment

* CR changes suggested by PTosco

* Fix catch_rgd for autocrlf

* Core dummy matches on output. RGroups on heavy atom. Dummy atoms User rgroups only when they are degree 1.

* Start work on test fixes

* testRGroupDecomp test working

* CPP and Python tests working

* Removed options for matching core query atoms on sidechains

* Windows build fix

* R groups off ring. User group matches single heavy substituent. Remove extraneous hydrogens

* Updated fingerprint variance score and tie selection

* Refactor fingerprint variance score functions to class

* Removed fingerprint distance score

* Boost::trim fix

* Updated RGD test notebook

* Fixed AddHs.cpp

* - fixes the kekulization issue
- avoids that empty R-group labels are included in cores
- makes sure that SMILES cores are always canonical
- adds a few missing const declarations and avoids unintentional copying

* Support for allowNonTerminalRGroups parameter. Remove R groups that contain H or Nothing.  Ignore R group labels on non-dummy atoms

* Fixed tests for Paolo's changes. Rebuilt test notebook.  Increased weighting of rgroup penalty in fingerprint variance score

* remove some debug output

Co-authored-by: Brian Kelley <fustigator@gmail.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2021-03-10 12:56:42 +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
52c83c45f0 Add some more comprehensive R-Group Decomposition tests (#3778)
* start to add some human-readable regression-test like examples for RGD

* small examples from JMedChem

* add helper viewer

* make that generate actual JSON

* use JSON of full output for tests
move JSON generation to RGroupUtils.h

* switch to using JSON from files

* add test notebook

* add jupyter testing to the code

* add nbval to linux test env

* add notebook tests to mac and windows too

* add toJSON for columns too
2021-02-05 10:35:32 +01:00
Paolo Tosco
b74a4aeb4c Fixes a few bugs in the R-group decomposition code (#3497)
* - Fixes three bugs in the R-group decomposition code

* - delete iterator properly during loop so the Mac does not complain

* added more tests

Co-authored-by: user173873 <user173873@FF026.local>
2020-10-19 07:46:06 -04:00
Brian Kelley
adf19f7517 RGroupDecomposition restructuring (#3270)
* First part of restructuring rgroup decomposition classes

* Add docs

* Move doc strings before structs
2020-07-08 11:47:00 -04:00