Commit Graph

59 Commits

Author SHA1 Message Date
Paolo Tosco
a7e1f3014e - avoid inconsistency between V2K and V3K MDL output wrt isotopic labelling of R groups (neither should be isotopically labelled) (#7504)
- isotopic labelling should not depend on the presence of a query atom feature, but rather on the presence of common_properties::_MolFileRLabel

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-06-09 07:32:16 +02:00
PatrickPenner
aaa06faa0f Custom decimal precision (#7229)
* MolToMolBlock V3000 double precision coordinates

- Added MolWriteParams
- Added python interfaces with MolWriteParams
- Added double precision test

* Added params interface for file writing functions

* First comments

- read precision from stream and reset
- MolWriteParams renamed to MolWriterParams

* MolToMrv and MolToXYZ precision interface extension

- extend the mol to marvin and mol to XYZ functions with coordinate precision
- propogate to python interface
- harmonized documentation occasionally

* Implement review
2024-03-17 06:03:03 +01:00
MarioAndWario
9ca7a2e00d Sanitize number of radical electrons in case of invalid value assigned by CXSMILES (#6842)
* Sanitize number of radical electrons in case of invalid value assigned by CXSMILES (#6370)

* static_cast<int> for integer comparison

* Add unittests for 0 explicit hydrogens

* Fix unittests of radical count in fileParsersTest1

* Fix testMolWriter

* Fix testMrvToMol

* Address Greg's comments
2024-01-23 06:21:26 +01:00
Greg Landrum
bfea269b38 Fixes #6241 (#6257)
* handle the cases when the flag is set

* add python wrapper

* Fixes #6241

update and finish?

* set the chiral flag to 0 in the mol file parsers

* adjust to the chiral flag always being present

* add note
2023-04-13 15:38:29 +02: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
a068a18a53 all tests now passing 2020-12-08 15:39:45 +01:00
greg landrum
55bc8d7ec1 backup 2020-12-08 15:39:45 +01:00
Greg Landrum
ca54f64289 Fixes #2229 (#2235)
also some reformatting
2019-01-22 10:53:48 -05:00
Greg Landrum
8c9795f535 Fix #2225 (#2228)
* Fixes #2225

* A bit of extra cleanup

* forgotten file

* Make this thread safe and add support for v3K mol blocks

* add the file

* update expected results
2019-01-17 11:44:23 -05: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
Paolo Tosco
f7c888844d moved test.h from RDBoost to RDGeneral for consistency with export.h (#2074) 2018-10-11 17:35:23 -04:00
Greg Landrum
146638600d actually run the SmilesWriterNoNames() test (#2067)
* actually run the SmilesWriterNoNames() test

* fix some leaks in the tests
2018-09-28 07:47:30 +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
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
d15efc1ac9 Make the defaults for some functions less error prone. (#1690)
* auto generate coords in mol block writer if includeChirality = True

* default to include chirality when writing mol blocks/files

* make isomeric smiles the default; note that not all tests are passing at the moment

* update a reaction test

* update expected cartridge search results
at this point all python, c++, and cartridge tests pass

* docs

* update incompatibility docs

* update doctests

* these now build

* minor example update

* update expected c++

* typo

* make allowCXSMILES=true the default

* add auto perception of chirality when reading 3D structures from mol blocks

* explain changes in release notes

* further doc update
2017-12-22 08:09:36 -05:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +02:00
Jan Holst Jensen
5616dc2597 Add support for dative bonds. (#1190)
* Add support for dative bonds to molfile reader plus writer and to SMILES reader (SMILES writer already supports it).
Initial V3000 molfile reader and writer dative bond support by Esben Jannik Bjerrum.

* first pass at adding -> as dative bond in smiles/smarts
more testing required

* all tests pass

* update .cmake files for lex
2016-12-14 09:44:18 +01:00
Greg Landrum
91212a4eb3 A variety of drawing-related changes (#986)
* Fixes #982
also changes bond-wedging algorithm to favor lighter non-ring bonds

* prefer wedging bonds to lower-degree atoms

* Fixes #983

* small fixes
- Fix a problem where a chiral atom is selected to draw a wedge to instead of a ring atom
- Fix a problem where two calls to PrepareMolForDrawing() led to two wedged bonds from an atom.

* Fixes #985

This isn't the most satisfying solution (the wedged bonds are sometimes a bit too large), but it gives reasonable results on the test cases I've tried.
2016-07-25 17:28:41 -04:00
Greg Landrum
2e961be508 rename method to getText() 2016-03-31 05:17:41 +02:00
Greg Landrum
baa2b9b217 first version 2016-03-30 16:08:05 +02:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Riccardo Vianello
78d7f6c1d9 Fix regressions occurring when building with msvc9 2015-10-14 09:43:16 +02:00
Greg Landrum
d3bf352940 add test for #611 2015-09-10 16:01:15 +02:00
Greg Landrum
177e584a11 Fixes #488 2015-04-22 06:33:30 +02:00
Greg Landrum
a66662b2a2 switch back to using the previous stereochemistry code for now 2015-04-10 09:47:17 +02:00
Greg Landrum
6d7b2b0914 merge with master 2015-01-22 06:30:51 -05: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
0f1ec50767 Fixes #407 2014-12-31 06:28:02 +00:00
Nadine Schneider
53cd0666eb Introduce UpdatePropertyCache to MolWriter 2014-12-19 13:59:56 +01:00
Greg Landrum
114ff2fe8d Fixes #357 2014-10-23 06:04:48 +02:00
Greg Landrum
f94ed4a1f5 get queries from SMARTS into CTABs more reasonably 2014-05-26 09:02:08 +02:00
Greg Landrum
665872cb39 Fixes #268 2014-05-25 06:55:30 +02:00
Greg Landrum
684f451352 Fixes #266 2014-05-22 17:34:06 +02:00
Greg Landrum
601c21f19d Fixes #189 2014-03-13 05:23:56 +01:00
Greg Landrum
75be63fd6b merge with trunk 2014-02-09 05:00:18 +01:00
Greg Landrum
e38e60d283 Fixes #186 2014-01-11 06:01:30 +01:00
Greg Landrum
5dca39e2f7 Fixes #187 2014-01-11 05:38:11 +01:00
Greg Landrum
0ce8f23c6e further R group handling 2014-01-10 04:24:22 +01:00
Greg Landrum
bb59487648 add tests for the kekulize and forceV3000 options 2013-12-30 07:14:16 +01:00
Greg Landrum
ae14fa3bd9 add support for the ZCH and HYD elements in mol files 2013-12-07 17:40:04 +01:00
Greg Landrum
3b0c72c4bf initial pass at ZBO support.
does not yet handle the HYD and ZCH lines
2013-11-30 06:58:03 +01:00
Greg Landrum
e51d2c1020 Fixes #118 2013-10-05 16:19:02 +02:00
Greg Landrum
d80ab78f70 initial pass at this 2013-07-15 17:04:15 +02:00
Greg Landrum
c36547010a Fix #64 2013-07-09 05:40:55 +02:00
Greg Landrum
9ff479838c fix and test issue 264 2012-11-17 06:49:38 +00:00
Greg Landrum
4b40a7d3f4 a bit more robustification around issue 3525000b 2012-05-09 13:41:22 +00:00
Greg Landrum
03ecdbc1cc fix and test issue 3525000 2012-05-09 13:13:46 +00:00
Greg Landrum
5f85129f22 initial support for clang
this is minor build-system variations and some code cleanup
the python wrapper still needs cleanup and 
the sln stuff doesn't work at all under clang due to weirdness with boost::regex
2011-05-25 19:40:31 +00:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
0b94555f88 fix (and test) potential crashing bug
with use of close() in SDWriters
2010-08-30 05:00:58 +00:00