Commit Graph

164 Commits

Author SHA1 Message Date
Hussein Faara
6f60a99468 remove no-op macros and dead code (pt 4) (#8037)
* remove no-op macros and dead code (pt 4)

* review comments
2025-01-30 06:28:59 +01:00
Brian Kelley
21b79c13e2 Simple fix to allow aromatic CIS/TRANS SMARTS to match molecules (#8192) 2025-01-30 06:10:22 +01:00
Greg Landrum
d38a5a205a Fixes #8162 (#8164)
* remove extraneous printing

* Fixes #8162
2025-01-30 05:52:44 +01:00
Greg Landrum
0dfc28f656 allow specified chiral features to SSS match unspecified features (#8115) 2024-12-20 08:44:42 +01:00
Ricardo Rodriguez
0baaf75353 Fix some minor issues reported by ubsan and the compiler (#8015)
* initialize chiralityPossible

* fix build warning

* Fix integer overflow

* fix downcasting MarvinMolBase to MarvinMol

* Fix buildwarning

* increase PairList container to 64 bit

* fix testDict

* Update Code/RDGeneral/testDict.cpp

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

* Update Code/GraphMol/CIPLabeler/rules/Pairlist.h

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

* Update Code/GraphMol/CIPLabeler/rules/Pairlist.h

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

* Fix catch_tests.cpp

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-11-28 07:28:31 +01:00
Brian Kelley
c821750712 GitHub 7865 haspropwithvaluequery leaks (#7872)
* Properly cleanup Dict::Pair when serializing HasPropWithQueryValue

* Make sure pickling doesn't change original molecule

* Fix bad cut and paste

* Add PairHolder utility class for memory management of non Dict Dict::Pairs, fix mem leak in pickler

* Edit comment to force a rebuild

* Ignore PairHolder from Java/Swig builds

* Ignore PairHolder API from swig

* Reponses to review

* Add backward incompatible change

* Make release note a bullet point
2024-11-28 07:14:35 +01:00
Ricardo Rodriguez
dc366cd459 Fixes #7685 (#7864)
* replace lists with vectors

* remove redundant assign loop
2024-10-25 05:03:19 +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
Brian Kelley
fa0463a591 Adds HasPropWithValue Pickler (#7692)
* Adds HasPropWithValue Pickler

* Revert changes

* Resolve review comments

* more comprehensive testing

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-08-26 16:27:58 +02:00
MarioAndWario
643a356e44 Fix Mol block parser by resetting atomic number to 0 for COMPOSITE_OR query atoms (#6349) (#6768)
* Fix Mol block parser by resetting atomic number to 0 for COMPOSITE_OR query atoms (#6349)

* Fix fileParsersTest1

* Fix test23MolFileParsing

* Fix testRGroupDecomp

* Fix testSubstructMatch

* Use std::unique_ptr instead of raw pointer

* Add isAtomDummy() to QueryOps.h

* Add `!a->getQuery()->getNegation()`
2024-01-23 17:13:53 +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
Ric
9c1d1a84f4 Fixes #6983 (#6984) 2023-12-16 08:06:11 +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
Greg Landrum
4a69bc3493 Fixes #6017 (#6825)
* Fixes #6017

* a bit of cleanup work

* remove unused variable

* change in response to review
switch to using std::max(maxMatches,maxRecursiveMatches)

* test the case where maxSubstructMatches<maxMatches
2023-10-25 04:57:29 +02:00
John Mayfield
dd475b3677 Fix chirality handling when the chiral atom is the first one in a SMARTS (#6730)
* Set _SmilesStart when parsing SMARTS.

* SmartsWriter should also invert first atoms, like SMILES.

* Update test cases now these SMILES match themselves as SMARTS.

* rerun bison

* cleanup a possible repeated define

* When an atom moves from the first to second position winding should flip in SMARTS (i.e. same as SMILES).

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-10-05 06:02:49 +02:00
Paolo Tosco
a384878fbe avoid leaking memory in case exceptions are thrown while generating FPs (#6630)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2023-08-15 04:59:14 +02:00
Rachel Walker
70427aa9b4 Add atom and bond property parameters to substruct matching (#6453)
* Add atom and bond property parameters to substruct matching

* use getPropIfPresent in propertyCompat

* fix typo

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

* Update Code/GraphMol/Substruct/SubstructUtils.cpp

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

* Update Code/GraphMol/Substruct/SubstructUtils.cpp

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

* added python tests

* Add PRECONDITIONs

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

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2023-06-15 05:08:48 +02:00
Paolo Tosco
f43c96e442 - when allowRGroups and allowOptionalAttachments are true, bonds connecting R groups to the scaffold should match single or aromatic (#6306)
- added relevant unit tests

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-05-13 05:54:15 +02:00
Ric
880a8e5725 Reformat Python code for 2023.03 release (#6294)
* run yapf

* run isort

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2023-04-28 06:53:56 +02: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
Paolo Tosco
2aa4fe743d - allowRGroups now also includes terminal query atoms matching hydrogen in additional to terminal dummy atoms (#6280)
- added relevant unit tests

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-04-12 06:26:54 +02:00
Greg Landrum
71051cde10 Fixes #6211 (#6250)
* backup

* basic tests pass

* add JSON out to substruct match parameters

* serialize the substruct match parameters in reactions

* add that to the python wrapper

* more testing
2023-04-05 19:08:37 +02:00
Franz Waibl
c99115e4b1 Remove check for ring information from Atom::Match (#6063)
In high-symmetry cases where the symmetric SSSR does not find all
possible rings, substructure searches can fail because of this check.
Removing it fixes those cases, but is likely to decrease the performance
of substructure matching.

Also, adds a unit test where the old code fails

Co-authored-by: Franz Waibl <waiblfranz@gmail.com>
2023-02-08 04:30:05 +01:00
Greg Landrum
4e1a590b9f Fixes #888 (#6018)
* Fixes #888

* support older versions of boost
support for hashing dynamic_bitset was not added until v1.71

* changes in response to review
2023-01-30 17:18:22 +01: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
Greg Landrum
594c58f86c make the catch tests build faster (#5284)
* reorg the catch tests
the goal here is to make the builds faster

* make that easier
2022-05-17 04:39:33 +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
Greg Landrum
00f23b5047 [WIP] Clean up the warning landscape (#5048)
* suppress a bunch of warnings from third-party code
get rid of one warning in RDKit code

* corrections

* fix the maeparser flags

* remove some more inchi warnings with clang
2022-03-01 05:00:25 +01:00
Brian Kelley
866e0f19f0 silence warnings in MSVC compliatons (#4796) 2021-12-15 04:54:11 +01:00
Greg Landrum
ff1ea80eca fix typos (#4769) 2021-12-06 09:34:33 +01:00
Greg Landrum
52f73e4be0 Add support for Beilstein generics when doing substructure queries (#4673)
* backup commit
This is mabye heading in the right direction and at least passes the basic tests which are there.

* some progress

* more tests and refactoring

* additional aliases
add carboaryl

* add CYC and ACY

* add ABC

* add AHC

* CBC and AOX

* add CHC and HAR

* add CXX

* cleanup: remove a bunch of nullptrs

* initial tagging support

* remove atom labels/sgroups after using them

* docs

* start handing writing

NOTE: this does not currently work: the generic code needs to move out of SubstructSearch

* move the generic groups to their own library

Signed-off-by: greg landrum <greg.landrum@gmail.com>

* make sure the generic groups end up in ctabs

* add forgotten CMakeLists.txt

* fix includes

* expose this stuff to Python

* CYC needs to initialize rings

* renaming

* add docs

* change in response to review
2021-12-01 06:01:53 +01:00
Brian Kelley
cc5a941269 Recursive Substructure Search Deadlock (#4656)
* fixes #4651

* Remove unused import

* Switch to RAII

* clang-format

* Response to review

* Response to review - remove prints, use assertRaises
2021-11-08 06:30:14 +01:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Ric
878c4c7ec0 save one search (#4566) 2021-09-28 04:37:24 +02:00
Ric
6db202aa0d Improve performance of removing substruct/tautomer duplicates (#4560)
* improve removeDuplicates performance

* improve removeTautomerDuplicates performance

* use std::set
2021-09-25 15:45:55 +02:00
Ric
2c7485fef5 Fixes #4558 (#4559)
* fix

* add test
2021-09-25 15:45:30 +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
Paolo Tosco
3904b6958d Fixes RDK_BUILD_THREADSAFE_SSS=OFF build (#4349)
* - fix non-threaded *nix builds that currently fail because
  boost flyweight introduces a dependency on pthreads
- make sure that mutexes and futures are only used when
  RDK_BUILD_THREADSAFE_SSS is ON
- fix SubstructMatch failing test when RDK_BUILD_THREADSAFE_SSS is OFF
  due to misplaced #ifdef's
- rename RDK_TEST_MULTITHREADED to RDK_THREADSAFE_SSS in inchi.cpp
  (which is not a test)

* - the limitexternal Linux build is now single-threaded so we make
  sure single-threaded builds do not break in the future
  (suggestion from Greg)

* reverted unnecessary change to Code/GraphMol/FileParsers/testMultithreadedMolSupplier.cpp

Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
2021-07-23 14:25:25 +02:00
Paolo Tosco
4451bcde67 Make sure that ResonanceMolSupplier substructure matches are uniquified consistently (#4274)
* make sure that ResonanceMolSupplier subtructure matches are uniquified consistently

* Fixes github #4311 (#4312)

* a bit of simple refactoring

* Fixes #4311

- adds getValenceContrib() to QueryBond
- adds hasBondTypeQuery() and hasComplexBondTypeQuery() to QueryOps namespace
- atoms with complex bond type queries now have explict and implicit valences of 0
- adds tests for the above

* add a test

* 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.

* addressed comments in review

Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-07-13 06:54:07 +02:00
Eisuke Kawashima
013ba4f21d Run clang-tidy (modernize-use-override) (#4251) 2021-07-01 05:18:56 +02:00
Eisuke Kawashima
48f4f3ee82 Run clang-tidy (modernize-pass-by-value) (#4224) 2021-06-14 06:57:08 +02:00
Eisuke Kawashima
78aac3c1bc Run clang-format against header files (#4143) 2021-06-08 07:57:51 +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
Greg Landrum
b6515eaade Fixes #4138 (#4145)
adds a short-circuit test to the substructure matching so that it immediately returns an empty result set if either the molecule or the query is empty
2021-05-18 08:44:12 -04:00
Greg Landrum
f829c877d8 MinimalLib: add CFFI interface (#4018)
* hello world works

* more

* more
minimallib needs to be tested

* parse substructure parameters from JSON

* add substruct search and parameters

* add descriptors

* register more descriptors

* fingerprints, first pass

* stop outputting tiny coord vals

* support generating 2d coords

* coordgen testing

* return nulls

* initial 3d support; add/removeHs; cleanup

* Embedding parameters from JSON

* update

* pattern fp, fps as bytes

* use json to configure MFP

* use json to configure rdkit and pattern fps

* aligned 2d coords

* parsing options

* options for writers

* rename remove_hs

* get this working on windows (kind of)

* silence some msvc warnings

* cmake updates

* update python tests

* add the CFFI code to CI builds

* cleanup line ending mess?

* a couple small fixes

* make this work with URF

* support coordMap in the 3D coordinate generation

* updates in response to review
2021-04-15 21:33:52 +02:00
Paolo Tosco
19c9a3905c Enhanced generateDepictionMatching2DStructure functionality (#3811)
* - generateDepictionMatching2DStructure can be used with referencePattern smaller than reference
  to only use part of a scaffold
- adds generateDepictionMatching2DStructure overload to pass a matchVect instead of doing a substructure match
- adds allowRGroups parameter to enable using a scaffold bearing R groups as reference

* changes in response to review

* added comments

* fixes failing doctest

* - reverted change committed accidentally
- fixed get_sss_json for the case where R groups are not included in the match
- added tests for the return value of generate_aligned_coords

* Documented the value returned by GenerateDepictionMatching2DStructure (Python)

* changes in response to review

* - changes in response to review
- fixed sortMatchesByDegreeOfCoreSubstitution that was not working
- added Python wrappers for sortMatchesByDegreeOfCoreSubstitution and getMostSubstitutedCoreMatch
- added C++ and Pyhon unit tests for the above

* added missing variable initialization

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2021-02-24 05:37:31 +01:00
Ric
703fe5a225 Remove boost::foreach from public headers (#3820)
* remove include from headers

* update implementation files

* completely remove BOOST_FOREACH (#7)

* convert those changes to use auto

* get rid of all usage of BOOST_FOREACH

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-02-17 14:15:48 +01:00
Brian Kelley
728bb8defe Fixes #3403 (#3405)
* Fixes #3403

* Fix Typo

V is actually a set so we can clear it.

* Fix bug, use self.assertFalse
2020-09-10 08:11:47 +02:00
Greg Landrum
c0a62388a2 switch to using target_compile_definitions instead of add_definitions (#3350)
* switch to using target_compile_definitions instead of add_definitions

* missed one
2020-08-21 04:49:07 +02:00
jones-gareth
21a8a263bd Tautomer search (#3205)
* TautomerQuery class

* working test

* Comment header

* Merge with master. Greg's suggestions. More tests. Python wrapper

* Updated Pattern Fingerprints to merge with master. Reset email

* Java/C# wrappers. Java test

* Java/C# wrappers. Java test

* Java/C# wrappers. Java test

* Greg suggestions of 6_2_2020

* Explicit types in Java TautomerQueryTests class

* Update Code/GraphMol/QueryOps.h

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

* get windows dll builds working

* Removed tautomer query wrappers from RDKit namespace

* Fixes from evaluation

* Template molecule identification fix. Greg's suggestion

* Final check search functor for evaluating template matches as they are found

Co-authored-by: Gareth Jones <gjones@glysade.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2020-06-24 17:27:40 +02:00