65 Commits

Author SHA1 Message Date
Greg Landrum
e35f7db009 Cleanup/get atoms and bonds (#9243) 2026-04-18 05:22:09 +02:00
Ricardo Rodriguez
af4e8cf01f propagate string_view (#8858) 2025-10-14 19:15:37 +02:00
Hussein Faara
44364fd982 remove no-op macros and dead code (pt 4) (#8037)
* remove no-op macros and dead code (pt 4)

* review comments
2025-01-26 07:49:50 +01:00
Greg Landrum
b1663052b8 Remove Descriptors as a dependency of many other RDKit libraries (#7700)
* move mol weight and formula calculators to MolOps and refactor them a bit.
The descriptors are still there and should remain.

* remove other unnecessary dependencies on Descriptors

* Update adapter.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

---------

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2024-08-13 13:22:43 +02:00
Greg Landrum
ac54eb3209 Add an in place version of most of the MolStandardize functionality (#6491)
* reionizer and uncharger and normalizer can now operate in place

* add removeUnmatchedAtoms argument to in-place version of runReactant

When set to false atoms which are not explicitly removed by the reaction are preserved

* Fix a case where transforms were incorrectly updating atomic numbers

* add more inplace operations to MolStandardize

* support those in the Python layer

* support inplace for the rest of the python wrappers

* move a few more functions over to the inplace code
2023-07-21 08:44:41 +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
Alan Kerstjens
a860d16700 Add multi-template isMoleculeXOfReaction overloads (#5171)
* Add multi-template isMoleculeXOfReaction overloads

* Refactored isMoleculeXOfReaction overloads to remove code duplication

* Added tests for multi-template isMoleculeXOfReaction overloads

* Added negative tests for isMoleculeXOfReaction

Co-authored-by: Alan Kerstjens <alan.kerstjens@uantwerpen.be>
2022-04-12 05:32:24 +02:00
Greg Landrum
e970148830 Allow applying single-reactant/single-product reactions in place (#4511)
* minor preparatory refactor

* add test

* add reaction literals

* tests for the new literals

* add runReactant
first steps to making things work

* remove works

* backup

* all current tests passing except bond-order changes
some atom-property copying fixed

* bond changes now work

* handle atomic stereo

* some cleanup and more tests

* docs

* not-working

* add KekulizeIfPossible()

* return a value from KekulizeIfPossible

* Revert "not-working"

This reverts commit 2ebd8a5519.

* add in-place reactions to python wrapper

* simplify deprotection wrapper code

* support in-place deprotection

* changes in response to review

* forgotten change
2021-09-26 14:35:23 -04: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
Greg Landrum
73d26036de Support enumerating some mol file features into MolBundles (#3257)
* backup

* compiles

* progress, but not there yet

* basics now working

* start towards adding another test

* test having two variation points

* add actual enumeration and the corresponding tests

* docs and cleanup

* cleanups to get the mac build working

* attempt to get win32 dll builds to work

* dlls are fun

* Add FixedMolSizeMolBundle class

* changes in response to review

Also: add warnings for bad input in ParseV3000Array

* a bit of refactoring

* additional testing

* does not work, backup

* LINKNODES work now

* cleanup

* allow silencing reaction validation warnings during initialization

* docs

* fix (and test) handling of empty enumerations

* silence warnings when doing alchemy

* first pass at a Python wrapper for the enumerator

* Add Java wrappers for MolBundle and the MolEnumerator

* cleanup some comment formatting
2020-07-11 12:54:23 +02:00
Greg Landrum
b77d67893d fixes #3119 (#3130) 2020-05-07 12:52:46 -04: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
920bf6b300 Fixes #2604 (#2689)
* Fixes #2604

* Changes in response to review

* Fixes #2709

* add tests
2019-10-13 09:33:10 -04:00
Brian Kelley
28bd1e5b55 Add a default for maximum products generated by a reaction (maxProducts=1000) (#2069) 2018-09-29 07:13:11 +02:00
Greg Landrum
dfae8377dd Some optimization of the queries constructed from SMARTS (#1940)
* Fixes #1929

* add a tests to make sure bogus template directories work

* add a combined atomic number + aromaticity query operation to speed up SMARTS matches
Still needs to be recognized by the SMARTS writer, serialization, and no doubt a few other places.

* add a combined query for the single/aromatic bond query that shows up in SMARTS

* Stop using a dead pointer in the when parsing Marvin SMARTS in a CTAB

* At this point all tests pass on windows

* debugging info back in

* update the bison output
2018-06-30 20:22:06 -04: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
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
d3ad7d2770 Fixes #1387 (#1392)
* backup

* Fixes #1387
this passes the bug tests, but needs the full tests run

* all tests pass

* remove some droppings left from an earlier attempt at a fix

* remove some additional printing

* cleanup
2017-04-07 11:57:43 -04:00
Brian Kelley
a02f2b0bb1 Fix/sanitizerxn merge hs (#1367)
* Fixes exceptions to use correct functionName

* Deprecates ChemDrawAdjustParams name sciquest integration/eln searching
 doesn’t map to this behavior.  renamed  MatchOnlyAtRgroupAdjustParams

* Python wrapper for deprecated API

* fixHs now is more intelligent about merging hs.

The only cases where hs can’t be merged is if they are mapped
to a non hydrogen in the product.

* Updates deprecated ChemDrawAdjustParams
2017-03-20 14:30:36 +00:00
Greg Landrum
3e5605e793 Fixes #975 (#976) 2016-07-21 15:22:32 -04:00
Nadine Schneider
7a109aea89 Add some utils functions to ChemReactions
Chemical reactions: provide function to re/move agents
Chem Reactions: Add utils function to remove atom-mapping numbers
2016-04-01 10:14:21 +02:00
Brian Kelley
cad0e0a589 Adds runReactant (create a product with only one reagent
specified)
Adds reduceProductToSidechains which extracts the side chains
 from a product generated from a reaction.
2015-12-17 11:34:32 -05:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Brian Kelley
6ebbeb3bd3 Major conversion of std::string API to const std::string & 2015-09-25 15:15:59 -04: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
Schneider
8aac978f1b ChemReactions: Extented functionality of chemical reactions
- Module to generate reaction fingerprints: structural FP for screening,
  difference FP for similarity search
- Add some utility functions to simplify handling of reactions
- Add new functionality to include agents in the reactions, some adaptions
  to parsers and writers had to be done
- Supports intra-bond breaks in products now
- Molecules with rxn role (atom property) can be parse as reaction now
2014-08-19 13:08:11 +02:00
Greg Landrum
5586330f16 Fixes #243 2014-04-13 07:15:35 +02:00
Greg Landrum
296bbfb65b Fixes #228 2014-03-05 05:48:17 +01:00
Greg Landrum
5904be011d update reaction stereochem handling (needs more work) 2013-04-06 06:39:22 +00:00
Greg Landrum
0a1621e97d fix and initial tests for github issue 4 2013-02-09 07:26:49 +00:00
Greg Landrum
03ef0e6f1b Add support for merging recursive queries on the C++ side
(contribution from Sereina Riniker)

A pure Python version of this was in the tutorial material from the RDKit UGM.
2013-01-08 15:13:01 +00:00
Greg Landrum
009f7259a2 support _protected flags in reactions 2012-12-01 06:26:50 +00:00
Greg Landrum
6e2508972c all tests passing 2012-04-21 05:37:34 +00:00
Greg Landrum
e7d25d7973 tests passing except reactions 2012-04-21 04:40:55 +00:00
Greg Landrum
6229f639a5 clean up some debugging printing; get the handling of the sanitization options more robust on windows; this needs testing back on mac and linux 2012-04-12 04:23:41 +00:00
Greg Landrum
dd609388e4 further improvements to getReactingAtoms() 2012-01-19 08:43:57 +00:00
Greg Landrum
e8cb290f18 add an initial pass at getReactingAtoms() for reactions 2012-01-18 05:52:38 +00:00
Greg Landrum
5e49aacd06 fix and test issue 3434271 2011-11-07 05:08:35 +00:00
Greg Landrum
2bc9481be8 further work on the SMARTS parser: support [13] as a free-standing query and update the reaction code so that the resulting queries work correctly in reactions 2011-10-29 05:51:05 +00:00
Greg Landrum
2cea8b58b4 fix for issue 3140490 2010-12-20 05:00:23 +00:00
Greg Landrum
18a8be8538 add isMoleculeReactantOfReaction() and isMoleculeProductOfReaction() convenience functions 2010-08-21 00:16:02 +00:00
Greg Landrum
2805355f34 First pass at the rewrite:
this gets rid of all the "preceding atom" code and passes all tests on linux

builds on other OS's and more extensive regression testing is required
2010-05-31 14:08:11 +00:00
Greg Landrum
1896aac566 transfer conformer data to products in reactions; sf.net issue 2832951 2009-08-06 04:39:04 +00:00
Greg Landrum
7fdece9cd7 initial pass at supporting reaction pickles 2009-06-02 05:06:06 +00:00
Greg Landrum
73784d8f6f fix a problem with transfer of aromatic bond info to products 2009-03-04 16:14:56 +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
82661fb59b partial fix for sf.net issue 2540021;
valence changes caused by modifying bond orders still not handled
2009-02-02 05:30:26 +00:00
Greg Landrum
e1a4c98503 enforce reaction initialization requirement 2008-11-26 10:44:56 +00:00
Greg Landrum
1e5f0afcf6 fix handling of properties in the products 2008-11-26 07:41:33 +00:00