Commit Graph

3241 Commits

Author SHA1 Message Date
Greg Landrum
b9e8ab4a53 Fix/github1262 (#1265)
* fix for calculation of prinicipal moments of inertia

* fix a typo
update expected values

* PMI and NPR tests working

* cleanup some of the other descriptors and tests

* Test against Moments.py descriptors

* add new tests from Brian

* remove some warnings
2017-02-05 08:35:34 +01:00
Greg Landrum
26f0b648d6 Fixes #1266 (#1270) 2017-02-05 08:34:59 +01:00
Greg Landrum
406c222b13 Fixes #1251 (#1252) 2017-02-05 08:34:27 +01:00
Paolo Tosco
0c8f66abb7 - fixed build failure on Windows due to missing link to library (#1241) 2017-02-05 08:21:18 +01:00
Brian Kelley
4d45d9dd41 Turns on -fpermissive for gcc >= 6 and boost < 1.62 (#1225) 2017-02-05 08:20:57 +01:00
Greg Landrum
56af8bbb7f Fixes #1230 (#1231)
* Fixes #1230

* add a test for cleanIt = False
2017-02-05 08:20:28 +01:00
Greg Landrum
01829cc4e7 add support the new sequence readers to wrappers (#1181) (#1221)
* Fixes #1181
needs more testing

* improved docs and a couple tests

* add the new sequence support to the java wrappers too
2016-12-21 04:54:00 +01:00
Greg Landrum
60d163c8d0 Fixes #1219 (#1220) 2016-12-21 04:52:45 +01:00
Greg Landrum
15a24679b8 Fixes #1204 (#1212) 2016-12-21 04:50:59 +01:00
Greg Landrum
da72fa16dc removes the 32bit problem (#1187) 2016-12-21 04:49:53 +01:00
Greg Landrum
4327d2acb3 fix compatibility with PostgreSQL 9.2 (#1189)
* fix compatibility with PostgreSQL 9.2

* get tests working on pgsql92; the Makefile does not currently work

* simplify 9.2 handling

* seems to work on 9.6 and 9.2 now
2016-12-21 04:49:14 +01:00
Brian Kelley
a867fbc394 Adds RDProps to c# wrapper (#1188) 2016-12-21 04:48:59 +01:00
Paolo Tosco
bb85eababd Fixes #1162 (resMolSupplierTest failing with boost 1.62) (#1166)
* - fixed issue with weighted formal charges being stored as unsigned rather than as signed int
- the sum of formal charge and multiple bond indices is now used as last resort sort criterion to achieve stable sorting of degenerate resonance structures

* - added C++ and Python tests for GItHub #1166
2016-12-21 04:45:43 +01:00
Greg Landrum
15e8c71568 Fixes #1177 2016-11-23 04:33:23 +01:00
Greg Landrum
0aa1a9bd6e Merge pull request #1178 from rdkit/fix/more_vs2008
this now builds with vs2008
2016-11-23 04:32:46 +01:00
Greg Landrum
275d2145a7 Merge pull request #1172 from mcs07/traj
Fix Trajectory GetSnapshot behaviour after Clear
2016-11-23 04:31:58 +01:00
Matt Swain
af76d55800 replace std::map::at with std::map::find
The 'at' method of std::map is a C++11 feature not supported by Visual Studio 2008.
2016-11-23 04:29:24 +01:00
Riccardo Vianello
402098ed63 add missing $RDKLIBS 2016-11-23 04:28:56 +01:00
Matt Swain
f70ad0e643 Include <boost/cstdint.hpp> for uint64_t (#1168)
One more occurrence of `uint64_t` that requires `<boost/cstdint.hpp>` due to the lack of `<stdint.h>` in Visual Studio 2008.
2016-11-23 04:26:17 +01:00
Greg Landrum
bcc9b22e20 switch from <stdint.h> to <boost/cstdint.h> 2016-11-11 15:17:23 +01:00
Greg Landrum
559b482296 only use boost::multiprecision when it is installed (#1161) 2016-11-11 07:23:37 -05:00
Brian Kelley
8c41e248e4 Fix/java win64 memoryleak (#1159)
* Fixes memory leak

* Fixes java windows 64 builds
2016-11-11 04:44:22 +01:00
Steve Roughley
3680644ebf Added getAlignmentTransform to ROMol.i to expose in Java SWIG wrapper (#1155)
* Added getAlignmentTransform to ROMol.i to expose in Java SWIG wrapper

* Added missing argument

Added missing argument to call to getAlignmentTransform causing build failure

* Added test case for getAlignmentTransform

* Update AlignTests.java

* Update AlignTests.java

* Update AlignTests.java
2016-11-10 21:44:03 +01:00
Brian Cole
902a7b81bb Wrap DetectBondStereoChemistry in python (#1156)
* Expose RDKit's DetectBondStereoChemistry to python.

* Adding a test case for DetectBondStereoChemistry from python.

This test case ensures a new molecule can be constructed from scratch
and DetectBondStereoChemistry detects the correct bond stereo from the
3D coordinates alone.
2016-11-10 21:41:25 +01:00
Brian Kelley
88637a59d7 Adds SWIGWIN definition in WIN32 if not 32bit (#1158) 2016-11-10 06:34:56 +01:00
Greg Landrum
f003eb6683 flag the Enumerate library as beta 2016-11-09 11:53:34 +01:00
Greg Landrum
bada20dbaf Expose new default parameter objects to python (#1150)
* Fix a bug in the python DistGeom tests.

* test new features

* add simple parameter objects for ETDG, ETKDG, and KDG

* Update conformation generation documentation to use the new parameter objects.
2016-11-06 10:17:47 +01:00
Greg Landrum
38dde43411 add some additional parameters tests to python wrapper;
fix typo in python wrapper
2016-11-06 10:09:57 +01:00
Greg Landrum
5943f064f0 additional AdjustQueryParameters options for cartridge 2016-11-06 09:41:48 +01:00
Greg Landrum
051a4deb12 add tests for the new param objects from java 2016-11-05 20:03:25 +01:00
Greg Landrum
f5d261dd37 fix a build problem with boost 1.56 on the mac 2016-11-05 15:09:12 +01:00
Brian Kelley
fa89438358 Dev/reaction enumeration (#1111)
* Adds C++ Enumeration Engine to the RDKit

* Adds Sanitization helpers, wrappers and tests

* Clang format

* Remove unused enumerationStateOnly flag

* Fixes docStrings to current API

* Adds doc strings

* Removes RGroupPosition, adds getPosition to EnumerationBase

* Fixes readability.

* Adds EnumerateLibraryBase::reset and getReaction

* Added getReagents method to EnumerateLibrary

* Make the tests have the same naming

* Need to save the initial state for resetting.

* Stupid case-insensitive file systems

* Moves ResetState to EnumerateLibraryBase

* Adds removeNonmatchingReagents helper

* Renames currentPosition to getPosition

* Adds Enumeration Toolkit tutorial

* Fixes Python3 serialization and enumerators

* Verified to run on python2 and 3

* Fixes integer issues on windows

* The number of enumeration should be unsigned.

* Adds deserialization constructor

* Moves boost_serialization to the end

* Deprecates Clone in favor of copy

* Update tests to use copy.copy not Clone

* Move RGROUPS and BBS into an EnumerationTypes namespace

* Make sure old pickles work

* Adds pickle for backwards compatibility

* Moves to uint64_t from size_t for public api

* Whups, accidentally used the binary archiver.

* Commits boost 1.55 serialization

* Makes serialization turnoffable Like Filter Catalog

* Fixes tests when serialization not available.  Adds more enumeration strategy tests

* Fixes a syntax error on some versions of python

* Fixes sanitizeRxn to actually make proper RGroup atoms

* Updates SanitizeRXN python API

* Updates Enumeration API to a parameter class - fixes reagent removal

* Adds a mess of tests

* Change stats to return a string.

* Exposes EvenPairSamplingStrategy Stats to python

* Fixes a crash bug in SanitizeRxn

* Adds better testing of the even pair sampling

* Fixes namespace

* One more try to fix gcc

* Enum classes are c++11 and a microsoft extension.

* Fix typo

* Fixes np.median for python3

* Fixes atom iterators

* Adds virtual tags to derived virtual functions (for clarity)

* Fixes size comparison issues

* Adds doc string

* Small cleanup (has no effect since flags aren’t used)

* fixes crash bug on windows

* get the tests working on windows

* Updates tutorial

* Adds Glare implementation to Contrib
2016-11-05 14:42:52 +01:00
Greg Landrum
1b946794f0 replaceBond and generic atoms and bonds in adjustQueryProperties() (#1141)
* first pass at RWMol::replaceBond()

* get ready for the changes

* rename some options
add bond options (not doing anything with them yet)
update tests to reflect new options

* backup

* re-enable the rest of the tests
2016-11-04 12:41:06 +01:00
Greg Landrum
f4a02f5f13 Expanded sequence support (#1140)
* patch from Roger Sayle to support nucleic acids as well as amino acids

* add some tests which do not yet pass

* fix a bug I introduced in residue name parsing

* basic sequence testing

* add some more tests
2016-11-04 04:29:26 +01:00
Greg Landrum
9f9f2cd2d2 support additional trans-uranic elements (#1134)
* support additional trans-uranic elements
- update the atomic data and isotope lists
- update the SMILES and SMARTS parsers

* rebreak an input file
2016-11-03 11:48:31 -04:00
Gianluca Sforna
c1fcd0b1d9 fix moldraw2d headers installation path (#1143)
* fix moldraw2d headers installation path

* add missing MolDraw2DDetails.h header
2016-11-03 15:45:41 +01:00
Greg Landrum
844ca32b70 Fixes #1112 (#1136) 2016-11-01 19:06:55 -04:00
Greg Landrum
fc5b52afcd Fixes #1035 (#1135) 2016-11-01 11:41:12 +01:00
Greg Landrum
4315388f77 Add a parameters structure for controlling the embedding options. (#1121)
* initial version; no actual testing yet

* start on tests

* rename seed->randomSeed; add tests

* add support in java wrapper

* add support in python wrapper

* initial version; no actual testing yet

* start on tests

* rename seed->randomSeed; add tests

* add support in java wrapper

* add support in python wrapper

* yapf

* document the parameter object;
introduce pre-defined const objects for ETDG, ETKDG, and KDG

* this is why we write tests

* swig did not like the initialization in the header file
2016-11-01 11:39:03 +01:00
Greg Landrum
304fbf593e merge 2016-10-30 10:16:14 +01:00
gedeck
0845573a45 Script PythonFormat uses yapf to check the formatting of Python files 2016-10-29 17:13:13 -04:00
Brian Cole
893fa41e98 SSSR performance improvements to support larger systems (#1131)
* findSSSR performance improvements for fragments without rings

This makes Chem.SanitizeMol significantly faster when dealing with
molecules with lots of disconnected fragments (like a box of water).

The following is the runtime of Chem.SanitizeMol while adding 10,000
waters with explicit hydrogens when running Chem.SanitizeMol on every
1,000th water added.

Before:
0 add_water = 0.00007s
0 Chem.SanitizeMol = 0.01991s
1000 add_water = 0.00009s
1000 Chem.SanitizeMol = 0.99659s
2000 add_water = 0.00013s
2000 Chem.SanitizeMol = 3.94565s
3000 add_water = 0.00018s
3000 Chem.SanitizeMol = 8.94760s
4000 add_water = 0.00023s
4000 Chem.SanitizeMol = 15.75187s
5000 add_water = 0.00035s
5000 Chem.SanitizeMol = 24.59318s
6000 add_water = 0.00048s
6000 Chem.SanitizeMol = 37.23530s
7000 add_water = 0.00042s
7000 Chem.SanitizeMol = 47.70860s
8000 add_water = 0.00105s
8000 Chem.SanitizeMol = 62.21912s
9000 add_water = 0.00056s
9000 Chem.SanitizeMol = 80.08511s

After:

0 add_water = 0.00003s
0 Chem.SanitizeMol = 0.01219s
1000 add_water = 0.00004s
1000 Chem.SanitizeMol = 0.01004s
2000 add_water = 0.00012s
2000 Chem.SanitizeMol = 0.01058s
3000 add_water = 0.00018s
3000 Chem.SanitizeMol = 0.01158s
4000 add_water = 0.00018s
4000 Chem.SanitizeMol = 0.01530s
5000 add_water = 0.00022s
5000 Chem.SanitizeMol = 0.02010s
6000 add_water = 0.00036s
6000 Chem.SanitizeMol = 0.02397s
7000 add_water = 0.00033s
7000 Chem.SanitizeMol = 0.02978s
8000 add_water = 0.00037s
8000 Chem.SanitizeMol = 0.04446s
9000 add_water = 0.00040s
9000 Chem.SanitizeMol = 0.04419s

* Refactor new_timings.py script a bit to be able to run only the first (reading molecules) test.

* Removing O(N^2) behavior of finding the number of bonds in the fragment during SSSR.

This only improves the case when there are long chains and a small
number of rings in the fragment. Many ring systems are still dominated
by the rest of the SSSR algorithm, and fragments with no ring systems
don't reach this part of the code.

For a test case with a single cyclicpropane and adding carbons while
calling Chem.SanitizeMol every 10,000 carbons added yield the
following improvement in performance:

before:
0 add_carbon = 0.00001s
0 Chem.SanitizeMol = 0.01237s
10000 add_carbon = 0.00017s
10000 Chem.SanitizeMol = 0.04453s
20000 add_carbon = 0.00017s
20000 Chem.SanitizeMol = 0.13038s
30000 add_carbon = 0.00029s
30000 Chem.SanitizeMol = 0.27671s
40000 add_carbon = 0.00063s
40000 Chem.SanitizeMol = 0.44774s
50000 add_carbon = 0.00106s
50000 Chem.SanitizeMol = 0.69433s
60000 add_carbon = 0.00181s
60000 Chem.SanitizeMol = 1.00577s

after:

0 add_carbon = 0.00001s
0 Chem.SanitizeMol = 0.01264s
10000 add_carbon = 0.00013s
10000 Chem.SanitizeMol = 0.01349s
20000 add_carbon = 0.00022s
20000 Chem.SanitizeMol = 0.02724s
30000 add_carbon = 0.00040s
30000 Chem.SanitizeMol = 0.04292s
40000 add_carbon = 0.00076s
40000 Chem.SanitizeMol = 0.06172s
50000 add_carbon = 0.00193s
50000 Chem.SanitizeMol = 0.07658s
60000 add_carbon = 0.00147s
60000 Chem.SanitizeMol = 0.08625s

Note, couldn't actually test a higher number of carbons as it led to a
stack overflow due to recursion in findSSSR.
2016-10-29 04:38:14 +02:00
Greg Landrum
3b41772851 add support for a default constructor to the python-exposed RWMol class (#1129) 2016-10-29 02:17:12 +02:00
gedeck
4ecbad332c yapf formatting of recent changes to Python code in rdkit and Code 2016-10-24 11:57:08 -04:00
Greg Landrum
81ee476fd7 Fixes #1118 (#1119) 2016-10-24 11:15:25 -04:00
Greg Landrum
00c409ca59 update documentation 2016-10-24 08:45:58 +02:00
Greg Landrum
b1964c2cc7 get the structchecker tests building again 2016-10-24 08:06:17 +02:00
Brian Kelley
8609cd4883 Add StructChecker functionality
* StructChecker changes. Initial commit. First implementation. Added some tests.

* StructChecker: add  GoodAtoms and AcidicAtoms. new updates

* StructChecker: add new tests

* StructChecker: added TransformAugmentedAtoms()

* StructCheck: add structCheck to GraphMol. Fix compilation errors.

* StructChecker: add stereo verification and some utilities.

* StructChecker: function FixDubious3DMolecule was added

* StructChecker: checkStereo added. done with stereo.

* StructChecker: add StripSmallFragments()

* StructChecker: add AtomClash() function. Some cosmetic + tests

* StructChecker: checkAtoms() was started

* StructChecker: checkAtoms is ready

* StructChecker: user RingInfo from RDkit. Start regarge

* StructChecker: ReCharge molecule method prototype

* StructChecker: updates for ReCharge. Almost finished

* StructChecker: all ReCharge is done except external data tables loading

* StructChecker: add path tables into API. ReCharge completed

* Adds augmented atom data

Signed-off-by: Brian Kelley <brian.kelley@novartis.com>

* Removes extra files

Signed-off-by: Brian Kelley <brian.kelley@novartis.com>

* Adds path to test data via RDBASE environment

Signed-off-by: Brian Kelley <brian.kelley@novartis.com>

* Revert "Struct checker apr15"

* StructChecker: add missing tautomer tests

* Updates test to use RDBASE

* Adds initialization of data from data section

* Adds Python API and tests

* Fixes namespace for enum

* StructChecker: update/imporve strip small fragments

* StructChecker: fix acidic atoms (but logic does not work)

* StructChecker: fix match issue for CheckAtoms

* Adds macro guards

* Adds loading API and proper constructor

* Fixes tests, adds stereo test

* Fixes crash bug, matches[0] was being accessed from an empty match vector

* Reverts crash fix - conflicts with previous

* Adds the rest of the structure checker options

* StructChecker: fix atom matching for aromatic rings

* StructChecker: add tautomers checks. Update some tests

* StructChecker: stereo fixes. Add some tests

* StructChecker: fix check atoms. Start ligand symbol list

* StructChecker: fix some check atoms validation. Add Tranform to query lists. Start correct loading augmented atoms

* update

* another set of fixes

* StructChecker: fix loadDefaultAugmentedAtoms. Some changes in CheckAtom + tests + debug conditional breakpoints (TEMP operators)

* StructChecker: rewrited RecMatch() to sequential. Changed bond matching algorithm. small bug fixes

* Adds better logging of mismatched atoms

* Removes duplicated negative charge

* Fixes charges

* Adds nitro group test

* StructChecker: add better logging

* remove double logging

* Reformats code using RDKit's clang-format style

* StructChecker: Fix charge reformat using RDKit format.

* StructChecker: compilation restore after merge

* restore bond matching

* Removes the same fragments that strucheck does in case of ties

* Don't resanitize - this adds aromaticity which mucks things up

* Adds empty molecule checks

* Fixes atom clashes.

* Removes debug printing

* Removes debug logging info

* First pass at stereo fixes

* Fixes off by one error for dubious stereo fix

* Fixes more off by one errors

* Fixes more off by one errors

* More off by one fixes.

* Another off by one

* Fixes chiral flag set in molfile check

* Copies chiral flag over to largest fragment if necessary

* Poor man’s parity check.

* Find unspecified chiral centers ala Avalon.

* StructChecker: fix recursive match. Fix transformations

* StructChecker: fix transformation for atom list (using query atoms)

* Fixes checks && to &

* StructChecker: fix carboxylic acids tranform issue. Atom list is changed only if different

* StructChecker: documentation was updated

* Fixes snprintf and silences some warnings

* Adds Get/Set StructCheckerOptions

* Adds default AugmentedAtomTransforms
2016-10-24 08:00:07 +02:00
Brian Kelley
6950e2de16 Check for doubles after other integer types when reporting properties (#1115) 2016-10-21 20:43:43 -04:00
Brian Kelley
13c3eef7c4 Dev/expose filtermatch to swig (#1117)
* Exposes FilterMatch and getFilterMatches to java

* Updates java test

* Fixes typo in test
2016-10-21 20:43:00 -04:00