Commit Graph

55 Commits

Author SHA1 Message Date
Greg Landrum
d8c49e6dab Code cleanups from PVS/Studio (#2531)
* first round of cleanups based on PVS-studio suggestions

* a couple more

* a few more cleanups

* another round of cleanups

* undo one of those cleanups
we want the integer rounding behavior here

* add a comment to make that clear

* Fix for filter catalog PRECONDITION redundancy
2019-07-13 07:25:37 +02: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
b91daa8ab9 Allow dumping interchange information into SVG files (#2030)
* add atoms

* add bonds

* backup

* Fixes #2029

* Get metadata working for drawMolecules()

* add to python wrapper
const correctness

* also connected to #2029: make sure bond direction also ends up in the output

* initial version of an SVG->ROMol parser
this is in the wrong place, but I wanted to make sure it actually works

* move svg parser to a more reasonable location
there is still some work to be done here

* add conformer parsing
2018-09-17 06:49:43 +02: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
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
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
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
Brian Kelley
ddf7c73b50 Adds Atom atom map and rlabel apis (#1004)
* Adds Atom atom map and rlabel apis

* Moves RLabels to their own namespace, adds other properties.

* Removes namespaces, liberally adds Atom to function names.

* move detail::computedPropName to RDKit::detail::computedPropName
2016-08-11 04:46:41 +02:00
Brian Kelley
2debdfde0d Adds RDAny (smaller generic holder) Updates all used dictionaries (#896)
* Adds RDAny (smaller generic holder) Updates all used dictionaries

This is an API compliant version of the current rdany system,
but uses a lot less memory in practice.

* Removes code duplication

* Converts CHECK_INVARIANT to TEST_ASSERT

* Fixes DoubleTag issue

* Adds Bool to DoubleMagic implementation

* Removes reference to property pickler
2016-05-29 17:04:21 +01:00
Paolo Tosco
2b3a818f84 - removed the dependency on Trajectory from ROMol and ForceField 2016-05-11 19:37:09 +01:00
Paolo Tosco
a2eca41365 - the Trajectory object now holds a vector of Snapshots rather than
a vector of shared_ptr to Snapshots
- The PySnapshot class was removed
- the Trajectory::readAmber and Trajectory::readGromos member functions
  were converted into non-member functions
- tests were modified accordingly
2016-05-04 18:42:23 +01:00
Paolo Tosco
d16b312ee6 - Completely revised coordinate ownership
- Implemented Python wrappers
- prepared relevant test cases
2016-04-24 23:30:25 +01:00
Paolo Tosco
a5de000c5c - fixed int/unsigned int 2016-04-16 20:41:40 +01:00
Paolo Tosco
b35538599f - Added AMBER trajectory reader and relevant tests 2016-04-16 20:28:45 +01:00
Paolo Tosco
9d5e56fcd2 - added a test for testAddConformersFromTrajectory()
- added some documentation
2016-04-14 23:45:24 +01:00
Paolo Tosco
584b77ea18 - work in progress on the Trajectory branch 2016-04-14 20:04:58 +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
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
Greg Landrum
b78bb40ca5 Fixes #384 2015-03-30 07:20:24 +02:00
Brian Kelley
95a92282d1 Dictionary access is saniztized and optimized.
o rdkit gains a RDKit::common_properties namespace that contains common string value properties

 o Dict.h and below gain getPropIfPresent that attempts to retrieve a property and returns
  true/false on success or failure.  This is used to optimize access.

 o rdkit learns how to pass property keys by reference, not value.

A new namespace has been added to RDKit, common_properties
that contains the std::string values for commonly used
properties.  This helps to avoid typos in string values
but also avoids a creation of std::strings from character
values.  All accessors (has/get/clear and getPropIfPresent) now pass
the key by reference.

Additionally, getPropIfPresent removes the double lookup
of hasProp/getProp which can be a significant speedup
in the smiles and smarts parsers (10-20%)
2015-01-15 12:23:29 -05:00
Nadine Schneider
0bbf3ec79b Add function to test if UpdatePropertyCache is necessary 2014-12-19 13:59:42 +01:00
Greg Landrum
b5b6fac181 minor optimization 2014-02-08 04:32:02 +01:00
Greg Landrum
387406f657 ongoing optimization work 2014-02-05 04:22:59 +01:00
Greg Landrum
8076fefc17 add MatchingAtomIterator to C++ 2013-12-16 05:24:19 +01:00
Greg Landrum
9dca8636b7 Fixes #175 2013-12-07 08:26:58 +01:00
Greg Landrum
7a586e9391 further robustification of the computed properties 2013-12-07 07:24:22 +01:00
Greg Landrum
b5fe1f3f8c add return vals for getProps on ROMol, Atom, and Bond;
use a variable to store computed prop names
2013-07-20 06:07:19 -04:00
Greg Landrum
8d9fd053b2 fix and test issue 256;
this is a change that affects backwards compatibility.
2012-10-08 03:18:05 +00:00
Greg Landrum
a9e2447b28 another checkpoint; this seems to be working for the lipinksi and crippen descriptors 2012-02-25 05:38:09 +00:00
Greg Landrum
3b3d44db16 remove exe property from source files 2011-01-13 04:22:56 +00:00
Greg Landrum
4f0321acc7 cleanup 2010-12-29 07:10:10 +00:00
Greg Landrum
006c696067 an inital pass at a solution to adding support for stereochemistry of ring bonds (bug 3139534);
this needs a ton more testing, but it is worth getting a "working" version in
2010-12-28 10:38:14 +00:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
116c036c07 doc updates for writers to indicate that "-" writes to stdout;
rename computedProps property to __computedProps
2010-09-19 13:13:10 +00:00
Greg Landrum
214f1c5c20 primarily minor code cleanups. 2010-05-26 18:27:40 +00:00
Greg Landrum
e05580e495 This is a sizeable one: change the way BGL is used so that atoms and bonds are stored as bundled properties
instead of using the property map interface.
A nice side-effect is that the wart of having to use property maps to loop over bonds or atom neighbors
is now gone.
This potentially breaks lots of client C++ code.
2009-02-11 20:19:25 +00:00
Greg Landrum
8867db464f check that self bonds are not added 2008-07-16 04:00:54 +00:00
Greg Landrum
95b86eb371 "fix" issue1993296 2008-06-16 05:52:30 +00:00
Greg Landrum
9c7f33a5c8 merge changes from QuerySerialization_6March2008 branch, revs 555:563, into the trunk; 2008-03-12 06:11:39 +00:00
Greg Landrum
a788e29511 merge the changes from the CanonicalizerRework30Nov branch in.
The changes are revs 451:498.
2008-01-30 14:53:04 +00:00
Greg Landrum
6aeeca797d fix a small memory leak 2008-01-26 04:34:45 +00:00
Greg Landrum
430a83bd96 merge in the jamfiles from the bjam branch;
various and sundry minor code cleanups;
this probably does not yet build on windows... that is next
2007-11-23 15:55:30 +00:00
Greg Landrum
1b0ccef933 minor cleanups 2007-10-13 09:27:37 +00:00