Commit Graph

22 Commits

Author SHA1 Message Date
Greg Landrum
a9477d2694 Modernization of some substructure code (#8450)
* use std::span for substruct match callbacks

This removes a copy from every evaluation of potential matches

* some cleanup/modernization

* some modernization

* deprecate chiralAtomCompat

* small optimization

* remove naked pointers

* improve new_timings.py script

* changes suggested in review

* response to review

* response to review
2025-05-12 06:33:25 +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
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
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
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
Greg Landrum
a102eaf932 Add options for substructure searching (#2254)
* first pass at adding a SubstructMatchParameter struct

* start moving the rest of the backend to use the parameters

* backend at least mostly moved over

* add aromaticMatchesConjugated
add tests

* switch over the MolBundle too
Add templates to reduce duplicated code

* support older compilers

let's see if it works...

* add SubstructMatchParameters to Python wrapper

* remove some deprecations and warnings

* damn compilers

* parameter support for bundles in python wrapper

* add the parameters to the java wrappers

* response to review
2019-02-08 09:10:10 -05:00
Greg Landrum
2738c35178 Fixes #1903 (#1971)
* Fixes #1903

* update SWIG bindings too
2018-07-25 09:14:17 +02:00
Paolo Tosco
c08ea49bda - enable building DLLs on Windows (#1861)
* - enable building DLLs on Windows

* - export.h and test.h are now auto-generated by CMake
2018-05-16 08:42:41 +02:00
Greg Landrum
ba12d98ad0 Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers (#1713)
* Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers

* Actually delete atoms and bonds...

* RWMol::clear now calls destroy to handle atom/bond deletion

* Changes broken Atom lookup for windows/gcc

* Adds tests for running with valgrind

* Adds test designed for valgrind and molecule deletions

* Removes RNG, actually tests bond deletions

* update swig wrappers

* deal with most recent changes on the main branch
2018-01-07 14:19:47 -05:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
c26cbc26cb switch to using references to smart pointers for the Match functions;
really ought to re-examine when/how we are passing smart pointers
 around in general, but that is a bigger job.
Ref: http://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/
2014-05-10 06:21:27 +02:00
Greg Landrum
34ab68ca2a introduce QueryBond::QueryMatch, as with QueryAtoms;
all tests passing;
performance tests still needed
2014-05-07 05:29:25 +02:00
Greg Landrum
4a14a52674 Fixes #153 2013-11-15 06:47:18 +01:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
052ec66542 cleanups:
remove x bit from headers and sources;
remove a couple empty files from Code/GraphMol
2010-09-08 04:25:57 +00:00
Greg Landrum
ec2c2042e8 remove the vflib usage code from Substruct area 2010-04-19 07:45:22 +00:00
Greg Landrum
44b5041ef2 fix and test sf.net bug 2884178 2009-10-24 06:01:32 +00:00
Greg Landrum
f3dc387bc4 merge changes from revs991:996 on Ullmann_9Feb2009 branch;
get USE_VFLIB fulling working and make it the default
2009-02-28 16:52:06 +00:00
Greg Landrum
e05580e495 This is a sizeable one: change the way BGL is used so that atoms and bonds are stored as bundled properties
instead of using the property map interface.
A nice side-effect is that the wart of having to use property maps to loop over bonds or atom neighbors
is now gone.
This potentially breaks lots of client C++ code.
2009-02-11 20:19:25 +00:00
Greg Landrum
30fe77b609 initial commit: passes all tests and seems to be faster than the original code 2009-02-09 16:19:31 +00:00
Greg Landrum
d5ffea669d add support for chirality in substructure searches;
this only is going to work in cases where CIP codes have been (i.e. can be)
assigned to atoms.
2006-11-03 06:35:14 +00:00
Greg Landrum
75a79b6327 initial import 2006-05-06 22:20:08 +00:00