Commit Graph

64 Commits

Author SHA1 Message Date
Paolo Tosco
fc6e37d11e fix #8019 (#8020)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-11-20 09:09:56 +01:00
Gareth Jones
21df90304a Add getUIntVectProp to RDProps (#7507) 2024-06-23 07:01:07 +02:00
Greg Landrum
18eb648d56 Expose the property pickle options to SWIG (#7448)
* support pickle params in SWIG wrappers
csharp tests need to be tested

* make that work with csharp too
2024-05-24 07:37:06 +02:00
Gareth Jones
930c7d6345 Handle query atoms and bonds in SWIG wrappers (#7431)
* Query atom information in swig

* Atom query swig wrapping working

* SWIG wrapper for queries

* Add match to QueryAtom and QueryBond

* CShart test

* Added Java test

* Replace var with type for Java test

* Apply suggestions from code review

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

* Update Code/JavaWrappers/Queries.i

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

* Apply suggestions from code review

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

* Get SWIG build working again

* Remove trailing whitespace from Queries.i

* Update Queries.i to use shared_ptr

* small simplification

* remove boost::make_iterator from ROMol.i

* further simplification

---------

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-05-23 07:18:49 +02:00
Gareth Jones
7ec4661f84 C sharp rascal mcs wrapper (#7390)
* Added Wrapper Files

* Addd interface file

* Edited interface file

* Rascal SWIG wrapper finished

* Remove from Java wrapper

* add java wrappers too

* Update GraphMolCSharp.i

* Update Code/JavaWrappers/RascalMCES.i

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

* Update Code/JavaWrappers/RascalMCES.i

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

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2024-05-05 05:52:24 +02:00
Gareth Jones
5d034e3733 Restore mono build (#7377)
* Add mono build back into C# build

* Add mono build back into C# build

* Add mono build back into C# build

* Don't do mono build on Linux if dotnet is used

* CSharp dotnet build always on windows. Enable dotnet testing in vs_build_swit

* Fix typos
2024-04-24 13:01:08 +02:00
Gareth Jones
3919b7f41a Added MolStandardize to C# wrappers with test (#7351) 2024-04-11 16:17:32 +02:00
Gareth Jones
f99155c325 C# Build Net6 library and tests using cmake (#7326)
* Dotnet core build and test for RDKit

* Cmake dot net build and ctest working on windows

* Remove old Linux mono build

* Update to net8 and create RDK_BUILD_DOTNET_CSHARP_TESTS flag
2024-04-08 14:15:05 +02:00
Gareth Jones
c56c81ce0b Add some ExplicitBitVect operations to Swig (#7204) 2024-03-03 05:55:37 +01:00
Riccardo Vianello
25b7dbfb17 fix several warnings originating from the swig wrappers (#7063) 2024-01-30 04:44:43 +01:00
Gareth Jones
550d927b00 Update C# exception handling (#7081) 2024-01-23 06:11:36 +01:00
Greg Landrum
8127c85a91 [v2 API] SMILES/SMARTS parsers (#6203)
* 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
2024-01-19 17:17:51 +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
Gareth Jones
81e9cb2386 Fix stereo bond corruption on RGD. (#6832) 2023-10-28 12:47:58 +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
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
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
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
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
Gareth Jones
b50bce4ed0 Swig MolDraw2D cairo (#5128)
* MolDraw2DCairo working in SWIG

* C# test
2022-03-24 05:54:12 +01: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
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
Ric
c9199cf1da Address #2753 (#3750)
* add test export heder to gitignore

* define export macros in separate file

* install new header

* patch GA with the new macros

* fix struct declarations

* fix conformerparser exports

* fix MolSGroupParsing ParseV3000Array export

* fix java wrappers

* export exceptions

* remove duplicated exports

* Build RDGeneral exceptions into lib

* export queries, only for *nix

* fix RingDecomposerLib header manipulation

* fix CIP labeler test issues
2021-02-15 14:29:04 +01:00
Eisuke Kawashima
e0b665bfe1 Clean up CMake files (#3417)
* Clean up CMake files

* bump CMake minimum required version to 3.7 to utilize
  [`VERSION_GREATER_EQUAL`](https://cmake.org/cmake/help/v3.7/release/3.7.html#index-0-command:if)
* improve catch-dependency
* fix conditionals
* use early return
* properly use CMake commands

* Apply suggestions from code review

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2020-11-28 08:00:39 +01:00
Greg Landrum
d2d87909de Add support for abbreviations (#3406)
* support read-only access to cstates from python

* expose GetBrackets

* expose getAttachPoints too

remove vestigial SubstanceGroupCState_VECT

* backup

* backup

* basics working

* backup

* add label_mol_abbreviations

* fix a bug in the chirality handling

* add linkers, needs more testing

* add another peptide test

* sanitize results by default

* just need rings

* getting started with the C++ form of abbreviations

* a bit of error handling

* add findApplicableMatches

* actually apply the abbreviations

* make the getDefault functions more efficient

* add labeling (creating s groups)

* docs

* basic python wrappers (maybe this is enough?)

* add _displayLabel and _displayLabelW support to MolDraw2D
update the docs for that

* use displayLabel props

* add more default abbrevs

* change default linker defns
add parseLinkers convenience function

* make sure attachment point atoms aren't aromatic

* change the color of dummies to be darker gray

* remove python implementation

* support abbreviations in the java wrappers

* add abbreviations to the csharp wrappers

* add abbreviations to the js wrappers

* add molParity to the list of atom props not written to CXSMILES

* support condensing SUP substance groups

* add that to the python wrappers

* Update testAbbreviations.py

* clear ring info if we added it

* document that the molecules with abbreviations removed have not been sanitized
2020-09-28 17:09:46 -04:00
jones-gareth
9a864f4238 Sgroup (#3390)
* Changes to use SubstanceGroups in Java

* Forgot to add SWIG file

* Java test for SubstanceGroup wrappers

* Added RDKit boilerplate
2020-09-09 04:59:08 +02:00
jones-gareth
0b97153a79 Add ScaffoldNetwork to csharp (#3289) 2020-07-13 14:48:34 +02:00
Greg Landrum
5712176605 Implement the two deprecations that were planned for the 2020.09 release cycle (#3047)
* Deprecation: planned removal of .message() and .getMessage() methods

* Deprecation: planned removal of old MolHash code

* document deprecations

* output the diffs when the psql tests fail

* remove .message() from SWIG wrappers

note that the KeyError doesn't work properly. We should clean up the the exceptions here anyway

* typo
2020-04-01 14:30:07 +02:00
jones-gareth
eb289cd13c Fix to allow multistructure images in Java/C# and use MCS for c# wrapper (#2898) 2020-01-23 09:03:09 +01:00
Eisuke Kawashima
185ec927ab Unset executable flag 2019-10-10 20:18:43 +09:00
Greg Landrum
49d247ea8c Fixes #2677 (#2687) 2019-10-03 18:07:26 -04:00
Greg Landrum
253f172353 Allow identification of chemistry problems (#2587)
* add AtomValenceException

* refactor a bit and add KekulizeException

* add copy ctor and copy() method

* add detectChemistryProblems

* add getType() method
want to be able to get the type of the exception without requiring doing a bunch of dynamic casts

* first pass at exception inheritance/translation
needs some cleanup and expansion, but this does pass all tests.

* cleanup and finish the python wrappers for the new exceptions

* make sure things are truly polymorphic

* wrap shared_ptrs of the new exception types

* expose DetectChemistryProblems()

* get the java wrappers building again

* transfer those changes to the c# wrapper

* add detectChemistryProblems()
and deal with the fun fun exception inheritance things that ensue

* response to review
2019-08-28 14:15:55 -07:00
Greg Landrum
b2a01a09ee Add java builds to azure devops (#2460)
* add linux_java build

* trigger azure pipelines builds on dev/ branches

* make sure boost::iostreams gets linked in the SWIG wrappers

* updates to get static boost builds working on mac

* update linux a bit and add mac build

* forgot to save the mac file

* install version of boost with -fPIC

* try to force use of the boost installed in /usr

* typo

* add library hint

* diagnosing a failing build

* be explicit about CXX version

* try to force use of the system compilers

instead of the ones from conda

* stop using conda

* typp

* re-enable full build

* disable the appveyor builds
2019-05-22 15:31:42 +02:00
Brian Kelley
d2f716a2e4 Adds gzstream stream, exposes to swig (#2314)
* Move RDBoostStreams to RDStreams

* RDBoostStreams->RDStreams

* RDBoostStreams->RDStreams

* Wrap SWIG (with Java test)

* Fix missing declaration

* Use the file that already exists

* Revert to original version

* Revert to CXSMiles version

* Update boost version

* Remove redundant code

* Add zlib

* check for win32

* FileParsers now builds static on windows
2019-03-18 05:32:42 +01:00
Brian Kelley
af6d413ccc Exposes substructlibrary to swig (#2337)
* SWIG wrap SubstructLibrary

* Fix tests

* Fix virtual overload for tagAtoms

* Add SubstructLibrary to swig
2019-03-12 16:35:22 +01:00
Dan N
eaa44b40c2 Enhanced stereo read/write support in SDF files. (#2022)
* add a couple test files

* backup

* first pass at some theory documentatin

* it's a draft

* Update enhanced stereochemistry documentation

Adds initial target use case and caveats about the tentative
nature of the current implementation.

* Support read/write of molfile enhanced stereochemistry

This includes reading and writing of enhanced stereochemistry
from v3000 molfiles (sdf). Enhanced stereochemistry encodes
the relative configuration of stereocenters, allowing
representation of racemic mixtures and compounds with
unknown absolute stereochemistry.

It does not include:
* Python wrapping
* invalidation of the enhanced stereochemistry
* use of enhanced stereochemistry in search
* depiction of enhanced stereochemistry.

* Update to reflect changes from #1971

* change names of enum elements to allow compilation in VS2017

I think it's also clearer to do things this way

* Addressed most review comments.

* Run missed test "testEnhancedStereoChemistry"
* In tests, added size checks to group equality checks
* Updated copyright statements
* Deleted mol created for a test
* Use perfect forwarding in RWMol::setStereoGroups()
* use references for stereo groups that are checked in write and pickle
* Updated stereogroup.h in hopes of fixing compilation on Windows.
* clang-format

* try allowing a switch to boost regex and requiring it for g++-4.8

* do a better job of that

* typo

* Code review comments. Updated Copyright notice.

* When an atom is deleted, delete stereo groups containing it.

Also updates StereoGroup toUse accessors instead of
constant member attributes. This allows move of StereoGroups.

* RDKit style guide

* Add header required on Windows.

* get the SWIG wrappers to build
2018-09-26 15:44:23 +02:00
Greg Landrum
2738c35178 Fixes #1903 (#1971)
* Fixes #1903

* update SWIG bindings too
2018-07-25 09:14:17 +02:00
Paolo Tosco
a2374aad74 - fix the build of CSharp wrappers just as for Java wrappers (#1914) 2018-06-14 19:18:45 -04:00
Greg Landrum
77078eac66 Add an auto-populated file with cmake config options (#1874)
* this is a rough first pass, needs to be finished and is a strong argument for changing the names of some of the #defines that are currently used

* rationalize the rest of the #defines
add something to the release notes about this
2018-06-09 05:41:28 +02:00
greg landrum
f051e329fd changes to get wrapper builds working on windows with VS2017 2018-04-11 15:28:58 +02:00
Greg Landrum
b8738361f1 Fixes #1776 (#1780)
* add wrapper for reaction fingerprints.
Fixes #1776

* Move definitions of default fingerprint params to .cpp file.

* just a kick to get travis to run
2018-03-20 10:10:40 -04:00
Greg Landrum
7325e67fb4 Fix #1413 (#1414)
* swig csharp wrappers now build

* fix this in a way that does not break the java wrappers
2017-07-02 10:24:10 +02:00
Greg Landrum
945cc3e402 Fixes #664 (#1364)
not tested yet...
2017-03-16 12:25:53 -04:00
Brian Kelley
b32697185a Adds RDProps to c# wrapper (#1188) 2016-12-04 16:07:29 +01:00
Brian Kelley
88637a59d7 Adds SWIGWIN definition in WIN32 if not 32bit (#1158) 2016-11-10 06:34:56 +01:00
Brian Kelley
092ab6ff12 Fixes csharp build for 64 bit systems (#1098)
* Fixes csharp build for 64 bit systems

* Need to support make and make install stages

* switch to an alternate strategy and get it working for the java wrappers too
this now builds for me on 64bit win10 with MSVC14

* add missing files from that last commit

* Hopefully fixes unix and osx builds while maintaining msvc builds

* Fixes mono builds, removes python check
2016-10-14 15:40:05 +02:00