Commit Graph

341 Commits

Author SHA1 Message Date
tadhurst-cdd
d5d4d194ec atropisomer handling added (#6903)
* atropisomer handling added

* fixed non-used variables,  linking directives

* BOOST LIB start/stop fixes, linking fix

* Fixes for RDKIT CI errors

* minimalLib fix

* changed vector<enum> for java builds

* check for extra chars in CIP labeling

* removed wrong deprecated message

* fix ostrstream output error?

* restored _ChiralAtomRank to lowercase first letter

* changes for merged master

* Fixed catch label for new Catch package

* update expected psql results

* get swig wrappers building

* restore MolFileStereochem to FileParsers

* fix java wrapper for reapplyMolBlockWedging

* some suggestions

* move a couple functions out of Bond

* Merge branch 'master' into pr/atropisomers2

* merged master

* Renamed setStereoanyFromSquiggleBond

* atropisomers in cdxml, rationalize atrop wedging, stereoGroups in drawMol

* fix for CI build

* attempt to fix java build in CI

* attempt to fix java build in CI #2

* New routine to remove non-explicit  3D-geneated chirality

* changed to use pair for atrop atoms and related bonds

* Changes as per PR reviews

* PR review respnses

* PR review reponse - more

* Fix merge from master

* fixing java ci after merge

* Updated the help doc for atripisomers

* update the atropisomer docs

* improve the images

* add the source CXSMILES

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-12-22 04:58:18 +01:00
Gareth Jones
31de6b09fb Added fingerprints to GeneralizedSubstruct search and extended SWIG wrappers (#6991)
* Added fingerprints to GeneralizedSubstruct search

* Small change to fire tests

* Edits from code review

* Updated swig - newobject not required for GeneralizedSubstruct fingerprint methods

* GeneralizedSubstruct only supports unique_ptr in SWIG4.1
2023-12-19 04:44:06 +01:00
Greg Landrum
f797113a16 cmake cleanup (#6814)
* add RDKIT_CFFI_STATIC option
minimallib cmake cleanup

* clean up a lot of boost::iostreams nonsense

* find_package(boost cleanup

* update the swig wrappers

* updates to psql

* get the Qt demo working again

* fix? coordgen

* only use std::regex in moldraw2d test

this is consistent with the other tests

* cleanup the serialization stuff too
2023-11-10 15:32:54 +01:00
Greg Landrum
908e47cc03 support generalized substructure search in the SubstructLibrary (#6835)
* support generalized substructure search in the SubstructLibrary

* simplify namespaces

* support the new functionality in the swig wrappers

* update mac swig version in CI

* ensure swig4

* switch mac_java ci builds to conda-forge

* change in response to review

* add copy ctor to extendedquerymol

* Back to the way it was
2023-11-01 14:55:28 -04:00
Gareth Jones
81e9cb2386 Fix stereo bond corruption on RGD. (#6832) 2023-10-28 12:47:58 +02:00
Gareth Jones
2f6c80c0ab Exclude MCSParametersInternal from SWIG (#6808) 2023-10-17 18:29:46 +02:00
Brian Kelley
cccee15a91 Add hasQueryHs (#6702) 2023-09-15 08:59:56 +02:00
Jonathan Bisson
56170a455d Add support for Marvin files (#6575)
* Add support for Marvin files

* And MRV lib to the Java wrapper

* And MRV lib to the Java wrapper

* Removed use of void * in MarvinParser.cpp and MarvinParser.h

* Changes as per code review from Greg

* Changes for PR review - many virtual methods

* changes as per Jonathan's comments

* some suggested changes

* PR review changes and fixed unit tests

* after merge, changes to make it run

* More PR review changes

* removed unneeded std::move()s · rdkit/rdkit@b4b8b9a · GitHub

* More PR review changes

* fix a compile error

* more defensive programming

* reorder

* final? PR review updates

* Erata

---------

Co-authored-by: Tad Hurst <tad.hurst@collaborativedrug.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
Co-authored-by: tadhurst-cdd <112502803+tadhurst-cdd@users.noreply.github.com>
2023-09-01 04:50:34 +02:00
Gareth Jones
b46fc6e28b RGD with matching on tautomers of core (#6611)
* Support tautomer queries in RGD

* Continuing RGD and tautomer development

* Python and C# tests

* Python and C# tests

* C# test

* Typo fix

* For cire tautomer query update properties instead of full sanitization

* Added query comment

* Code review change

* Support Enumeration of input cores

* Mol enumeration test

* Remove useNormalMatch from RGroupDecomp

* Added comments for handling tautomeric core

* Added comments for handling tautomeric core
2023-08-29 08:50:14 +02:00
Greg Landrum
a57060225f Fixes #6479 (#6482)
* make sure we don't try to access an SG which no longer exists

* Fixes #6479
updates a bunch of tests to support this

* test ring stereo too

* update expected results from the tests
2023-07-13 19:29:06 +02:00
Gareth Jones
409947314f Add MolEnumerator to C# (#6542)
* Include enumerator in C# wrappers

* Add MolBundle to C# and create test
2023-07-13 12:43:56 +02:00
Gareth Jones
e00c2c5336 Fix swig memory leak (#6346) 2023-05-10 06:16:35 +02:00
Ric
880a8e5725 Reformat Python code for 2023.03 release (#6294)
* run yapf

* run isort

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2023-04-28 06:53:56 +02:00
Paolo Tosco
e9a33b0b23 Expose RDLog to SWIG wrappers (#5749)
* expose RDLog to SWIG wrappers

* - added a SetTee() overload that takes a filename as parameter to simplify redirecting from wrappers that do not have interface with C++ streams (e.g., Java and C#)
- replaced some duplicate code with ClearTee() calls
- replaced RDLogger std::shared_ptr with boost::shared_ptr to make it more easily available from SWIG wrappers
- exposed the RDLogger methods to SWIG wrappers
- added Java test for RDLogger

* this should fix the segfault

* avoid issues on case-insensitive platforms

* here's a solution keeping std:;shared_ptr

* change in response to review

---------

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-04-14 09:26:56 +02:00
Paolo Tosco
ab980bca44 SWIG pickling improvements (and other cleanup) (#6133)
* wip

* - avoid leaking memory after instantiating UChar_Vect
- fix some indentation
- make it easier to read/write pickles as native byte arrays from Java and C#
- add tests

---------

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-03-01 05:00:56 +01:00
Paolo Tosco
3326a620a2 Stereochemistry-related SWIG updates (#6127)
* - expose [sg]etUseLegacyStereo()
- In MolToSmiles() doIsomericSmiles should default to true as in C++ and Python
- added missing parameters to MolToSmiles() and MolToMolBlock()
- added SmilesWriteParams MolToSmiles() overload
- added and updated Java tests

* - changes in response to review
- exposed the same functionality also in MinimalLib and CFFI and added tests

---------

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-02-28 06:44:50 +01:00
Paolo Tosco
3d5a3f2af1 - wrap types that are otherwise not accessible from SWIG wrappers (#6110)
- remove redundant Point2D_Vect definition (laready defined elsewhere)
- blacklist getPositions() whose return type is not accessible from SWIG

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-02-20 12:44:24 +01:00
Paolo Tosco
0f1b371574 expose some stereochemistry-related functions to SWIG wrappers (#6075)
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-02-16 12:28:14 +01:00
Greg Landrum
a8c8e9a8e1 Add canonicalization of stereo groups (enhanced stereo) (#6051)
* add function to canonicalize enhanced stereo representations

* use enhanced stereo in canonicalization

* Fixes #6045
enables the doc tests for EnumerateStereoisomers.py
Re-enables the BRICS tests

* some things work... tests need to be updated

* c++ and python tests pass

* update expected psql results

* run the canonicalization on SMILES generation;
c++ and python tests pass

* cartridge and java tests pass

* update doctests
2023-02-08 04:21:51 +01:00
Gareth Jones
bb8bc57d05 Add depiction coordinates to molzip (#5993)
* Test routine working

* Fix python molzip signature clash

* Update SWIG bindings

* Add C++ and Python documentation

* Add C++ and Python documentation
2023-01-28 04:46:39 +01:00
Greg Landrum
1dc268bf4a Allow the sources of conformer generation failures to be retrieved (#5960)
* support tracking where the conformer generation code fails

* less verbose  output

* tests now pass

* fix a stupid typo

* fix SWIG wrappers

* changes in response to review
2023-01-24 18:09:15 +01:00
Gareth Jones
a383b9e1dd Refactor RGD moving function implementations from header to source files (#5958)
* Create implementations for functions defined in header files

* Fix testRGroupInternals.cpp include

* Add windows dll export to RGroupData

* Fix swig wrappers

* Remove unused RGroupData constructor

* Fix RGD CMakeLists.txt
2023-01-20 15:01:45 +01:00
Greg Landrum
e322928028 swap boost::tuple to std::tuple (#5851) 2022-12-16 16:01:19 +01:00
Greg Landrum
aa336f3faf Get the wrappers working with SWIG 4.0 (#5795)
* extend the allowed valences of the alkali earths
make it possible to have preferred and arbitrary valence states (I thought this already worked)

* backup

* maybe needed

* copy in some swig3 files;
at this point the tests all work

* remove SWIG version lock

* changes in response to review
2022-12-10 07:13:55 +01:00
Greg Landrum
cfe512ea47 Fixes #5704 (#5705)
* Fixes #5704

* update expected java results
2022-11-14 16:59:26 +01:00
Paolo Tosco
b068f51e51 - expose two useful functions from SubtructUtils to SWIG wrappers (getMostSubstitutedCoreMatch, sortMatchesByDegreeOfCoreSubstitution) (#5666)
- add unit test to exercise the above

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-10-19 17:42:04 +02:00
Paolo Tosco
1ec95d2cda Update obsolete SWIG definitions (#5658)
* - updated outdated SWIG definitions of ROMol.generateDepictionMatching2DStructure
- added unit test

* - added strictParsing flag

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-10-18 15:09:29 +02:00
Paolo Tosco
177c09cd6b Expose additional functionality to SWIG wrappers (#5614)
* - setenv() should be defined also for MinGW builds, not just MSVC
- fixed getBestRMS signature (ROMol& should be const)
- expose normalizeDepiction(), straightenDepiction(), getBestRMS(), CalcRMS() and getBestAlignmentTransform() to SWIG wrappers
- expose MolFromSmiles() overload taking SmilesParserParams parameter to SWIG wrappers
- expose DoubleVector class to SWIG wrappers as it is needed by alignment functions
- replace std::string with const std::string& in several SWIG wrapper signatures
- build RDKit2DotNet.dll as a 64-bit library on MinGW 64-bit
- add Java tests for the newly exposed SWIG functions
- fixed inconsistent indentation in Chemv2Tests.java

* changes in response to review

* fix typo

* reverted file committed by mistake

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-10-04 05:04:28 +02:00
Brian Kelley
d1985caaa7 cdxml parser (#5273) 2022-09-28 05:49:27 +02:00
Gareth Jones
c223c19ee3 Add ColorPalette_Vect to SWIG bindings (#5580)
* Added swig bindings for C# and ColorMap

* Update ColourPalette_Vect name

* Simple test/verification
2022-09-23 05:38:54 +02:00
Greg Landrum
0147cd8201 Fixes #5210 (#5408)
* revert duplicate chunk in release notes

* replace deprecated ifdefs
This one gets rid of USE_BUILTIN_POPCNT and RDK_THREADSAFE_SS
use RDK_OPTIMIZE_POPCNT or RDK_BUILD_THREADSAFE_SSS instead

* get rid of BUILD_COORDGEN_SUPPORT from ROMol.i

* fix a stupid typo

* update release notes
2022-07-11 11:20:03 +02:00
Gareth Jones
b50bce4ed0 Swig MolDraw2D cairo (#5128)
* MolDraw2DCairo working in SWIG

* C# test
2022-03-24 05:54:12 +01:00
Eisuke Kawashima
b53ee20b49 Fix Flake8 erorrs (#4252)
* Fix PEP8 [E101](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E502](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E703](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E711](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E712](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E713](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E722](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [W605](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)
2022-03-10 06:55:18 +01:00
Kevin Burk
7bd9f7b434 Remove extra newline from Kekulize error message. (#5022)
* Remove extra newline from Kekulize error message.

* Fix test for exception message.
2022-02-22 04:48:14 +01:00
David Cosgrove
f93016a77f Refactor mol draw2 d (#4948)
* MolDraw2D refactoring
- rename setupMoleculeDraw->initMoleculeDraw
- track whether or not initDrawing() has been called
- centralize calls to initDrawing() and clearDrawing() into initMoleculeDraw()
- update svg hashes in tests

* update some expected test results

* support changing font scale and default scale
add reaction test

* does not work... this is hard

* all tests pass

* do something about legends

* docs

* more tests

* more docs

* cleanup

* going around in circles...
hopefully converging

* cleanup

* Single bond skeleton works.

* Simple bond drawing seems to be working.

* Initial addition of atom symbols.

* Stash of not-quite-working atom symbols prior to major surgery.

* Atom symbols seem to be working.  Major surgery not required, just inverted Y coords at the outset.

* Add classes to atom labels.

* Renamed AtomLabel AtomSymbol.

* Add highlights.

* Fix bug from PR4839.

* Molecule note.

* Added atom notes.

* Added bond notes.

* Extract radicals.

* Annotation via new DrawAnnotation class.

* Add brackets.

* Add linknodes.

* Add close contacts.

* Add attachment points.  Fix wavy lines.

* Draw molecules in grid.

* Tidy.

* Fix radicals when font has hit maxFontSize.
Make getDrawCoords work.

* Draw primitives take atom or draw coords.

* Fix legends.

* More fixing for tests.  DrawMol::setScale now takes font scale as well.

* tidy debug writes

* Variable fraction of panel for legend.

* Better legend positioning.

* Fix sub- and super-script spacing.
Added spaces to Freetype strings.

* Basic reaction drawing.

* Reaction highlighting.

* Minor tweak to reacctions.

* Tweaked reaction DrawMol widths.

* Fix atomTags.

* Fix catch tests except contours.

* Contouring working in catch_tests.cpp.

* Fix catch tests.

* AtomSymbol and DrawAnnotation into MolDraw2D_detail.

* DrawMol and DrawShape into MolDraw2D_detail.

* DrawText inot MolDraw2D_detail.

* Machete out.

* DrawText goes private.

* Move some stuff about, such as StringRect to its own header.

* Python wrapper compiles (but crashes when Draw imported).

* More tidying.  Python DrawArrow failing.

* Linux changes.

* Fixed error in DrawShapeArrow spotted by valgrind.
Fixed some warnings from gcc.

* Maybe fixed DrawArrow.

* Added basic argparse interface.

* Added newlines.

* Changes in response to review.
Non-const args in move constructors and operator=.
Added missing classes to MolDraw2D_detail.
Deleted move operator= where it had been forgotten.
Fixed copyright dates.

* Deleted all default c'tors in derived classes.

* Changes in response to review:
Wedge widths now a proportion of mean bond length in draw coords..
Add padding below legend when positioning it.

* Fix tests.

* Fix the private/protected mess of the new classes.

* Moved doesLineIntersect etc.

* Reinstate original alignString for non-FT drawings.

* More faffing about with reaction layouts.

* Fix font sizes in testGitHub3391.

* Fix atom notes fitting inside fat wedges.

* Fix molecule annotation font size.

* More fixes of rectangle/triangle collision detection.

* Test for highlight linewidth multiplier.

* Use push_back not emplace_back.

* Attempt at better Freetype char spacing.

* Option to turn off TEST_ASSERT. Currently off.

* Fixed embarrassing maths to do with wedge fatness.

* More tidying post-review.

* Document highlight_linewidth_multipliers.

* Expose baseFontSize to Python.

* Changes in response to review.

* Allow DrawMolecules molecules to be drawn to different scales.

* Fix bond sneaking between C:8 in, for example, reactions.

* Fix bad re-factoring.

* Fix globbing.

* Changes in response to review.

* Add invariant check.

* Add draw option to fix font size.

* suggested changes

* Update catch test results.

* Fix expected freetype results.

* Fix non-freetype drawers.

* Fin non-freetype test results.

* get the Qt drawer working too

* Fix disappearing reaction highlights.

* Changes as result of review.

* Fixed non-FreeType hash codes for reaction SVGs.  Extra comment in catch_tests.

* reactant highlighting was clearning properties

* Fix for failing contour python test.

* fix a non-freetype problem

* swig wrappers working

* Bump timeouts in test.

Co-authored-by: greg landrum <greg.landrum@gmail.com>
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-02-18 16:30:21 +01:00
Kazuya Ujihara
de088cd7dd add JavaGzStreamTests (#4973) 2022-02-01 17:28:36 +01:00
Kazuya Ujihara
0530d468e2 Fix i-files for RDK_USE_BOOST_IOSTREAMS=OFF (#4933)
* fix i-files for RDK_USE_BOOST_IOSTREAMS=OFF

* separate gzstream test

Co-authored-by: Kazuya Ujihara <ujihara@preferred.jp>
2022-01-23 07:06:36 +01:00
Greg Landrum
71770c60a9 fix some leaks in the SWIG wrappers (#4916) 2022-01-19 21:22:53 +01:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Brian Kelley
6a16d64169 Adds KeyFromPropHolder to hold user defined indices (#4571)
* Adds KeyFromPropHolder to hold user defined indices

* Add missing file

* I hate swig.  Had to move keyholder classes into main header file, yuck.
But I added tests, so yay?

* Remove removed dependency

* Fix borked test

* Make consistent getKeys function, fix constness

* Fix overloaded call

* Remove GetKey/s from SubstructLibrary
2021-10-02 08:17:50 +02:00
Greg Landrum
85608555fe add ROMol::atomNeighbors() and ROMol::atomBonds() (#4573)
* add ROMol::atomBonds() and ROMol::atomNeighbors() methods

* remove some warnings

* start using the new code

* add default for those template params

* some more applications

* get the SWIG builds working

* get rid of extraneous ref

* remove extraneous comments
2021-10-02 07:28:24 +02:00
Greg Landrum
22da97b836 Add support for SRUs to MolEnumerator (#4563)
* preliminary first pass at SRU enumeration

* handle HH

* working
plus add a missing file... <doh!>

* passes basic tests for enumeration of multiple non-overlapping SRUs

* more SRU testing

* explore combining the SRU enumeration with enumerate()

* first step towards RepeatUnit in the python interface

* first pass at directly connected SRUs

* Fixes #4561

* make sure we don't try to enumeration SRU + LINKNODE
update python docs

* exception for ladders

* get a bit smarter about rejecting linknode enumerations

* turns out we actually *can* do ladders pretty easily

* update java wrappers

* make sure we can input from CXSMILES too

* some cleanup/documentation

* some refactoring

* response to review
2021-09-28 16:37:39 +02:00
Paolo Tosco
9cb48cb8ad - enable building Java wrappers with MinGW compilers (#4384) 2021-08-08 05:07:54 +02:00
Paolo Tosco
f09e12765b - remove SWIG kludge on Windows (#4388)
- do not define SWIGWORDSIZE64 on Windows
2021-08-07 06:06:02 +02:00
Paolo Tosco
e8175cf29c Three more Windows build fixes (#4356)
* - fixes MinGW build
- make sure that supplier istream is opened in binary mode or istream::tellg() will
  report wrong offsets on MinGW builds (MSVC will make no difference)
- avoid that in MSVC conda DLL builds the libboost_*.lib static
  libraries are picked by cmake instead of the boost_*.lib import libraries
  by defining BOOST_ALL_DYN_LINK

* - make sure that C# wrappers build with MinGW compilers
- make sure that static builds work under Windows with both MSVC and
  MinGW

* - disable building static libraries on Windows also when using MinGW compilers
- fix the C# wrapper build on Windows under both MSVC and MinGW

* reverted -DSWIGWORDSIZE64 as it was originally

* reverted -DSWIGWORDSIZE64 definition

Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
2021-07-29 05:52:18 +02:00
Eisuke Kawashima
b9a5be5a2d miscellaneous updates (#4284)
* Remove accidentally tracked files and unset x flag

* Ignore ComicNeue

* Unify test tag to `reader`

* Trivial destructors

* Bump CMAKE_CXX_STANDARD to 14 (#4165)
2021-07-13 06:57:29 +02:00
Greg Landrum
b50e799da1 Linux CI modernization (#4285)
* linux CI modernization
- remove 16.04 python builds
- switch 16.04 java build to 20.04

* update

* update

* use dynamic libs
-fPIC never ceases to amuse

* specify swig version

* force swig3

* force swig3

* re-enable the other tests
2021-06-30 11:09:26 +02:00
Eisuke Kawashima
78aac3c1bc Run clang-format against header files (#4143) 2021-06-08 07:57:51 +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
Kazuya Ujihara
0b934953a2 Get SWIG wrappers working with C# again (#4020)
* fix to work for C#

* revert gitignore
2021-04-14 13:56:15 -04:00