Commit Graph

3384 Commits

Author SHA1 Message Date
Eisuke Kawashima
013ba4f21d Run clang-tidy (modernize-use-override) (#4251) 2021-07-01 05:18:56 +02:00
Matt Swain
1d3c634691 Fix EnumerateStereoisomers for EITHERDOUBLE cis/trans bonds (#4272)
* Fix logic in findPotentialStereoBonds

* Strip EITHERDOUBLE bonds in EnumerateStereoisomers

* Add test for EITHERDOUBLE EnumerateStereoisomers
2021-06-23 08:20:58 +02:00
Greg Landrum
91d2093dd0 Fixes #4238 (#4255)
* prefer to not wedge bonds to double bonds

* addWavyBondsForStereoAny() works

* add option to clear bond stereo

* support wavy bonds in prepareMolForDrawing()

get rid of MolDraw2D/catch_main.cpp

* add a drawing example

* name the bug correctly

* add that new functionality to the python wrapper

* remove some debugging cruft
2021-06-22 10:51:09 +02:00
Greg Landrum
70dadbb21f Fixes #4260 (#4267) 2021-06-21 09:52:11 -04:00
Greg Landrum
1702a227e2 Fixes #3998 (#4248)
* add KekulizeFragment()

more testing wouldn't be bad

* oversight

* Fixes #3998
2021-06-19 06:00:45 +02:00
Greg Landrum
492b5b9aa0 Fix a couple of problems with fingerprint count simulation (#4228)
* Fixes a variety of problems with simulating counts using the FingerprintGenerators from Python

1. the countBounds arguments were not working
2. the GetXXXGenerator() functions used inconsistent naming for the countSimulation argument
3. there were no tests to make sure that the changing countBounds actually did something

* typo
2021-06-18 12:55:47 -04:00
bzoracler
3847cc5598 Shift constructors to class methods (#4225)
Shift `Trajectory` and `Snapshot` class constructors to methods on the classes themselves to prevent shadowing of class names in the Python wrapper module
2021-06-17 16:53:25 +02:00
jungb-basf
21f6b88be0 Update MDLParser.cpp (#4218)
* Update MDLParser.cpp

Fix length of expected strings "BEGIN AGENT" and "END AGENT"

* Add files via upload

* Delete v3k_with_agents.rxn

* fixes #4183

* Update testReaction.cpp

added testcase fixes #4183
2021-06-17 16:52:31 +02:00
David Cosgrove
efa20a811c Test comparing SVGs via hash code - ready for review (#4199)
* Changed SVG output so all coordinates are to 1 decimal place.
Adjusted tests accordingly.

* Checking test1 SVGs via hashcode.

* Added testing of all generated test files by comparing hash-codes.
The few cases where this doesn't work are mentioned in the code.

* close streams

* Close files after writing - Windows won't delete them otherwise.

* Changes post-review.

* Proposed change post-review for further discussion.

* Use MolDraw2D_details::doubleFormat.

* Copied improved check_file_hash() from catch_tests.cpp.
Updated a few hash codes.

* Copied improved check_file_hash() from catch_tests.cpp.
Updated a few hash codes.
Added hash codes for no-Freetype version.

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-06-17 16:01:26 +02:00
Kazuya Ujihara
464a324dc5 Fix CMakeLists for FileParsers (#4240)
* Fix CMakeLists for FileParsers

* Move find_package place
2021-06-15 04:51:19 +02:00
Greg Landrum
97eb59003d double bonds now have EITHER stereo if no coordinates are present (#4239)
speedup for Point3D::angleTo
patch from Roger Sayle
2021-06-15 04:25:24 +02:00
Eisuke Kawashima
48f4f3ee82 Run clang-tidy (modernize-pass-by-value) (#4224) 2021-06-14 06:57:08 +02:00
Dan N
063177bdba Issue 4232: MolFromSmiles shouldn't throw (#4235)
MolFromSmiles shouldn't throw even when using SmilesParserParams.
See attached test which failed before this commit.
2021-06-11 10:40:20 +02:00
Ric
20e9086af6 fix + test (#4223) 2021-06-09 04:54:42 +02:00
Greg Landrum
1937fbdfce Fixes #4212 (#4213) 2021-06-08 09:36:30 -04:00
Brian Kelley
8d4b5cb616 Fix memory leak with deleting array (#4211) 2021-06-08 13:57:38 +02:00
Eisuke Kawashima
78aac3c1bc Run clang-format against header files (#4143) 2021-06-08 07:57:51 +02:00
Brian Kelley
0f18dba0ed Fix/rdprop integer conversions (#4194)
* Allow int->int64 conversions

* Add original python test

* Add self to class method

* Quick cout to see what the error really is

* Add overflow checks to integer conversions in getProp

* Fix conversions, convert to ValueError in python for bad conversions

* Trigger tests to run again

* Revert "Quick cout to see what the error really is"

This reverts commit 70feea687e.
2021-06-08 04:19:35 +02:00
Greg Landrum
5d0eb77c65 allow more recoverable SGroup errors when strictParsing=false (#4210) 2021-06-07 15:39:49 +02:00
Ric
75f1cd4c89 Add low level functions to bulk-update Substance Group atoms & bonds (#4206)
* override atoms, parent atoms, bonds

* use copy/move instead of ref

* refactor

* more refactors

* remove unrequired header

* back insert in copy_if
2021-06-06 07:49:50 +02:00
Ric
d1574a2a05 Fixes #4114 (#4207)
* copy props for reactant/null query bonds

* add test
2021-06-06 07:46:06 +02:00
Greg Landrum
27956475a5 restore exactmw (#4209) 2021-06-05 07:26:25 +02:00
Greg Landrum
53523a4a11 support getNumAtoms and getNumHeavyAtoms in descriptors (#4200) 2021-06-04 11:48:07 -04:00
jfkonecn
145c3891ff added a flip bond dir function to remove repeated code inside the canonicalizeDoubleBond function (#4204) 2021-06-04 17:37:32 +02:00
jfkonecn
4f0521e116 fixes #3967 (#4190)
* fixes #3967

* modernize test

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2021-06-03 05:13:13 +02:00
Greg Landrum
4ee7af88e6 Fixes #4155 (#4192)
removes the shared-bond restriction for potential chiral centers
add support for chiral bridgehead nitrogens
2021-06-03 05:10:15 +02:00
Greg Landrum
056efc8e55 RWMol cleanup (#4198)
- remove d_partialBonds data member - never used
- remove RWMol::destroy()  - redundant with ROMol::destroy()
2021-06-02 13:09:49 -04:00
Greg Landrum
e627e70641 make a test more permissive (#4197)
* make a test more permissive

* only do that if freetype is installed
2021-06-02 09:55:43 +02:00
David Cosgrove
e2402c76ae Fix incorrect scaling in grid drawing with radicals. (#4163)
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2021-06-01 14:56:03 +02:00
Gareth Jones
9622580660 Comments added to RGD core matching (#4189)
* Comments added to RGD core matching

* Reformatted code
2021-06-01 14:49:18 +02:00
Rachel Walker
33b576221e Fix python to C++ pointer conversion issue in moldrawFromQPainter (#4182)
On 64-bit windows, I noticed the value of the QPainter pointer can exceed the
maximum unsigned long int value, which caused a python OverflowError.
Changing the type to size_t should prevent this.
2021-05-28 05:37:45 +02:00
Greg Landrum
0b78f8d48c fixes #4128 (#4178) 2021-05-27 19:18:32 +02:00
Greg Landrum
4ab9c44bcb Fixes #4144 (#4175)
* Fixes #4144

* update the call in EnumerateSteroisomers
2021-05-27 07:30:44 -04:00
Greg Landrum
df2b6c8a8c Fixes #4167 (#4174) 2021-05-27 07:30:06 -04:00
Paolo Tosco
8c06446f15 fixes #4162 (#4171)
Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
2021-05-27 07:29:52 -04: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
f5a54af475 A collection of MolStandardize improvements (#4118)
* Swap to using a data structure for default normalization parameters

* bring the default fragment data into the code too

* cleanup

* add reionizer parameters via data

change fragment parse failures to ValueErrorExceptions

* tautomer parameters in the code

* got a little over-enthusiastic in that last cleanup

* use boost::flyweight to cache normalization and charge data params

* a bit more cleanup

* support reading params from JSON

* fragments from JSON
single-call for fragment removal

* add a one-liner for the canonical tautomer

* quick refactor

* Fixes #4115

* complete the parents

* docs

* move the definitions to a namespace and make them const

* see if switching to c++14 fixes the CI compile problems with g++ 5.5

* somewhat uglier way of solving the initalizer list problem
2021-05-19 09:11:23 +02:00
Greg Landrum
caaa7406be Fixes #4127 (#4129)
Also adds fixes for some related problems I noticed while fixing this one.
2021-05-18 15:39:15 +02:00
Greg Landrum
b6515eaade Fixes #4138 (#4145)
adds a short-circuit test to the substructure matching so that it immediately returns an empty result set if either the molecule or the query is empty
2021-05-18 08:44:12 -04:00
Maximilian Peters
cc6e0a4dcc fixed AddBond documentation (#4142) 2021-05-18 13:19:31 +02:00
Paolo Tosco
106e9f7c37 Normalize line endings in source code files (#4104)
* set all source code files to have native line endings

* normalized all source code line endings

Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
2021-05-13 14:31:39 +02:00
Greg Landrum
c02e53d7aa Fixes #4099 (#4132)
Fixes #4131
2021-05-12 12:40:17 -04:00
Paolo Tosco
68734762fc Avoid that MolStandardizer segfaults on empty mols (#4119)
* Avoid that MolStandardizer segfaults on empty mols

* changes in response to review

* added missing not operator

Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
2021-05-11 20:11:10 +02:00
Greg Landrum
92b52f1988 Fixes #4122 (#4123) 2021-05-10 08:45:06 -04:00
Greg Landrum
02c269f036 Fixes #4115 (#4117) 2021-05-07 10:21:48 -04:00
Greg Landrum
ee5176a557 Enable storing queries in JSON (#4003)
* start refactor query pickling

* further query pickling refactoring

* bit of modernization

* partial implementation of query writing

* serialize recursive queries

* new tests

* support QueryAtom and QueryBond with null queries

* more query cleanup

* tests pass

* switch from std::variant to boost::variant

* update clang version for CI

* explicit instantiation of templates

* get dll builds working on windows

* optionally skip h counts on parsing; more query tests

* change in response to review

* changes in response to review
2021-05-04 06:37:24 +02:00
Eisuke Kawashima
f4c7d341e7 Support Chemical Markup Language, CML, for writing (#3024)
* Support Chemical Markup Language, CML, for writing

Implement RDKit::MolToCMLBlock and RDKit::MolToCMLFile
http://www.xml-cml.org/

* a number of cleanups and fixes

1. stop writing the cml: namespace to the output. Tools like marvin can't read that and it's not nececssary
2. fix the H count
3. continue writing atom info for 2D confs
4. simplify the writing of atom parity

* make the conformer optional
write bond hash/wedge information

* update the expected python results

* Remove overloaded function

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2021-04-29 05:00:21 +02:00
Paolo Tosco
2433982386 avoid that lone atoms which are part of a ring in one of the molecules become part of the MCS (#4065)
Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
2021-04-27 11:10:29 +02:00
Paolo Tosco
0ce4bcf73c fixes #4019 (#4022)
Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
2021-04-27 09:10:26 +02:00
Greg Landrum
af3bb3e78b Allow partial deserialization of molecules (#4040)
* make pickling/depickling conformers optional

* make de-pickling properties optional

* support the new options in molecule ctors

* update doctest
2021-04-24 07:22:55 +02:00