Commit Graph

30 Commits

Author SHA1 Message Date
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
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
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
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
Ric
696de2e187 fix typo (#2593) 2019-08-09 07:36:04 +02: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
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
87786c08b5 Merge branch 'master' into modern_cxx
# Conflicts:
#	.travis.yml
#	Code/GraphMol/FileParsers/MolFileParser.cpp
#	Code/GraphMol/FileParsers/MolFileStereochem.cpp
#	Code/GraphMol/ForceFieldHelpers/UFF/testUFFHelpers.cpp
#	Code/GraphMol/MolAlign/testMolAlign.cpp
#	Code/GraphMol/MolDraw2D/MolDraw2D.cpp
#	Code/GraphMol/MolDraw2D/Wrap/rdMolDraw2D.cpp
#	Code/GraphMol/QueryOps.cpp
#	Code/GraphMol/ROMol.cpp
#	Code/GraphMol/SmilesParse/test.cpp
#	Code/GraphMol/Trajectory/Trajectory.cpp
#	Code/GraphMol/Wrap/Atom.cpp
#	Code/GraphMol/Wrap/Bond.cpp
#	Code/GraphMol/new_canon.cpp
#	Code/RDGeneral/testDict.cpp
#	Code/SimDivPickers/Wrap/MaxMinPicker.cpp
2017-10-05 05:58:38 +02:00
Greg Landrum
769e6648e4 Fixes #1489 (#1556)
* move the describeQuery functions to the RDKit namespace.
They are generally useful

* Fixes #1489
2017-09-11 08:34:25 -04:00
Greg Landrum
915cf08faa run clang-format with c++-11 style over that 2017-04-22 17:19:10 +02:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +02:00
Greg Landrum
0eb715ed5e initial pass at dative directions (#1254) 2017-01-27 17:25:58 -05:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Brian Kelley
95a92282d1 Dictionary access is saniztized and optimized.
o rdkit gains a RDKit::common_properties namespace that contains common string value properties

 o Dict.h and below gain getPropIfPresent that attempts to retrieve a property and returns
  true/false on success or failure.  This is used to optimize access.

 o rdkit learns how to pass property keys by reference, not value.

A new namespace has been added to RDKit, common_properties
that contains the std::string values for commonly used
properties.  This helps to avoid typos in string values
but also avoids a creation of std::strings from character
values.  All accessors (has/get/clear and getPropIfPresent) now pass
the key by reference.

Additionally, getPropIfPresent removes the double lookup
of hasProp/getProp which can be a significant speedup
in the smiles and smarts parsers (10-20%)
2015-01-15 12:23:29 -05: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
3b3d44db16 remove exe property from source files 2011-01-13 04:22:56 +00:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +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
88d596abca get the AR_MOLGRAPH caching write with substructs; the current implementation introduces a core leak, so it is disabled by default 2006-10-19 05:24:05 +00:00
Greg Landrum
5d03333c22 setup svn keywords (should have done this before import... grn) 2006-05-06 22:54:39 +00:00
Greg Landrum
75a79b6327 initial import 2006-05-06 22:20:08 +00:00