28 Commits

Author SHA1 Message Date
Greg Landrum
09aa009f19 [v2 API] reaction parsers (#7138)
* basic approach to v2api

* does not work, backup commit

* well, that now compiles

* cleaner

* more cleanup and testing

* get the SWIG wrappers to build

* swig wrappers now build

* switch back to using references to default values

* adjust to new catch version

* move the implementation to v2 and call it from v1

* update the parameter object too

* move debugParse down

* a couple of review changes

* make v2 naming consistent with Python

* first pass at v2 for the ctab parsers

* move a the writing functionality to a different header

this is just an organizational thing at the moment; we still import the writers header in the parsers header so as to not break code

* do v2 of the tpl parser

* fix missing dependency

* Mol2 parser

* move over the XYZ parser

* switch over the PDB parsers too

* get mac and java builds working (hopefully)

* add v2 API for the reaction parsers

Fixes #7075

* v2 of the fileparser API about done

This cannot be completed until the CDXML changes are merged
2024-02-07 17:41:01 +01:00
Greg Landrum
2616a92906 Support CXSMILES/CXSMARTS for reactions (#4895)
* start with some basic tests
these currently fail, of course

* prep work

* minor refactoring and prep work

* get better at handling spaces

* first pass, needs completion and testing
loads more testing required
coordinate bonds don't work at all yet
I'm suspicious about the SGroup hierarchy

* more progress
agents and products are now parsed
more testing added
way more testing needed

* correctly ignore names
test cleanup

* more sgroup improvements and testing
now I think most everything is there and the basics are tested

* all tests pass

* link nodes and variable attachment points

* more cleanup and testing

* changes in response to review
2022-01-26 08:52:10 +01:00
Greg Landrum
97a609f211 Fixes #4759 (#4760)
* Fixes #4759

* add forgotten warning

* handle spaces after the >>

* be more explicit
2021-12-03 17:42:32 +01:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Ric
39bcee635e Mem checkup (#3083)
* clean up in testDatastructs

* avoid jump on unassigned mem in rxns

* set valgrind error exit code

* update suppressions

* clean up RDValue in testDict

* don't leak mol if parsing Maestro file fails

* don't leak mol if parsing PDB block fails

* cleanup leftover rxns in testReaction

* cleanup mol if CX extensions cannot be parsed

* cleanup leftover mols in smiTest1

* cleanup leftover mols in moldraw2DTest1

* cleanup leftover mols in testSubstructMatch

* make testEnumeration go easier on valgrind

* reduce R counts
2020-04-17 17:48:58 +02:00
Manan Goel
4d96356067 Fixes #2954:Rxn Smarts with Dative Bonds not parsed (#3050)
* This commit fixes #2954:Rxn Smarts with Dative Bonds not parsed
Implemented an approach which does not use std::string::find to find ">" occurrences. The new implementation checks the chracters around ">" and seperates the reactants and products accordingly

* made suggested changes
2020-03-31 15:02:07 +02:00
Ric
a6b26253ff Fix (most of) mem problems (#2123)
* do not use new on loggers

* del pointers in testDistGeom

* Update Dict hasNonPOD status on bulk update

* delete new Dicts in memtest1.cpp

* fixes in MolSuppliers and testFMCS

* PeriodicTable singleton as unique_ptr

* fix EEM_arrays leak

* fix leaks in testPBF

* fix ParamCollection leak in test UFF

* fix leaks in MMFF

* clear prop dict before read in in pickler

* fix leaks in testFreeSASA

* fix leaks in test3D

* modernize Dict.h & SmilesParse.cpp

* fix leaks in testQuery

* fix leaks in testCrystalFF

* fix leaks in cxsmilesTest

* fix leaks in Catalog & mol cat test

* fix leaks in ShapeUtils & tests

* fix leaks in testSubgraphs1

* fix leaks testFingerprintGenerators

* fix leaks in Catalog/FilterCatalog

* fix leaks in graphmolqueryTest

* these changes reduce bison parse leaks

* fixed leaks in testChirality.cpp

* fix leaks + 2 tests in testMolWriter

* fix 4m leaks in substructLibraryTest

* small improvements to molTautomerTest; still leaks

* fix leaks in testRGroupDecomp

* fix leaks in test; parser still leaks

* fix leaks in itertest

* fix 4m leaks in testDepictor

* fixes in smatest; still leaking due to parser

* fixes in testSLNParse; still leaking due to parser

* flex/bison: always add atoms with ownership; smarts error cleanup

* fix leaks in testReaction

* fix leaks in testSubstructMatch

* fix leaks in resMolSupplierTest

* fix leaks in testChemTransforms + bug in ChemTransforms

* fix leaks in testPickler

* fix leaks in testMolTransform

* fix leaks in testFragCatalog

* fix leak in testSLNParse. Still leaks due to Smiles

* fixed most leaks in testMolSupplier

* pre bison fix

* fix some atom & bond parse problems; others still fail

* bison smiles & smarts, atoms & bonds more or less fixed

* fix leaks in molopstest.cpp

* fix leaks in testFingerprints, MACCS.cpp & AtomPairs.cpp

* fix leaks in moldraw2Dtest1

* fix leaks in testDescriptors

* fix leaks in testInchi

* fix leaks in testUFFForceFieldHelpers

* fix leaks in hanoiTest & new_canon.h

* fix leaks in testMMFFForceField

* fix leaks in graphmolTest1

* fix leaks in testMMFFForceFieldHelpers

* fix leaks in testDistGeomHelpers

* fix leaks in testMolAlign

* initialize occupancy & temp facto with default values

* fix leak in TautomerTransform

* updated suppressions

* fix testStructChecker

* fix logging & py tests

* fix TautomerTransform class/struct issue

* remove misplaced delete in testSLNParse

* deinit in testAvalonLib1

* fix Avalon-triggered(?) bug in StructChecker/Pattern.cpp

* fix random testMolWriter/Supplier fails

- diversify output file names to avoid clashing.
- unify Writers close/destruct behavior.
- flushing/closing in tests.

* use reset in FFs Params.cpp

* comments on testMMFFForceField

* unrequired 'if's added to mol suppliers

* correct cast in FilterCatalog.h

* use unique_ptr in MACCS Patterns

* remove unrequred if in new_canon

* update & move suppressions
2018-10-29 14:33:26 +00:00
Greg Landrum
f6ced134f0 a number of other small changes from manually reviewing the PR 2017-04-22 17:24:57 +02: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
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
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
53bf6a4609 merge master 2015-01-16 05:49: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
Nadine Schneider
d8ee04b5b7 Bugfix in the chirality handling of chemical reactions 2015-01-09 10:34:28 +01: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
ddc66b90a9 initial verison of allowing rxns to be built from smiles 2014-04-11 04:41:48 +02:00
Greg Landrum
254cb7a405 Fixes #233 2014-03-14 18:40:10 +01:00
Greg Landrum
8db139da5e steps towards #222
at least now agents no longer generate parse errors
2014-02-23 09:55:30 +01:00
Greg Landrum
5904be011d update reaction stereochem handling (needs more work) 2013-04-06 06:39:22 +00:00
Greg Landrum
213e161b0c remove some warnings from clang.
At this point the only warnings are connected to the RNG parameterization in Fingerprints.cpp
2013-03-29 17:22:28 +00:00
Greg Landrum
60956a59b3 get component level SMARTS grouping working in reaction smarts;
this probably needs some more work
2012-10-10 10:17:52 +00:00
Greg Landrum
faab610321 add string replacements to smiles and smarts parsers 2011-05-22 10:45:14 +00:00
Greg Landrum
18a8be8538 add isMoleculeReactantOfReaction() and isMoleculeProductOfReaction() convenience functions 2010-08-21 00:16:02 +00:00
Greg Landrum
527a3ccc6a handle dots in reactions correctly; this needs a bug entered against it. 2009-03-17 16:40:22 +00:00
Greg Landrum
b1aac14542 progress towards fixing and testing issue 1934052 2008-04-24 05:41:03 +00:00
Greg Landrum
38e5d9d030 fix stupid typo in the copyright
add test for sf.net bug 1804420
2007-09-29 06:34:30 +00:00
Greg Landrum
80c76c59ac merge in chemical reactions branch (r173:183) 2007-02-23 18:05:50 +00:00