Commit Graph

2596 Commits

Author SHA1 Message Date
Greg Landrum
2174465536 minor oversight in fix for #1810 (#1816) 2018-04-11 09:42:11 +02:00
Greg Landrum
d4839de4a0 Various small tweaks (#1814)
* remove a bunch of MSVC compiler warnings

* remove a compiler warning

* try running tests in appveyor

* typo

* investigation

* is the problem the os item?

* investigation

* output on test errors

* if only I could type

* suppress some warnings on windows (and remove a bogus attempt at doing so)

* build without serialization

* this should have been noticed for #1767
2018-04-11 04:52:37 +02:00
Greg Landrum
e8c46ca2a9 Fix/github1810 (#1811)
* Fixes #1810
There's still a problem with stereo atoms (see the commented out test),
but this takes care of the basics and that's up next.

* clean up that last problematic bit.
Still needs all tests to run

* this seems to be a necessary workaround for problems with VS2017.
It's a bit ugly, but shouldn't have any performance impact, so I'm not
going to get too worked up.

* This set of changes alters what we get for some of the InChI test cases.
Adjust for that.
2018-04-11 04:48:16 +02:00
Greg Landrum
2284d5da92 Fixes #1615 (#1797) 2018-04-04 10:43:34 +02:00
Greg Landrum
5cf8a6a9b7 Support for a JSON-based molecule interchange format (#1798)
* expose addRing to python

* backup commit

* basics of atom and bond loading

* basics of atom and bond loading

* do bond stereo too

* Loads of cleanups
Read conformers and molecule properties
Better tests
update one of the test values so that we aren't always testing ccw

* enable auto-download of rapidjson distrib

* reader now mostly done (still missing atomic/bond properties)

* a bit of optimization

* a bit of cleanup

* a bit more optimization

* backup

* test zero-order bonds

* prep work for writer (not done)

* add isotope support

* backup

* getting there with the writing

* progress on writing; still need to do the RDKit part though

* can now roundtrip, including chirality.
double bond stereo needs to wait for backend fixes

* add a timing test for benchmarking

* add a timing test for benchmarking

* add another template

* add parse params; optionally set bond types to aromatic; add python wrapper

* disable benchmark run by default

* write conformers

* refactoring

* docs

* port to commonchem

* switch representation

* start reading and writing properties

* fix a memory problem

* set a common_property for gasteiger charges

* parse partial charges

* add partial charge writing

* reformatting

* add support for disabling parts of the parsing

* remove the "name" property from files

* editing

* more post-review changes

* make the molinterchange build optional

* make them really optional
2018-04-02 05:12:03 +02:00
Greg Landrum
6cacab7fd2 disable building the sln parser with gcc v4.8 (#1801) 2018-04-02 05:10:58 +02:00
Greg Landrum
0d7bb5796f Fixes #1793 (#1795)
A bit of reformatting too.
2018-04-02 05:02:15 +02:00
Greg Landrum
3637cd4d75 Fixes Issue 1614 (#1781)
* This makes assignStereochemistry cleanIt=True not remove CIS/TRANS
bond stereo chemistry that was manually added as described in issue #1614.

Incorrect CIS/TRANS stereochemistry will still be removed by
'cleanIt=true' if symmetry is detected. However, this symmetry
detection doesn't work in more complex pseudo-stereo chemistry cases:
bond stereo that depends on other bond stereo to break symmetry; and
bond stereo that depends on other atom stereo centers to break
symmetry. Test cases for these cases have been added ifdef'd in based
on USE_NEW_STEREOCHEMISTRY.

However, getting USE_NEW_STEREOCHEMISTRY to work in a copacetic way is
not trivial, I tried a little bit here to no avail. I'm leaving the
test cases checked in as they should be useful when we decide to make
the plunge into using Canon::chiralRankMolAtoms for symmetry detection
instead of the CIP ranks.

So this fixes at least the glaring issue of STEREOCIS and STEREOTRANS
being incorrectly removed by 'cleanIt=true' when it is indeed valid
stereo. The checks made for symmetry are rudimentary, but don't feel
complete.

* add another test; make what's being tested explicit

* test smiles generation and function when Hs have been added

* add a test that fails

* I think that it's ok to remove this

* backup

* At this point all tests pass.
Bond wedging is now handled even if sanitization is turned off when mol files are read

* adjust to code changes

* fix a couple problems caused by rebase

* update docs
2018-04-01 17:48:36 +02:00
Boran Adas
8452ec59f9 Fix for issue #1730 (#1792)
* Fix for issue #1730

setAromaticity() now works even if there are aromatic atoms present and the relevat test case is added

* Removed setaromaticity flag
2018-03-25 06:38:34 +02:00
susanhleung
1743ced5a5 add Tversky index calculation for shapes (#1777)
* trying to add shape tversky

* alpha and beta no defaults, added more tverskyIndex tests to testGrid

* corrections to GridUtils.h and ShapeUtils.cpp

* corrections to GridUtils.h
2018-03-24 08:33:30 +01:00
Greg Landrum
3f136946e3 Start using "*" instead of "[*]" in SMILES (#1788) 2018-03-23 15:52:52 -04:00
Jeff van Santen
e593d13f6f Fix typo in GetBoolProp documentation (#1770)
@jvansan Thanks!
2018-03-23 12:25:36 +01: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
0f74b0f0be Fixes #1763 (#1765)
rename that test too
2018-03-09 08:38:26 -05:00
Greg Landrum
bea45ebece make the build work even if boost::serialization is disabled (#1767)
* make the build work even if boost::serialization is disabled

* get tests working when serialization is disabled
2018-03-06 11:47:06 -05:00
Greg Landrum
26718fd45f Fixes #1756 (#1757) 2018-02-22 03:43:46 +01:00
Greg Landrum
0c530637f2 Stop dereferencing end() iterators (#1748)
* cleanup the build requirements for test-valgrind

* cleanup a recently added test

* the new iterators would dereference end() iterators. Fix that.
2018-02-22 03:43:28 +01:00
Greg Landrum
108d84ab1e Switch from boost::thread to std::thread (#1745)
* boost::thread mostly gone... still need to get rid of once
everything compiles

* replace boost::call_once

* remove link-time dependency on boost::thread

* first pass at using async

* switch to using async everywhere
2018-02-22 03:43:07 +01:00
Greg Landrum
f6bbba411d Fix github1734 (#1741)
* Fixes #1734
still want some additional testing though

* formatting

* typo

* add python tests

* response to review
re-enable some forgotten tests
2018-02-15 20:24:40 -05:00
Brian Kelley
87dda6acd2 Fixes #1735 (#1743)
* Fixes #1735

I’m unsure if this is the correct solution, it appears
empty molecules never initialize their rings.

* Return immediately when ranking empty molecules

* Make github issue the correct one

* Always resize results to the number of atoms
2018-02-15 05:39:02 +01:00
Greg Landrum
007a11ea77 Fixes #1749 (#1750)
* Fixes #1749

* remove some deprecation warnings in the unit tests
2018-02-15 05:39:02 +01:00
Greg Landrum
42eecc664d Integrate Coordgen (#1708)
* first pass, does not yet actually work

* pass2, same problems

* pass2, same problems

* another test

* new tests; bugfix

* move the code out to a header

* add a double bond example

* enable auto-downloads of the code

* move the function to its own namespace

* first pass at a basic python wrapper

* change coordgen commit used

* try supporting bond stereo; does not currently work

* cis/trans seems to now work.

* first pass at templates; needs testing

* use the fixed flag too

* need mol align

* expand test

* initial pass at python wrapper for template

* simplify tests

* add an option to directly use a substructure match for alignment

* scaling

* add #define

* Define a cache setting for RDK_COORDGEN_LIBS to allow these to be used in other packages

* return the conformer id from addCoords

* Make CoordGen the default when it’s available.
This is a backup commit… the tests don’t even come close to passing.

* add some debugging options for a bit

* add alignment step to testing when using non-fixed coords

* Add global to allow use of CoordGen to be disabled
get the basic depictor tests working

* make coordgen the default when it is available

* make sure things continue to work when coordgen is disabled

* get windows builds working

* mods to get this building on windows.
something is screwy with the fileParsersTest1

* no need to generate coords for the 1K C string

* fix java wrappers

* works on linux

* update the (stupid) way dependencies were handled on windows.
this allows a lot of cleanup of cmake files (still more to do)
the linux build is unlikely to work due to the way _statics aren't handled

* docs

* extend forceRDKit applicability

* switch coordgen version

* try using templates

* try to get the template dir finding reasonably robust w.r.t. conda install

* continuing to iterate on the way the template file is installed

* fix a problem caused by the merge

* remove test that should never have been checked in

* update expected results for cartridge tests

* switch back to using the RDKit as the default coordinate generator
2018-02-15 05:36:03 +01:00
Greg Landrum
b0f44cac0c switch to using std::regex in the SLN parser (#1746)
* switch to using std::regex in the SLN parser;
removes the boost regex dependency

* cleanup
2018-02-14 20:54:55 -05:00
Greg Landrum
f35e04403a replace the usage of rdk_auto_ptr with std::unique_ptr (#1752)
That is what was being used for modern c++ anyway
2018-02-14 19:49:47 -05:00
Greg Landrum
8c43f2d6f2 Use uint32 atom and bond indices (#1742)
* Switch to uint32 for atom index to support more atoms

* Test adding and removing big number of atoms (70k)

* Change order of properites in Atom class
2018-02-10 09:43:49 +01:00
Maciej Wójcikowski
7987c7fa66 Treat bonds in PDB explicitly, but make blacklisted ones zero-order. (#1658) 2018-02-10 06:22:47 +01:00
Greg Landrum
e7422eac3c Fixes #1689 (#1733) 2018-02-10 06:22:24 +01:00
Paolo Tosco
503b84995c - make bond stereo detection in rings consistent (#1727) 2018-02-01 04:28:10 +01:00
Greg Landrum
ef60d71c6f Allows CIS/TRANS double bonds to be de-pickled (#1710) (#1711)
* Fixes #1710

* add an additional test for #1563 while we're here
2018-01-21 07:18:26 +01:00
Maciej Wójcikowski
bfb3559e07 Improve AddHs for molecules read from PDB (#1647)
* Add AtomPDBResidueInfo during molops::addhs

* Test addhs and AtomPDBResidueInfo

* Little cleanup

* Fix serial

* Refactor code, add unique Hs labels

* Move code to separate function + bugfix.

* Make function optional (AddHs residueInfo param)

* Rename argument
2018-01-20 05:27:30 +01:00
Greg Landrum
e396e35b4d Fixes #1691 (#1718)
* add the relevant tests

* Fixes #1691
2018-01-12 11:21:52 -05:00
Greg Landrum
46e494b387 Set atomic properties from SMARTS (#1716)
* set some chemical properties (charge, isotope) on query atoms when parsing from smiles

* fix an irritating cmake problem

* add explicit Hs too

* I think this is now done
2018-01-12 11:15:05 -05:00
Greg Landrum
ae3aebeb32 Get queries from the new cactvs SMARTS extensions to pickle correctly (#1712)
* not yet working

* update smarts testing so that it verifies that the parsed patterns can also be pickled/unpickled

* fix pickling/unpickling of range queries;
add unpickling of new cactvs queries and range_ queries

* force CI to re-run

* cleanup in response to review
2018-01-09 12:23:36 -05:00
Greg Landrum
39ee6966fb new examples for looping over atom neighbors and bonds (#1709) 2018-01-09 12:22:38 -05:00
Brian Kelley
a661489226 Fix/rgroup prefer matching nonhs over hs (#1707)
* Tweak the scoring function to penalize non h matches considerably.  Only full H rgroups get a one.  Might need to tweak int the future

* Scale the hydrogens as 1/# mols unless they are a full group
2018-01-09 05:56:37 +01:00
Greg Landrum
5c21c0ad67 Fixes #1703 (#1714)
* does not actually work

* all tests pass;
Fixes #1703

* make that a bit cleaner
2018-01-08 20:06:42 -05:00
Greg Landrum
ba12d98ad0 Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers (#1713)
* Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers

* Actually delete atoms and bonds...

* RWMol::clear now calls destroy to handle atom/bond deletion

* Changes broken Atom lookup for windows/gcc

* Adds tests for running with valgrind

* Adds test designed for valgrind and molecule deletions

* Removes RNG, actually tests bond deletions

* update swig wrappers

* deal with most recent changes on the main branch
2018-01-07 14:19:47 -05:00
Brian Kelley
0a871bd72e Dev/modern cxx ranges (#1701)
Enable range-based for loops for molecules
2018-01-05 06:09:51 +00:00
Greg Landrum
ab8fc30081 Fixes github #1702 (#1706)
* Fixes #1702

* more on #1702
2018-01-04 18:32:19 +01:00
Greg Landrum
4049814132 Support some cactvs extensions to SMARTS (#1704)
* add queries for the number of heteroatom neighbors

* support cactvs "z" extension
this includes support for range queries on z that could
be extended to other query types as well

* extend range query extension to other SMARTS primitives

* add the less-than and greater-than versions of the range queries

* updates and new tests

* update .cmake files

* support [#6] in SMILES

* document SMILES extensions (such as they are)

* Add support for cactvs's Z queries

* add support for ^4 and ^5

* get tests running
doc update

* book updates

* update .cmake files
2018-01-04 12:00:39 -05:00
Paolo Tosco
f77a0794a4 - implemented Python wrappers for computePrincipalAxesAndMoments() and computePrincipalAxesAndMomentsFromGyrationMatrix() (#1700) 2018-01-03 17:06:42 +00:00
Paolo Tosco
995db8c18f Addresses GitHub #1688 (#1694)
* Addresses GitHub #1688

* - Addresses GitHub #1688 using a generic Python container rather than a Python list
2017-12-30 07:39:17 +00:00
Brian Kelley
35398acf3a Removes merge detritus 2017-12-23 12:47:54 -05:00
Brian Kelley
bc17df421f Adds case for testing invalid smarts in MRV SMA tags 2017-12-22 08:21:05 -05:00
Brian Kelley
bb2fa96b4e throws a fileparser exception when the M MRV SMA can't be parsed as a smarts 2017-12-22 08:20:54 -05:00
Brian Kelley
af0edef5a7 Automatically parses marvin smarts when reading 2017-12-22 08:20:46 -05:00
Brian Kelley
5fe9bbb780 Adds ability to read and parse marvin smarts in mol blocks 2017-12-22 08:20:31 -05:00
Greg Landrum
d15efc1ac9 Make the defaults for some functions less error prone. (#1690)
* auto generate coords in mol block writer if includeChirality = True

* default to include chirality when writing mol blocks/files

* make isomeric smiles the default; note that not all tests are passing at the moment

* update a reaction test

* update expected cartridge search results
at this point all python, c++, and cartridge tests pass

* docs

* update incompatibility docs

* update doctests

* these now build

* minor example update

* update expected c++

* typo

* make allowCXSMILES=true the default

* add auto perception of chirality when reading 3D structures from mol blocks

* explain changes in release notes

* further doc update
2017-12-22 08:09:36 -05:00
Greg Landrum
636a0f6e69 Cleanup a bunch of compiler warnings (#1697)
* remove a bunch of compiler warnings

* remove some more warnings on windows (there are still plenty to go...)
2017-12-22 12:59:52 +01:00
Greg Landrum
ef732e721f Fixes #1695 (#1696) 2017-12-21 08:43:21 -05:00