* 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>
* 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
* 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>
* do not throw in desctructor
* remove unused var; reserve
* provide operator= for DiscreteValueVect
* provide operator= for SparseIntVect
* remove unknown 'omp' #pragmas; refactor loop
* remove unused var
* remove unused variables
* give EmbeddedAtom a default constructor & early exit on self assignç
* handle unused vars/args
* catch exception by ref
* address unused args
* fix signed type comparison; refactor extra checks
* remove unused variable
* suppress switch fallthtough warning
* handle signed type comparison
* handle signed type comparison
* potentially uninitialized vars
* fix abs() of bool
* unused vars in catch statements
* remove unused variables
* python::list returns will be copied
* give ValidationMethod constructor & virtual destructor
* remove extra semicolon
* Test only commit for using enhanced stereo in substructure search
Adds some test cases to demonstrate what I'm planning.
When the test cases fail, the messages look like this:
-------------------------------------------------------------------------------
Enhanced stereochemistry
AND and OR match their enantiomer
-------------------------------------------------------------------------------
/Users/wandschn/Documents/src/rdkit/Code/GraphMol/Substruct/catch_tests.cpp:216
...............................................................................
/Users/wandschn/Documents/src/rdkit/Code/GraphMol/Substruct/catch_tests.cpp:218: FAILED:
CHECK_THAT( *opposite_mol, IsSubstructOf(*mol_and, ps) )
with expansion:
CC[C@@H](F)[C@@H](C)O is not a substructure of CC[C@H](F)[C@H](C)O |&1:2,4|
/Users/wandschn/Documents/src/rdkit/Code/GraphMol/Substruct/catch_tests.cpp:219: FAILED:
CHECK_THAT( *opposite_mol, IsSubstructOf(*mol_or, ps) )
with expansion:
CC[C@@H](F)[C@@H](C)O is not a substructure of CC[C@H](F)[C@H](C)O |o1:2,4|
* rename parameter to include q and m to reduce my confusion
* Don't keep recreating a map
This map is the same in every loop. And actually, the desired
information is slightly different than what was formerly stored
in the map.
* Fix tests after our discussion.
Also adds more exciting tests of disastereomers and structures
with multiple stereo groups.
* Use enhanced stereochemistry in substructure searching
Allows use of enhaced stereochemistry in substructure searching
if `SubstructMatchParameters.useEnhancedStereo` is set.
The matching rules are pretty obnoxious, but a synopsis is:
* An achiral query/substructure matches everything, because it
means "ignore chirality".
* An absolute query matches AND or OR, because they both include
the molecule with an absolute center
* An query with an OR matches either an OR or an AND, because
AND is more molecules.
* add info about matching to the documentation
* expose extended stereo matching option to python
* Some updates/tweaks to the documentation of enhanced stereochemistry
especially about searching.
* Code review comments.
Co-authored-by: greg landrum <greg.landrum@gmail.com>
* backup, does not work
* working on the C++ side
* backup
* fix the API
* document the new functionality
* improve that example
* final bit of cleanup
* switch to std::function
* 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
* forward doIsomericSmiles
* added test for #2565
* fix for my snippet
* update test with Greg's comments
* add braces for readability to MolMatchFinalCheckFunctor
* small refactors: abstract label checking, while/size, final check
* merge loops reading order of bonds -- all tests pass
* fix chiral-lead fragments, allow frags w. degree < 3
* add new test, update old
* add test, update old
* fix (inocuous) bug with ranks assignment in MolToSmarts
* start SMARTS with first non-chiral atom
* use smart pointers in test
* reenable doIsomericSmiles
* update patch for #2594
* remove faulty fragments matching
* review tests, remove wrong flip
* 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
* boost::thread mostly gone... still need to get rid of once
everything compiles
* replace boost::call_once
* remove link-time dependency on boost::thread
* first pass at using async
* switch to using async everywhere
* 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
* very basics
* add the version to get all matches
* better exceptions, including tests
* documentation and actually add the test code
* responses to review
* add cis and trans to bond stereo
* compiles, does not work
* tests all pass
* Whitespace cleanup to recent changes.
* C++ test case for Bond::setStereo using Bond::STEREOCIS and Bond::STEREOTRANS
* Adding a PRECONDITION to Bond::setStereo to make sure the stereo atoms
are already specified if CIS or TRANS is being specified.
E/Z is technically defined by the topology of the molecule so the
stereo atoms are redundant (easier to understand and use!), but
ultimately redundant with the graph. However, CIS and TRANS is _only_
defined in this usage as the orientation of the atoms in the
getStereoAtoms vector.
* Exposing Bond::setStereo to Python and adding test cases to make sure
it can be used to set CIS/TRANS stereochemistry.
* verify substructure matching works
* Adding Bond::setStereoAtoms to C++ Bond class.
This allows setting the atoms to be considered for CIS or TRANS
directly without a much more costly determination of ranking that E/Z
requires.
* Wrap Bond::SetStereoAtoms into python with a new type of test case.
* docs
enumeration is only carried out when the user asks for a structure
or when the user explicitly request that calling the enumerate()
member function. This makes object creation fast and enables
calling getNumConjGrps(), getBondConjGrpIdx() and getAtomConjGrpIdx()
member function without incurring in the cost of necessarily
enumerating resonance structures
- fixed some int/unsigned int inconsistencies
- now bonds and atoms with do not belong to conjugated groups
get a -1 index
- added a few Python wrappers
- added a few tests
- removed unused variables from Code/GraphMol/ForceFieldHelpers/MMFF/Builder.cpp
- fixed ResonanceMolSupplier Java wrappers which were really broken
- added threading support to the ResonanceMolSupplier-enabled
SubstructMatch() and relevant tests
- modified/removed some code in O3AAlignMolecules.cpp which doesn't
seem necessary anymore
- modified Code/GraphMol/CMakeLists.txt to allow building
on Windows
as conjugated like their oxygen analogs
- fixed an issue with large numbers of resonance structures exceeding
the unsigned int allowance
- implemented the uniquify feature properly
- uniquify now defaults to false when using the ResonanceMolSupplier-
enabled SubstructMatch() version
- the concept of 'laziness' is now clearer
- TODO:
* remove some debugging info
* move classes from .h to .cpp
* SWIG wrappers
* improve resonance structure sorting for degenerate resonance
structures
I will do all of the above ASAP
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%)
smarts queries run faster (like vector bindings). Though there is an addition to the smarts parser
exposed here, I do not recommend using it in client code.