30 Commits

Author SHA1 Message Date
Ricardo Rodriguez
d90a73aa6b Leak fixes for 2026.03.1 (#9198)
* fix mols leaked in tests

* own invariant generators

* clean up MorganFeatureAtomInvGenerator patterns

* address review suggestions
2026-03-25 05:56:26 +01:00
Greg Landrum
da08e8d954 Allow molzip to position fragments when joining them (#9021)
* move molzip to its own file

* basics working

* more testing

* another test

* minor

* fix doxygen comment format

* fix alignment with co-directional exit vectors;
some modernization

* JSON parsing
python wrapper

* response to review

* response to review

* explicitly test that the first frag does not move

---------

Co-authored-by: = <=>
2026-01-07 10:33:03 -05:00
David Cosgrove
4883485ac5 Fixes Github9009 (#9012)
* Mostly working.

* Clear out debugging writes.

* Avoid a mol copy.

* Left some debugging in.

* Move the fix into fragmentOnBonds.

* Add test.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2025-12-22 06:26:23 +01:00
Greg Landrum
86141183c1 Moving towards getting all tests to pass when using the new stereo code (#8409)
* Fixes #8379

* check in some working tests

* test passes

* test passes

* test passes

* test passes

* test passes

* ensure that the invariants flush the streams on failure

* tests pass

* test passes

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* Fixes #8391

* tests pass

* fix a test with legacy
not clear why this was not causing problems before

* make a test work

* Fixes #8396

* gcc builds work

* fingerprint tests pass

* mention backwards incompatible change

* fix a problem with FindMolChiralCenters

* more testing details

* enable the test status output

* Fixes #8432

fix a bug in double-bond stereo handling for template matching

* all depictor tests pass

* use the new-stereo chiral ranks in the depiction code

* always assign new-stereo chiral ranks

* make _ChiralAtomRank a computed property
This is analogous to _CIPRank

* tweak to the way the atom ordering is computed for 2D coordinate generation

* update two expected results

* backup

* response to review

* tests pass

* tests pass

---------

Co-authored-by: = <=>
2025-04-15 14:00:32 +02:00
Brian Kelley
cad6962a37 Adds linker style zipping (#8289)
* Adds linker style zipping

* Fix dangling dummy atoms, i.e. [*:1].C

* Run clang-format

---------

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2025-03-06 05:44:25 +01:00
Ricardo Rodriguez
9e1dbd2f33 Fixes #7327 (#7328)
* add tests

* fix
2024-04-08 06:12:56 +02:00
Brian Kelley
693796d7af Enhance molzip to properly handle RGroupDecompositions (#7202)
* Fix zipping of rgroup decomps with broken rings

* Add utility to molzip rgroup rows

* Add RGroupRow molzip

* Fix typo in example and test

* Fix warning on integer size

* Don't use ssize_t

* a couple of suggestions

* Update Code/GraphMol/ChemTransforms/MolFragmenter.cpp

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

* Update Code/GraphMol/ChemTransforms/MolFragmenter.cpp

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

* Move molzip rgroup row from RGroupDecomp to ChemTransforms

* Fix exports

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-03-19 17:02:45 +01:00
Greg Landrum
2957ab4576 switch to catch2 v3 (#6898)
* switch to catch2 v3
Fixes #6894

* fix a couple of problems noticed in the CI builds

* more warning cleanup

* changes in response to review
2023-11-15 06:45:42 +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
Ric
57a1ba473b Fixes #6034 (#6035)
* fix + test

* move updatePropertyCache call into fragmentOnBonds
2023-02-02 05:00:47 +01:00
Gareth Jones
bb8bc57d05 Add depiction coordinates to molzip (#5993)
* Test routine working

* Fix python molzip signature clash

* Update SWIG bindings

* Add C++ and Python documentation

* Add C++ and Python documentation
2023-01-28 04:46:39 +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
Greg Landrum
1f4584b2ca run clang_format (#5676) 2022-11-01 04:14:26 +01:00
Brian Kelley
d1985caaa7 cdxml parser (#5273) 2022-09-28 05:49:27 +02:00
Brian Kelley
4e8f9e11f5 Molzip: save bond dir when zipping (#5445)
* MolZip now saves the bonddir when zipping

* Add test for saving bonddir in MolZip

* Save either the first or second bond dir, fix the test to actually test

* Add more comprehensive bonddir checking and atom reordering

* Fix the atom swaps after the consistency check

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2022-07-26 05:44:47 +02:00
Brian Kelley
07d9a2f915 MolZip: add atom property labels for mol-zipping (#5446)
Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2022-07-24 06:26:50 +02:00
Brian Kelley
5cdcaa933a Fix segfault in mol zip (#5338)
* Fixes #5335

* fix invariant message

* Fix github issue number

* Simplify CHECK_INVARIANT logic and remove debugging output from tests
2022-06-01 05:06:34 +02:00
Brian Kelley
079d845f5a Add sanitize option to molzip (#5069)
* Add sanitize option to molzip

* fix typo

* Change MolzipParams.santize to enforceValenceRules
2022-03-16 06:02:35 +01: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
Greg Landrum
7f73da78a2 Fixes #4809: double bond stereo can now be set after calling replaceCore() (#4827)
* add test

* backup commit

* Fixes #4809

* cleanup

* don't make that change in large rings

* docs
2021-12-29 09:03:09 +01:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +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
cf9ea71384 First pass at MolZip (now with bond stereo!) (#3644)
* First pass at MolZip (sans bond stereo)

* Add support for bond stereo zipping

* Add molzip swig wrappers

* Add simple python wrapper/tests

* Remove smiles round tripping now that fragmentOnBonds is fixed

* Responses to review

* AtomMaps and Isotopes must explicitly be set

* Add molzip single molecule api isotope test

* Add missing %newobject

* Add better python docs, label test

* fix docs add a test for molzip

* Update Code/GraphMol/ChemTransforms/MolFragmenter.cpp

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

* Add missing case breaks

* Add more preconditions, move mark and restore to private functions

* Remove unused and redunddant code

* optimize get_other_atom

* Add single arg molzip test

* Update Code/GraphMol/Wrap/rough_test.py

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

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2020-12-25 05:15:12 +01:00
Brian Kelley
81481d5c6d BondStereo info lost in FragmentOnBonds() (#3649)
* Fix bondstereo when fragmenting molecules with cis/trans E/Z

* Apply suggestions from code review

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

* Add more tests for bond stereo

* Add test to ensure non-stereo atom bond breaks are preserved

* Remove extraneous test, fix another

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2020-12-18 13:13:47 +01:00
Brian Kelley
66fa3c3a86 Reverts acciental molzip push 2020-12-08 17:04:07 -05:00
Brian Kelley
52bf58e254 Response to review: invert a and b molecules in tests. Fix bug found. 2020-12-08 10:23:53 -05:00
Brian Kelley
23ad0f8b84 Addd fragment on bonds and isotope labelling 2020-11-22 19:39:43 -05:00
Brian Kelley
847426faa2 Final algorithm implementation 2020-11-21 17:08:28 -05:00
Brian Kelley
08e0c714d7 First pass at molzip 2020-11-16 14:55:30 -05:00
Greg Landrum
ea0e8f674e Preserve bond direction in fragmentOnBonds (#2484)
* Sketch of a solution to preserve bond direction in fragmentOnBonds

* A bit of cleanup work based on Andrew's original commit for #1039
Add a couple of tests too

* forgot to save a file before the commit
2019-06-10 13:08:50 -04:00