Commit Graph

27 Commits

Author SHA1 Message Date
Greg Landrum
28112aaef9 add ability to block atoms/bonds from participating in tautomer zones (#9297)
* add ability to block atoms/bonds from participating in tautomer zones

* be more structured with the atom flag

* response to review

---------

Co-authored-by: = <=>
2026-05-29 05:38:02 +02:00
Eloy Félix
cb251343b9 Tautomer insensitive hash v2, E/Z and stereocenter-preservation (#9128)
* Tautomer insensitive hash v2, E/Z and stereocenter-preservation

* Preserve E/Z stereochemistry and stereocenters in TautomerHashv2

Simplify extension logic to better protect stereocenters connected via
single bonds to aromatic systems. Preserve E/Z stereo on exocyclic
double bonds to distinguish geometric isomers (e.g., E/Z hydrazones).

* add helper function to remove duplicated code

* Fix ring info and bond aromaticity handling in MolHash

- Add fastFindRings check in TautomerHashv2 before ring queries
- Set isAromatic consistent with bond type (true for AROMATIC bonds)
- Fix inverted condition in RegioisomerHash

* more consistent hashes regardless of stereo annotation
2026-04-24 14:19:47 +02:00
Greg Landrum
ccefda882d Fixes #8654 (#8657)
* Fixes #8654

* fix a logic error

* SWIG is sooooo much fun
2025-07-30 05:56:52 +02:00
Greg Landrum
71935ecae3 Fixes #8405 (#8406) 2025-04-04 15:13:39 +02:00
Greg Landrum
e3b1ca015b Fixes github #8205 (#8368) 2025-04-01 19:40:41 +02:00
Greg Landrum
68672864c6 improve handling of esters, amides, etc. in the v2 tautomer hash (#8173)
* improve handling of esters, amides, etc. in the v2 tautomer hash

Fixes #8090

* cleanup

* extend that logic to aromatic systems

* documentation in response to review
2025-01-24 16:11:38 +01:00
Greg Landrum
93e8a746bf Shrink the tautomeric zone for the v2 hash of things like imines (#7502) 2024-06-07 05:09:57 +02:00
Greg Landrum
a6f0493fdd add HetAtomProtomerv2 (#7253) 2024-03-17 10:58:47 +01:00
Greg Landrum
3cff4d08af fix a problem with tautomeric systems being extended too far (#7200)
* fix a problem with tautomeric systems being extended too far

* add backwards incompatibility note
2024-03-15 16:42:22 +01:00
Vincent F. Scalfani
4633c99498 Fixes #6472 - remove aromatic bond flags in Molhash anonymous graph (#7027)
* remove aromatic bond flags and add test.

* update cookbook molhash results.
2024-01-09 06:12:03 +01:00
tadhurst-cdd
d5d4d194ec atropisomer handling added (#6903)
* atropisomer handling added

* fixed non-used variables,  linking directives

* BOOST LIB start/stop fixes, linking fix

* Fixes for RDKIT CI errors

* minimalLib fix

* changed vector<enum> for java builds

* check for extra chars in CIP labeling

* removed wrong deprecated message

* fix ostrstream output error?

* restored _ChiralAtomRank to lowercase first letter

* changes for merged master

* Fixed catch label for new Catch package

* update expected psql results

* get swig wrappers building

* restore MolFileStereochem to FileParsers

* fix java wrapper for reapplyMolBlockWedging

* some suggestions

* move a couple functions out of Bond

* Merge branch 'master' into pr/atropisomers2

* merged master

* Renamed setStereoanyFromSquiggleBond

* atropisomers in cdxml, rationalize atrop wedging, stereoGroups in drawMol

* fix for CI build

* attempt to fix java build in CI

* attempt to fix java build in CI #2

* New routine to remove non-explicit  3D-geneated chirality

* changed to use pair for atrop atoms and related bonds

* Changes as per PR reviews

* PR review respnses

* PR review reponse - more

* Fix merge from master

* fixing java ci after merge

* Updated the help doc for atripisomers

* update the atropisomer docs

* improve the images

* add the source CXSMILES

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-12-22 04:58:18 +01:00
dehaenw
b58b8f1397 MakeScaffoldGeneric isotope removal (#6855)
* makescaffoldgeneric isotopes

reset the isotope to 0

* add tests

add tests, change hash functions cpp

* correct typo

* fix python test

* correct tests and add anonymous graphs

* Delete rdkit/Chem/Draw/github4763.svg

deleted stray image
2023-11-10 20:26:03 +01:00
Greg Landrum
63c7e85046 Update CI, remove some warnings (#6882)
* ci updates

* forgotten update

* inch by inch

* remove unused variable

* try a gcc bump

* get rid of a bunch of unused-but-set errors in clang16

* be more selective

* disable a test in an obsolete module which is mysteriously failing
2023-11-09 13:14:00 -05:00
Ric
1857c07d7b Fixes #6505 (#6506)
* add test

* add another test

* Add fix
2023-07-14 06:58:19 +02:00
Greg Landrum
a57060225f Fixes #6479 (#6482)
* make sure we don't try to access an SG which no longer exists

* Fixes #6479
updates a bunch of tests to support this

* test ring stereo too

* update expected results from the tests
2023-07-13 19:29:06 +02:00
Greg Landrum
8559f5d3a9 Add a new tautomer mol hash (#6289)
* backup

* does not work

* backup

* passes all tests

send more tests!

* backup

* seems to mostly work
needs cleanup still

* more tests + python wrappers

* more testing

* some cleanup

* fix problem with newer boost

* be more expansive about unsaturation

* be symmetric in choosing the starting bond
fix a test error

* passes all tests;
passes ChEMBL regression test

* docs

* update cookbook

* expose the new hash function to the cartridge too

* support v2 hash in the registration hash

* better testing

* alternate, simpler approach for that

* remove vestigial docs
2023-04-26 16:57:39 +02:00
Iren Azra Azra Coskun
9c77556bf3 Support Pseudoatoms like Pol and Mod in the RegistrationHash (#6175)
* Stop using GetCanonicalSmiles

* SHARED-8633: Delete _GetCanonicalSmiles and remove unwanted cx extensions from tautomer has using rdkit functions

* Adding tests for matching and non-matching pseudoatom hashing cases

* SHARED-8633: Adding a test to ensure that passing in data field names allows data sgroups to be included in the hashing process

* SHARED 8633: small naming improvement

* Revert "SHARED-8633: Adding a test to ensure that passing in data field names allows data sgroups to be included in the hashing process"

This reverts commit 8f163ec1f7.

* Using a global variable for default cxflags

* Issue 6224: Adding a new optional parameter to the rdMolHash.MolHash function to allow customization of CXSmiles extensions. Also changed RegistrationHash.py tautomer hash calculation to use this new functionality

* Issue 6224: Extended CXSmile extension customization functionality to all the relevant functions in hashfunctions.cpp

---------

Co-authored-by: Iren Azra Coskun <coskun@Irens-MacBook-Pro-2.local>
2023-03-30 08:05:26 +02:00
Greg Landrum
d883803a4b stop caching ring-finding results (#5955)
* stop caching ring-rinding results

* add backwards incompatibility note

* changes in response to review
2023-01-11 09:32:54 -05:00
Greg Landrum
4bbbc6611d Add a CXSMILES option to the MolHash (#5058)
* Nonchiral atoms should be removed from StereoGroups

This fixes a bug where atoms which have no chirality were left in StereoGroups

In order to make this work, ROMol::setStereoGroups() needed to be made public.
That shouldn't be a problem since it doesn't change connectivity.

* support CXSmiles extensions in the hashes

* initial tests for that

* some cleanup

* copyright header cleanup

* minor refactoring

* call out the changes in the release notes

* extension and more testing

* add python wrappers
2022-03-03 16:00:38 +01:00
Ric
20e9086af6 fix + test (#4223) 2021-06-09 04:54:42 +02:00
Greg Landrum
2e3f31990d Allow batch editing of molecules: removal only (#3875)
* backup

* simple first pass, passes all tests

* cleanup a bunch of existing uses

* ensure that we can safely add atoms/bonds while in edit mode

* add context manager on python side

* handle exceptions properly in those

* changes in response to review
2021-03-11 05:10:43 +01:00
Eisuke Kawashima
75f03412ef Modernize deprecated header inclusion (#3137) 2020-05-04 10:40:57 +02: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
Greg Landrum
ec366c1ab7 Dev/pvs studio cleanups2 (#2877)
* a round of cleanups courtesy of PVS studio

* add a test to make sure that a warning is a false alarm

* bug fix

* Fix a UFF bug

* more PVS studio cleanups

* next round of PVS studio cleanups

* completely remove the chances for that bug

* changes in response to review

* add an additional test
+ a bit of reformatting that snuck in
2020-01-22 15:10:58 +01:00
Matt Swain
407058ab06 Fix MolHash compile with VS2015 - fixes #2752 (#2824) 2019-12-04 14:24:03 +01:00
Greg Landrum
7a266277fb A few MolHash fixes (#2699)
* do not remove multiple bonds that aren neither conjugated nor to heteroatoms

* unflag aromatic bonds

* remove bond stereo too

* call assignStereochemistry after the tautomer normalizations
2019-10-11 06:26:02 -04:00
Greg Landrum
5dfd67a22a Add new mol hashing code (#2636)
* copy in, get building, add some basic tests

* complete the testing
Except for regiosiomers, which do not work

* regioisomers work now

* backup commit; things work

* remove last of NM macros from hashfunctions.cpp

* remove last of NM macros from hashfunctions.cpp

* remove dependency on the abstraction layer

* typo

* start using namespaces
clang-format

* switch to using enums for the HashFunctions and StripTypes

* Add initial python wrapper (and tests)

* move the new hashing code to the MolHash library

still may want to revise the naming of this

* Setup deprecation of the older hashing code

* better release notes text

* change in response to review
2019-09-24 07:55:21 -04:00