Commit Graph

50 Commits

Author SHA1 Message Date
Greg Landrum
644296fe13 Add Molecular Interaction Fields (#7993)
* Add RealValueVect.

* Add UniformRealValueGrid3D

* Add Molecular Interaction Fields (MIFs)

* line endings

* cherry-pick f1bc94a4c8

* format

* Adapt tests for python3.

* Adapt RealValueVector pickling for python3.

* Speed-up of MIF calculations.

* Bugfix in MIFDescriptors.cpp.

* all tests pass

* clean up some memory leaks

* update copyrights

* rename

* rename the library

* complete the rename

* lost file

* another forgotten file

* cleanup

* clang-tidy

* clang-tidy

* windows DLL builds work

* python wrapper and tests cleanup

* convert to catch2 testing

* switch RealValueVect to use std::vector

* remove obsolete friend

* - Replace explicit loops with stdlib implicit equivalents
- Replace explicit types with auto where possible
- Avoid unnecessary copy operations where possible
- Replace raw pointers with exception-safe unique_ptr
- Replace C-style #define with constexpr
- Replace C-style casts with C++ casts
- Replace C-style arrays with std::vector
- Avoid code duplication with templated operators
- Replace VdWaals class taking multiple atom type definitions and force-field name as string parameter with force-field-specific classes deriving from an abstract VdWaals class
- Replace x,y,z doubles with Point3D class where possible
- Removed unused (and untested) DistanceToClosestAtom class
- Renamed some variables and functions for better clarity
- Converted tabs to spaces
- Made the mol parameter in cube read/write functions optional for convenience
- Made the Python wrappers more pythonic (e.g., avoid C++-style passing objects as parameters which are modified in place)
- Implemented alternative Python class constructors using boost::python::make_constructor rather than with external non-class functions
- The Python wrappers taking a sequence of Point3D now take a sequence of sequences, such that the output of Conformer.GetPositions() can be passed
- Made the Python wrapper sequence parsing more robust
- Removed duplicated code from Python wrappers

* - avoid an unnecessary copy

* progress

* works

* more cleanup

* all tests pass

* changes in response to review

---------

Co-authored-by: dfhahn <dfhahn@users.noreply.github.com>
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-12-19 09:54:52 +01:00
Greg Landrum
d3061b03ef Fixes github #7533 (#7539)
* Fixes #7533

Fixes problem with SparseIntVect and SparseBitVect where the intention is to
be able to store all possible values of the index type: in these cases
you could not store (or access) the final element.

* increase the verbosity of the DataStructs tests
so that we can see what's going on
2024-06-20 09:27:27 +02:00
Greg Landrum
38548bebfa Fixes #3944 (#4049) 2021-04-19 14:39:25 +02:00
Eisuke Kawashima
75f03412ef Modernize deprecated header inclusion (#3137) 2020-05-04 10:40:57 +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
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
Greg Landrum
d41752d558 run clang-tidy with readability-braces-around-statements (#2899)
* run clang-tidy with readability-braces-around-statements
clang-format the results
clean up all the parts that clang-tidy-8 broke

* fix problem on windows
2020-01-25 14:19:32 +01:00
Brian Kelley
75096ac33c [WIP] property custom handlers (#2293)
Allow custom type-handlers in the RDProps interface
2019-03-28 17:21:00 +01:00
Ric
6224a42516 Build warnings revisited (#2318)
* unused vars in bison parser cleanup

* initialization order in TopologicalTorsionGenerator

* unused params in SLN bison

* sln flex unused params

* throwing destructor in TDTWriter

* signed comparison in substructmethods

* unused input param in smiles/smarts bison

* unused ms param in sln bison

* signed comparison in FingerprintGenerator

* store return of fscanf in StructCheckerOptions

* unreferenced var in catch

* uninitialized value in FileParserUtils

* avoid override overload warning in MolDraw2DSVG

* non-final overrides in Validate.h

* unused static var in Avalon

* unused vars in catch blocks

* make AvalonTools avalonSimilarityBits & avalonSSSBits const int

* assert fscanf result in StructCheckerOptions
2019-03-08 16:42:54 +01:00
Ric
91008ff11d Address compile warnings & trivial improvements (#2097)
* Address compile warnings & trivial improvements

* revert unwanted initializers; use RDUNUSED_PARAM for unused params

* revert fix in testRDFcustom; marked with 'TO DO' comment
2018-10-12 06:39:32 -04: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
6782634bf8 Part of a fix for #1993 (#1994)
* add an additional equality test to testDatastructs
(can never have too many tests!)

* automatically run assignStereochemistry() for chiral fingerprints
This currently runs for the three FP types that support chirality: MFP, AP, and TT
2018-08-12 17:04:01 -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
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
Greg Landrum
c0a820fb87 tversky basics work; still need better testing at the FPB level 2016-01-18 10:15:05 +01:00
Greg Landrum
7c0d4bdd89 add bitmap version of AllProbeBitsMatch() 2016-01-12 12:09:55 +01:00
Greg Landrum
dea28eb2fc add tests for the bitmap bitops 2016-01-12 12:09:54 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Brian Kelley
54311dff9c Suppresses warnings in tests 2015-10-18 16:09:58 -04:00
Riccardo Vianello
7c346d7c2e Code/RDBoost/Exceptions.h moved to Code/RDGeneral 2015-03-16 22:31:48 +01:00
Schneider
3af5ba223c ExplicitBitVect: Add +operator to concatenate two ExplicitBitVects 2014-08-19 12:59:50 +02:00
Sereina Riniker
52ce73219e explicit bitvect with all ones added 2014-04-07 12:54:20 +02:00
Greg Landrum
05840816cd Add Rogot Goldberg and AllBit similarity to C++ and the python wrapper.
(contribution from Sereina Riniker)
2013-01-08 15:10:51 +00:00
Greg Landrum
3a3b582d28 clean up + add support for D and T in molecular formula 2012-07-27 06:16:45 +00:00
Greg Landrum
c064c170a9 another attempt at an endian fix 2012-05-28 14:53:23 +00:00
Greg Landrum
a4304f95ab an attempt to resolve the problem with serialization and endian-ness 2012-05-21 04:18:51 +00:00
Greg Landrum
2da097b95c fix some edge cases with FPS text and binary text for fingerprints 2012-01-10 03:47:23 +00:00
Greg Landrum
b6300a86fe support bit vects <-> byte strings 2012-01-08 06:12:47 +00:00
Greg Landrum
05bc49c452 support initializing from FPS text as well as creating it; add some tests 2011-12-20 05:24:06 +00:00
Greg Landrum
a574c1f017 add support for generating FPS-style hex strings 2011-12-18 14:20:00 +00:00
Greg Landrum
651edcd751 fix and tests issue 3295215 2011-04-30 03:15:46 +00:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
20096c76a9 refactoring of the BitVect interface to make capitalization consistent
w/ the rest of the RDKit. i.e.: SetNumBits -> setNumBits
2010-05-30 15:15:46 +00:00
Greg Landrum
423433a3e4 support Tversky similarity for SparseIntVects 2009-06-18 14:37:03 +00:00
Greg Landrum
ba8454586b initial version of Tversky similarity (feature request 2015633) along with a bit of refactoring
http://sourceforge.net/tracker/index.php?func=detail&aid=2015633&group_id=160139&atid=814653
2008-07-11 11:13:03 +00:00
Greg Landrum
013fbde5b6 finish cleaning up the base64 code and fixing a core leak; add a test as well 2008-07-09 06:46:26 +00:00
Greg Landrum
940a9733b9 add operator== and operator!= to BitVects 2008-06-16 07:09:13 +00:00
Greg Landrum
029e08d6b4 merge in the changes from the 64 bit port branch r703:717 2008-06-11 05:01:17 +00:00
Greg Landrum
62cf27be2a this makes it build under windows 2008-04-25 03:36:31 +00:00
Greg Landrum
10faff5964 add "distance" support; some code cleanup 2008-04-24 09:04:50 +00:00
Greg Landrum
93834a90bd remove support for the useAbs function;
add bounds support on the dice metric
2007-10-05 15:35:11 +00:00
Greg Landrum
0ab0653c18 move DiceSimilarity code into c++ 2007-10-04 03:34:06 +00:00
Greg Landrum
67f7dab587 fix a problem with __len__ in python (can't do it if we return a Long);
wrap GetLength() instead;
add getNonzeroElements()
2007-09-28 03:45:03 +00:00
Greg Landrum
1fa8cd321b add SparseIntVect in both c++ and Python
This still needs windows testing.
2007-09-22 18:49:37 +00:00
Greg Landrum
37bf5f56f8 add operator+, operator-, operator+=, and operator -= 2007-03-17 06:55:53 +00:00
Greg Landrum
e66f08dc33 support operator& and operator|;
some doc cleanups;
fix a problem in the copy ctor for DiscreteValueVect
2007-03-15 05:59:08 +00:00
Greg Landrum
f31ac073b5 add pickle support to the UniformGrid and DiscreteValueVect classes;
This still needs to be checked on linux
2007-01-26 04:41:36 +00:00
Greg Landrum
5d03333c22 setup svn keywords (should have done this before import... grn) 2006-05-06 22:54:39 +00:00
Greg Landrum
75a79b6327 initial import 2006-05-06 22:20:08 +00:00