Commit Graph

62 Commits

Author SHA1 Message Date
Greg Landrum
baf3dc87a0 Fixes #4127 (#4129)
Also adds fixes for some related problems I noticed while fixing this one.
2021-06-09 06:22:48 +02:00
Greg Landrum
6bbb677a74 Fixes #4122 (#4123) 2021-05-12 09:43:36 +02:00
Greg Landrum
c660758abc make sure atom and bond bookmarks survive replaceAtom/Bond (#4033)
* make sure atom and bond bookmarks survive replaceAtom/Bond

* fixes oss-fuzz #30572

* fix possible memory-access error in error reporting

* more defensive deserialization

* switch that recursive smarts error handling to not use an exception
2021-05-12 08:44:17 +02:00
Greg Landrum
e69ab627e9 fix a leak in RWMol (#3970) 2021-03-24 20:16:00 +01:00
Greg Landrum
2e3f31990d Allow batch editing of molecules: removal only (#3875)
* backup

* simple first pass, passes all tests

* cleanup a bunch of existing uses

* ensure that we can safely add atoms/bonds while in edit mode

* add context manager on python side

* handle exceptions properly in those

* changes in response to review
2021-03-11 05:10:43 +01:00
Ric
703fe5a225 Remove boost::foreach from public headers (#3820)
* remove include from headers

* update implementation files

* completely remove BOOST_FOREACH (#7)

* convert those changes to use auto

* get rid of all usage of BOOST_FOREACH

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-02-17 14:15:48 +01:00
Greg Landrum
45b9aef28b clang-tidy modernize-use-default-member-init and modernize-use-emplace (#3190)
* run clang-tidy with modernize-use-default-member-init

* results from modernize-use-emplace

* one uniform initialization per line
otherwise SWIG is unhappy

Co-authored-by: Brian Kelley <fustigator@gmail.com>
2020-05-28 09:07:58 +02:00
Greg Landrum
95613b6279 Allow SubstanceGroups to survive molecule edits (#3170)
* Progress on #3168

* Fixes #3167

* Fixes #3169

* deal with CBONDS too

* test PATOMS

* Fixes #3175

* a bit of code simplification and test updates

still needs more testing

* more testing

* handle s-group hierarchy
also a couple of other changes in response to the review

* add forgotten test file

* changes in response to review
2020-05-19 17:35:08 +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
Greg Landrum
5a79190261 rename SGroup -> SubstanceGroup (#2375)
We leave the names of the bit connected with Mol files as SGroups, since that is
appropriate there, but the more generic pieces are renamed
2019-03-30 14:53:24 -04:00
Ric
d26d4b076e Support for parsing/writing SGroups in SD Mol files. (#2138)
* Implementation of SGroups

* remove sample files test

* update gitignore with test outputs

* fix RevisionModifier

* re-enable tests

* backup commit; things seem to work so far

* some refactoring; obvious s group tests pass now

* more refactoring

* everything now out of the public API

* not sure why this was still in there

* rename functions; all tests now pass

* remove getNextFreeSGroupId; readd comment in copy SGroups

* clang-format

* squash-merge current master

* squash merge master

* Address comments on PR

- Update to current master.
- Move SGroup parse time checks to SGroupChecks namespace.
- Store SGroups in ROMOl as vector<SGroups>.
- SGroup methods return referenes instead of pointers.
- Use atom/bond/sgroup indexes for properties instead of pointers.
- Have SGroups inherit from RDProps; move properties to RDProps.
- Remove trivial/unused methods.
- Add a link to the SD specification atop SGroup.h
2019-01-22 15:42:27 +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
8a08c326e0 Fixes #1990 (#1992)
* Fixes #1990
makes sure we don't destroy a double bond's StereoAtoms just because a bond connected to one of its atoms is removed

* change in response to review
2018-08-13 09:03:21 -04: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
Greg Landrum
1efa8e696e another clang-format run 2017-10-12 06:42:15 +02: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
Brian Kelley
7488840ac4 Fix/urange check (#1506)
* Fixes atom documentation

* Fixes #1461

This is a complicated one.  Basically URANGE_CHECK when
used on unsigned integers has a problem when the size of
the range it’s checking is 0.  The standard operations is
to check

URANGE(num, size-1)

Which (for unsigned integers) obviously rolls over.

This fixes all usage cases to be

URANGE(num+1, size)

And fixes the bugs found.  (addBond and the mmff tests)

* Fixes #1461 - Updates URANGE_CHECK to be 0<=x<hi
2017-09-11 21:17:33 +02: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
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
59e6508d4f stop using getBondWithIdx() in removeBond() (#1363)
Fixes #1359
2017-03-12 10:07:17 -04:00
Brian Kelley
08be8d097e Removes exponetial numBonds behavior (#1154)
* Removes exponetial numBonds behavior

* Removes accidentally commited Get/SetName
2016-11-12 16:05:06 +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
Michał Nowotka
f70162a53b Bug when removing stereo info?
It's very possible, that I don't understand something (apologies) but shouldn't the second loop iterate over vertices adjacent to the second end of the bond being removed?
2016-06-20 16:40:33 +01:00
kelley
5dbec2fe85 Adds rdcasts where appropriate 2015-11-29 17:52:27 -05: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
Brian Kelley
fb84c9f0b7 Switches to URANGE_CHECK when appropriate 2015-10-18 21:14:02 -04:00
Brian Kelley
daa7e62258 Fixes signed conversion issues (use rdcast) 2015-10-18 15:16:38 -04:00
Brian Kelley
5f59333a56 Silences unused parameters 2015-10-18 14:02:29 -04:00
Greg Landrum
1a6fafdec3 Fixes #610 2015-09-09 18:39:56 +02:00
Greg Landrum
07c9c10e26 Fixes #608 2015-09-08 09:52:06 +02:00
Greg Landrum
b78bb40ca5 Fixes #384 2015-03-30 07:20:24 +02:00
Greg Landrum
f5cf3322fe code cleanup: removing compiler warnings 2014-05-08 06:06:07 +02:00
Greg Landrum
387406f657 ongoing optimization work 2014-02-05 04:22:59 +01:00
Greg Landrum
5ee22df4c4 small optimizations for smiles parser 2014-01-27 16:54:32 +01:00
Greg Landrum
9dca8636b7 Fixes #175 2013-12-07 08:26:58 +01:00
Greg Landrum
5ce10116c5 fix an ugly bit in RWMol::removeAtom 2013-07-15 17:14:37 +02:00
Greg Landrum
586e91ba96 Fixes #59 2013-07-04 05:53:16 +02:00
Greg Landrum
c53196e068 Fixes #42 2013-06-05 05:44:03 +02:00
Greg Landrum
0b45f3c320 fix GitHub issue 8
This breaks the InChI python unit tests, so those need to be cleaned up.
2013-03-01 06:54:33 +00:00
Greg Landrum
be669050a6 fix and test sf.net issue284 2013-01-31 04:03:04 +00:00
Greg Landrum
1b328e3789 fix and test for issue 264 2012-11-12 14:54:18 +00:00
Greg Landrum
cfaea83d7d optimizations for molecule construction 2012-08-27 04:52:27 +00:00
Greg Landrum
f5eb640766 fix and test Issue3549146 2012-07-26 14:34:35 +00:00
Greg Landrum
93f6445e01 minor cleanup to RWMol::insertMol; add combineMols to ChemTransforms 2012-07-10 04:00:46 +00:00
Greg Landrum
3b3d44db16 remove exe property from source files 2011-01-13 04:22:56 +00:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
214f1c5c20 primarily minor code cleanups. 2010-05-26 18:27:40 +00:00