Commit Graph

175 Commits

Author SHA1 Message Date
Greg Landrum
a58f9bef8e Add an MDL aromaticity model (Fixes #1622) (#1693)
* backup

* Add a couple of more tests and an exclusion for triple bonds.

* expose the MDL aromaticity model to python and test it.

* exocyclic bonds should not “steal” electrons in the MDL model

* backup (partial) update for aromaticity model documentation

* add examples to testGithub1622 for aromatic and nonaromatic compounds

* updates to aromaticity model and docs based on additional information from @bannanc

* some additional examples from @bannanc

* add rule to allow exocyclic multiple bonds to disqualify an atom.

* minor doc update

* address some review comments
2017-12-21 08:39:49 -05:00
Greg Landrum
b1e255f470 Fixes #1668 (#1669)
* Fixes #1668

* add test for the additional Bi valence
2017-12-21 05:45:24 +01:00
Greg Landrum
1efa8e696e another clang-format run 2017-10-12 06:42:15 +02:00
Greg Landrum
8d31f56c29 Merge branch 'master' into modern_cxx 2017-10-07 06:46:28 +02:00
Greg Landrum
d29844a614 Fixes #1605 (#1606) 2017-10-06 11:07:10 -04:00
Greg Landrum
87786c08b5 Merge branch 'master' into modern_cxx
# Conflicts:
#	.travis.yml
#	Code/GraphMol/FileParsers/MolFileParser.cpp
#	Code/GraphMol/FileParsers/MolFileStereochem.cpp
#	Code/GraphMol/ForceFieldHelpers/UFF/testUFFHelpers.cpp
#	Code/GraphMol/MolAlign/testMolAlign.cpp
#	Code/GraphMol/MolDraw2D/MolDraw2D.cpp
#	Code/GraphMol/MolDraw2D/Wrap/rdMolDraw2D.cpp
#	Code/GraphMol/QueryOps.cpp
#	Code/GraphMol/ROMol.cpp
#	Code/GraphMol/SmilesParse/test.cpp
#	Code/GraphMol/Trajectory/Trajectory.cpp
#	Code/GraphMol/Wrap/Atom.cpp
#	Code/GraphMol/Wrap/Bond.cpp
#	Code/GraphMol/new_canon.cpp
#	Code/RDGeneral/testDict.cpp
#	Code/SimDivPickers/Wrap/MaxMinPicker.cpp
2017-10-05 05:58:38 +02:00
Greg Landrum
db89172bf8 handle the heavy-atom degree queries differently (#1560)
* handle the heavy-atom degree queries differently

* Fixes #1563

* add a test for the heavy atom degree option

* Support (and test) adjustHeavyDegree in the cartridge too.

* test results
2017-09-12 16:10:15 -04:00
Greg Landrum
83691e4f16 Fixes #1281 in a way (#1553)
This actually just causes the molecule processing to fail in a reasonable amount of time; it is not an actual fix to the underlying ring-finding problem
2017-09-08 12:10:07 -04:00
Greg Landrum
67bc7a647c merge on master; modernization needs to be repeated 2017-09-05 17:09:50 +02:00
Greg Landrum
960c539995 Fixes #1439 (#1530) 2017-08-23 17:24:47 -04:00
Brian Kelley
6a76fc9381 Dev/add update props api (#1479)
* Adds RDProps updateProps API point

* AdjustQuery now copies over original atom data to the query ato

* Preserves existing data on the replacing atom

* Exposes preserveProps to Python replaceAtom/Bond
2017-07-10 04:38:59 +02:00
Brian Kelley
b76af93513 Dev/add update props api (#1479)
* Adds RDProps updateProps API point

* AdjustQuery now copies over original atom data to the query ato

* Preserves existing data on the replacing atom

* Exposes preserveProps to Python replaceAtom/Bond
2017-07-10 04:36:12 +02:00
Greg Landrum
8191fd63fb Fix for #1478 (#1486)
* Fixes #1478

* minor optimization
2017-07-02 11:31:14 +02:00
Greg Landrum
db690e5695 Fix for #1478 (#1486)
* Fixes #1478

* minor optimization
2017-07-01 09:03:26 -04: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
e625c58bab Add cis/trans tags to double bonds (#1316)
* add cis and trans to bond stereo

* compiles, does not work

* tests all pass

* Whitespace cleanup to recent changes.

* C++ test case for Bond::setStereo using Bond::STEREOCIS and Bond::STEREOTRANS

* Adding a PRECONDITION to Bond::setStereo to make sure the stereo atoms
are already specified if CIS or TRANS is being specified.

E/Z is technically defined by the topology of the molecule so the
stereo atoms are redundant (easier to understand and use!), but
ultimately redundant with the graph. However, CIS and TRANS is _only_
defined in this usage as the orientation of the atoms in the
getStereoAtoms vector.

* Exposing Bond::setStereo to Python and adding test cases to make sure
it can be used to set CIS/TRANS stereochemistry.

* verify substructure matching works

* Adding Bond::setStereoAtoms to C++ Bond class.

This allows setting the atoms to be considered for CIS or TRANS
directly without a much more costly determination of ranking that E/Z
requires.

* Wrap Bond::SetStereoAtoms into python with a new type of test case.

* docs
2017-02-26 08:15:44 -05:00
Greg Landrum
6509e52611 Fixes #1230 (#1231)
* Fixes #1230

* add a test for cleanIt = False
2016-12-23 13:02:15 -05:00
Greg Landrum
97916ef894 Fixes #1204 (#1212) 2016-12-19 12:50:28 -05: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
9dcef9ac57 Fixes #607 (#1075) 2016-09-23 04:57:07 +02:00
Greg Landrum
91674e6482 Fixes issue #1021 (#1026)
* Fixes #1021, kind of.
The test for the bug passes, but there are other failures

* all tests except hanoi pass

* passes all tests

* remove some vestigial code

* remove debug-droppings

* minor documentation
2016-08-30 18:59:10 +02:00
Greg Landrum
7fd991e13d Fixes #962 (#1003) 2016-08-05 07:57:20 -04:00
Greg Landrum
339fa081e5 Merge fix/github908 branch 2016-07-27 04:49:55 +02:00
Greg Landrum
435a34df4f Expose the aromatizeIfPossible parameter to python (#991)
- Add tests for that
- Improve the C++ tests for aromatizeIfPossible
2016-07-26 13:17:41 -04:00
Brian Kelley
659ac6cb27 Adds aromatization and reaction options to AdjustQuery (#965)
* Adds aromatization and reaction options to AdjustQuery

 aromatizeIfPossible - checks kekulized queries for
    aromatic compatibility
 adds IGNORE_MAPPED and IGNORE_ATTACHEDRGROUPS options
  to adjustDegree

* Missed return false.

* Removes IGNOREATTACHEDRGROUPS
2016-06-29 05:09:30 +02:00
Greg Landrum
d63f44cc0c Add cartridge support for adjustQueryProperties() (#949)
* backup commit

* Change the names and meanings of MolOps::AdjustQueryWhichFlags
What was there before was not flexible enough and was extremely confusing. This should clear that up.

NOTE: this does break backwards compatibility with code that uses this enum, but given that this is new and has not been
widely promoted, I suspect it should not affect that many people. The default behavior of MolOps::adjustQueryProperties()
remains the same.

* adjust to the new AdjustQueryWhichFlags

* add mol_adjust_query_properties tests to the cartridge
2016-06-21 14:38:32 -04:00
Greg Landrum
ca1d3015ef update a test 2016-06-21 06:25:08 +02:00
Greg Landrum
452ed7156f Add support for a simplified aromaticity model. (#942)
* first pass

* Fixes #623

* fix a merge problem

* move the aromaticity perception to a helper fn

* python doc update

* replace setSimpleAromaticity() with a parameter to setAromaticity()

* add simple test for the custom aromaticity function
2016-06-17 17:48:20 -04:00
Brian Kelley
45ab3505dc AddTee is now SetTee (#930) 2016-06-01 04:46:27 +02:00
Greg Landrum
e846a96123 Fix github #868 (#925)
* fix an incorrect status message

* Fixes #868

Switch the warning to only occur if we have a non-negated atomic number query with value=1
2016-05-31 13:23:21 -04:00
Greg Landrum
1c56b07f66 cleanups of RDLog's tee behavior (#926)
- rename RDLog::AddTee()->RDLog::SetTee()
- remove a leak when RDLog::SetTee() (formerly AddTee()) is called twice
- add RDLog::ClearTee() method to allow RDLog::SetTee() to be safely used with a stream that goes out of scope.
2016-05-30 10:04:59 -04:00
Greg Landrum
06818ee0ed improve error reporting for kekulization failures (#919)
* improve error reporting for kekulization failures
Connected to #917

* better phrasing of the message.
2016-05-23 16:10:08 -04:00
Greg Landrum
f762346ced make the perchlorate cleanup pattern more generic to cover all halogenates;
Fixes #115
2016-04-01 07:54:32 +02:00
Greg Landrum
6a4a032e92 Fixes #518 2016-03-21 16:57:12 +01:00
Greg Landrum
d7d95dd684 an alternate approach to fixing #805 2016-03-13 04:21:36 -07:00
Greg Landrum
ed7b7b8a37 Fixes #805 2016-03-09 08:47:29 +01:00
Greg Landrum
027d231e38 add a test (still fails) 2016-03-09 07:27:11 +01:00
Greg Landrum
da46a3d80f Merge remote-tracking branch 'origin/master' into fix/Issue694 2016-02-20 02:35:29 +01:00
Greg Landrum
250a8abbd4 removed a diff-dropping 2016-02-17 05:57:08 +01:00
Greg Landrum
38f8a92d2b Fixes #754 2016-02-17 05:15:53 +01:00
Greg Landrum
b0b9ed632f add first test (it fails) 2016-02-17 05:15:30 +01:00
Greg Landrum
0ee4ce4b8c add a test 2016-02-16 14:02:33 +01:00
bp-kelley
84b4122f6b Merge pull request #759 from greglandrum/dev/github758
Add argument to addHs allowing only certain Hs to be considered
2016-02-12 17:24:08 -05:00
Greg Landrum
4f2aa0f51e Fixes #758 2016-02-08 16:11:22 +01:00
Juuso Lehtivarjo
2ad2b03c4a Bug fix to getShortestPath 2016-02-08 11:27:08 +02:00
Greg Landrum
70c2995cf8 Fixes #717
This changes the CIPCode and CIPRank atom properties to no longer be computed properties.
Note: under linux I was unable to actually get the bug to manifest (converting the uint property to an int didn't cause problems), but that doesn't mean it shouldn't still be fixed.
2016-01-06 03:45:14 +01:00
Greg Landrum
23d7df99f0 Fixes #678 2015-12-17 04:11:21 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
e37296d7c7 post review 2015-11-14 08:08:14 +01:00