198 Commits

Author SHA1 Message Date
David Cosgrove
20be664b57 Remove spurious full stops from warnings. (#6124) 2023-02-24 05:07:09 +01:00
Paolo Tosco
177c09cd6b Expose additional functionality to SWIG wrappers (#5614)
* - setenv() should be defined also for MinGW builds, not just MSVC
- fixed getBestRMS signature (ROMol& should be const)
- expose normalizeDepiction(), straightenDepiction(), getBestRMS(), CalcRMS() and getBestAlignmentTransform() to SWIG wrappers
- expose MolFromSmiles() overload taking SmilesParserParams parameter to SWIG wrappers
- expose DoubleVector class to SWIG wrappers as it is needed by alignment functions
- replace std::string with const std::string& in several SWIG wrapper signatures
- build RDKit2DotNet.dll as a 64-bit library on MinGW 64-bit
- add Java tests for the newly exposed SWIG functions
- fixed inconsistent indentation in Chemv2Tests.java

* changes in response to review

* fix typo

* reverted file committed by mistake

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-10-04 05:04:28 +02:00
Greg Landrum
42eed2605d Add CXSMILES support for bond wedging and wiggly bonds (#5575)
* initial support for wiggly and wedged bonds in cxsmiles
add CX_ALL_BUT_COORDS convenience option to CXSMILES writer

* move ClearSingleBondDirFlags to MolOps

* do a better job of handling the wiggly bonds

* mark 3D conformers from CXSMILES

* remove some extraneous printing

* test wD as well

* remove non-applicable test

* basic tests (not passing) for parsing t/c/ctu

* remove test for unimplemented feature

* changes in response to review

* changes in response to review

check for attempt to set the wedging more than once
testing for invalid w blocks
fix a bad comment
2022-09-24 05:44:01 +02:00
Greg Landrum
c060e5de98 New version of AssignStereochemistry (#5442)
* bring over some new functionality

* adjust your expectations

* more tests

* additional cleanup and testing

* implement fix from #5407

* more testing

* a bit of optimization

* add the new func to the python wrappers

* cleanup

* findPossible working in the new code
NOTE: the combination of findPossible and cleanIt does not work and needs to be disallowed

* do some cleanup

* better handling of UNKNOWN (not unspecified) atoms and bonds

* update

* backup... we're close

* catch_chirality tests all pass

* all tests pass

* cleanup

* docs and a bit of optimization

* "optimization" which makes things slower... maybe revert this

* we don't need cleanExistingStereo() anymore... get rid of it

* cleanup

* changes in response to review
2022-09-06 12:53:02 +02:00
Greg Landrum
550411c493 Fixes #5433 (#5459)
* Fixes #5433
Also a minor bit of refactoring

* update in response to review
2022-07-27 08:05:26 +02:00
David Cosgrove
f9b47d907f Add ACS1996 drawing style (#5425)
* Started on ACS 1996 drawing mode.
Significant change (not by itself, sadly) is that MolDrawOptions::lineWidth has changed from int to double to allow for ACS requirement of 0.6px bond widths.

* Wavy lines and dashed wedges.

* Better dashed wedges.

* Rounder wavy bonds, same as SVG.

* Added FreeSans font for ACS1996 mode.

* Add help functions to write enum classes to ostream.

* Dashed wedge separation now 2.5px between line edges rather than line middles.  Therefore wider gap between lines.

* Increase offset for wavy bond.  Get classes for atoms and bonds in wavy bond correct.

* For SMILES input, option to force wavy and crossed bonds for unspecified stereochem.

* Tidy debugging.

* Extra space round atom labels.

* Extra space between chars in freetype string.

* Reformats.

* Change double bond offset.

* Improve ring double bonds.

* Simple non-ring double bonds all working.

* Tidy.

* All double bonds seem good.

* Remove redundant function.
Move calcTripleBondLines into DrawMol for consistency with calcDoubleBondLines.
Use doubleBondOffset for wavy lines.

* Correct spacing between FT chars.

* Tidying.

* Use MolBlock wedging if there is any.  Needs to be made an option.

* If dashed wedge thick end has bonds of it, stop one dash short.

* Adjust solid wedge ends to line with attached bonds.

* Width of wedge ends now based on double bond separation.

* Change catch_tests.cpp

* Rounder waves in wavy lines.

* Dashed wedges same width even if one dash less..

* Embedded Roboto-Regular font in code.

* Fix docstrings.

* doubleBondTerminal swapped ends.
Deal with O2 - 2 terminal atoms of degree 1.

* Fix terminal double bonds.

* Slightly fatter truncated wedge bonds.

* Fix crash on complicated double bonds.

* Control more assert tests with DO_TEST_ASSERT.

* Fix 2 colour solid wedges.
Fix slanted wedge for morphine (test1_5).

* Change definittion of multipleBondOffset to fraction of mean bond length.

* Don't slant end of solid wedge to atom symbol.

* Fix wiggle separation.

* Fix 2-colour terminal double bonds.

* Fix colours on triple bonds.

* Don't attempt to draw non-existent points in triangle..

* Symmetric bond for P=O and like.

* Fix query bonds.

* Reformatting.

* Tidy up use of font.

* Add FreeSans font and license to $RDBASE/Data/Fonts.

* Draw unspecified stereo as unknown.

* Add check_file_hash.

* Tidying.

* Tidying.

* Start Python wrappers.

* Fix solid wedges for 3-connected atoms.

* Docstrings.

* Tidying.

* Alter width of bond highlights in ACS 1996 mode.

* Expose setACS1996Options and mean BondLength in Python.

* Expose drawMolACS1996Cairo in Python.
Docstrings.

* Extra padding between legend and picture in flexicanvas.

* Python tests.

* Tidy catch tests.

* Tidying.

* Fix catch tests.

* Fix no Freetype tests.

* Draw solid wedge more sensibly..

* Fix bond end at solid wedge.

* Tidy.

* Fix Python Cairo build issues.

* Fix wedge end shape for terminal double bonds.

* Hide the joins at the bond ends.

* Fix gcc pickiness.

* Extra test for no atom labels.

* Change where it looks for FreeSans.ttf for ACS1996 drawings.

* Same number of waves for wavy bonds in SVG and Cairo.

* Same number of waves for wavy bonds in SVG and Cairo.

* rename unspecifiedStereoIsUnknown to markUnspecifiedStereoAsUnknown and move to MolFileStereochem.h

* refactor use of iterators

* py docs update

* undo a bunch of bad formatting changes

* remove FreeSans

* get windows builds working

* Fix problem with Windows build.

* Changes in response to review.

* Align description of unspecifiedStereoIsUnknown in C++ to match Python.

* Still working on file open modes.

* Took out extraneous functions for drawing in ACS1996 mode, including the one that was breaking the windows build.

* Add RDKIT_MOLDRAW2D_EXPORT.

* Fix expected test results.

* Clarified warning.

* RDKIT_MOLDRAW2D_EXPORT missing.

* Windows!

* Update Code/GraphMol/MolDraw2D/rxn_test1.cpp

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2022-07-21 18:11:33 +02:00
Greg Landrum
fbaa6fd36c Fixes #5307 (#5310)
* Fixes #5307

* python doc string
2022-06-09 06:11:17 +02:00
Greg Landrum
d640eb98c9 [WIP] Fixes #5327 and #5328 (#5330)
* Fixes #5328
Fixes #5327

probably a good idea to add a bit more testing here

* more tests!
2022-06-01 04:45:14 +02:00
Greg Landrum
d2a05ecef2 Add a global feature flag to enable the "new" stereo perception code (#5309)
* add a global feature flag to control use of the new chirality code

* expose that flag to minimallib

* add getters for allowNontetrahedralChilrality and useLegacyStereoPerception

* switch to using environment variables to store the values

* document that
correct the documentation about nontetrahedral stereo

* yay visual c++

* in response to review
2022-05-27 16:52:59 +02:00
Greg Landrum
cd74dc2207 Initial support for non-tetrahedral stereochemistry (#5084)
* very basics: actually parsing the new atom stereochem features

* add some input verification for the chiral permutations

* fix a typo
add quadruple bond SMILES/SMARTS extension

* add forgotten files

* patch from Roger

* add Roger's parsing examples

* typo

* new tests

* adjusted version of next PR from Roger:
- add SP2D hybridization for square planar (this may change)
- some modernizationof Chirality.cpp
- stop using < HybridizationType in Chirality.cpp (should probably do this elsewhere too)
- improved handling of hybridization assignment for new stereochem
- handle new stereo/hybridization in UFF
- tests for the above

* perception of non-tetrahedral stereo from 3D (from Roger S)
Basic testing of SP and TB based on opensmiles docs

* potential fixes for octahedral assignment
more tests

* docs update
need way more!

* map the TH tags directly to @ tags

* very basics of SMILES writing
this does not work with anything that changes the permutation order
like canonicalization or writing things in rings.

* start to support the getChiralAcross API

* more testing

* consistency

* add hasNonTetrahedralStereo() and getIdealAngleBetweenLigands()

* assignStereochemistry should only remove non-tetrahedral stereo

* re-simplify those tests

* cleanup matrix stream output

* initial pass at supporting nontet stereo in distgeom

* backup

* start on the reference docs

* TBP reference

* first pass at Oh finished

* update SP section

* more doc updates

* fix a typo

* add param to not remove Hs connected to non-tetrahedral atoms

* VERY basic coord generation for square planar

* TBP basics

* basic OH depiction

* start testing missing ligands
allow non-tet stereo in rings (ugly, but correct)

* add new TBP functions from Roger

* update depiction code for new API

* backup, the new tests work so far

* Finish the TB tests

* OH tests pass too

* cleanup

* first pass at getting correct SMILES with reordering
need way more testing than this

* ensure permutation 0 is correctly preserved

* some progress towards adding non-tetrahedral stereo to StereoInfo

* doc update

* add non-tet chiral classes to python wrappers

* make sure removeAllHs also gets neighbors of non-tetrahedral centers
more testing

* a bit of depictor cleanup

* make the assignment from 3D more tolerant
more testing

* improve the bulk testing

* cleanup

* remove a bit of redundant code

* ensure we don't write bogus permutation values to SMILES

* fix some rebase problems

* allow assignStereochemistryFrom3D() to be called without sanitization

* allow disabling the non-tetrahedral stereo when it's not explicit

* get that working on windows too
2022-05-20 09:07:16 +02:00
Greg Landrum
ca5d470b48 Fixes #5239 (#5247) 2022-04-29 18:05:43 +02:00
Greg Landrum
7e7fdb0f29 Fixes #5196 (#5201)
* Fixes #5196

This fixes the bug as reported, but there's more work to do in order to get the other cases

* cleanup

* fix assignStereochemistry()

* Fixes #5200

* move those functions to the public API

* fix assignStereochemistry

* cleanup

* refactoring in response to review
2022-04-15 05:13:45 +02:00
Greg Landrum
939d8c3c02 Move to C++17 (#5155)
* bump to c++17

* remove binary_function

* update our boost::hash implementation too
2022-04-12 13:53:07 +02:00
Greg Landrum
d614cf1528 Fixes #5108 (#5113) 2022-03-23 06:09:55 +01:00
Eisuke Kawashima
ba6d8e0d3b clang-tidy: readability-simplify-boolean-expr (#4639) 2022-03-17 13:50:50 +01:00
Eisuke Kawashima
27f711a658 Run clang-tidy (readability-braces-around-statements) (#4977)
https://github.com/rdkit/rdkit/pull/3024#discussion_r526549843
2022-03-10 08:00:10 +01:00
Greg Landrum
7e575db3c4 AssignStereochemistry should remove nonchiral atoms from StereoGroups (#4986)
* Nonchiral atoms should be removed from StereoGroups

This fixes a bug where atoms which have no chirality were left in StereoGroups

In order to make this work, ROMol::setStereoGroups() needed to be made public.
That shouldn't be a problem since it doesn't change connectivity.

* fix some broken old tests

* update cartridge tests
2022-02-08 05:17:34 +01:00
Alex Rebert
e2b0a850d7 Fix memory safety issues found by OSS-Fuzz (#4983)
* RWMol: replace atom in stereo groups

Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36998, a
use-after-free in initFromOther.

* Fix out-of-bounds write in iterateCIPRanks

If the rank has not changed in the current iteration, the cipEntries
vectors might not have increased in size. Accessing `numIts + 1`
resulted in an out-of-bounds write. This commit skip the cipEntries
update when the rank is unchanged.

Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28660

* Fix use of uninitialized values in MolSGroupParsing

`stream >> count` may silently fail without an exception. In that case,
`count` was uninitialized but used. This commit initalizes `count` to 0,
as well as other variables that may be read without being initialized.

Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25220
Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25225

* Fix vector size cast in streamReadVec

In 32-bit systems, the implicit conversions from 64-bit to a 32-bit
size_t could lead to an underallocation of the vector. This would follow
by a out-of-bounds write while trying to populate the vector. Now, the
code throws an exception in case of a cast that would change the size.

Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28034

* RWMol: improve atom replacement in stereo groups

This code is cleaner and more efficient.

* Add test for replaceAtom and stereo groups
2022-02-06 05:06:38 +01:00
Greg Landrum
7f73da78a2 Fixes #4809: double bond stereo can now be set after calling replaceCore() (#4827)
* add test

* backup commit

* Fixes #4809

* cleanup

* don't make that change in large rings

* docs
2021-12-29 09:03:09 +01:00
Greg Landrum
85608555fe add ROMol::atomNeighbors() and ROMol::atomBonds() (#4573)
* add ROMol::atomBonds() and ROMol::atomNeighbors() methods

* remove some warnings

* start using the new code

* add default for those template params

* some more applications

* get the SWIG builds working

* get rid of extraneous ref

* remove extraneous comments
2021-10-02 07:28:24 +02:00
Ric
f0feb1198e Fixes #4494 (#4495)
* add fix

* add test

* Update Code/GraphMol/Chirality.cpp

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-09-13 04:39:55 +02:00
Greg Landrum
69b143edd0 Swap from RDUNUSED_PARAM to unnamed parameters (#4433)
* cleanup

* more cleanup
2021-08-24 17:19:46 -04:00
Greg Landrum
c99da95be0 lambda cleanup (#4432) 2021-08-24 10:29:31 -04:00
Matt Swain
1d3c634691 Fix EnumerateStereoisomers for EITHERDOUBLE cis/trans bonds (#4272)
* Fix logic in findPotentialStereoBonds

* Strip EITHERDOUBLE bonds in EnumerateStereoisomers

* Add test for EITHERDOUBLE EnumerateStereoisomers
2021-06-23 08:20:58 +02:00
Greg Landrum
97eb59003d double bonds now have EITHER stereo if no coordinates are present (#4239)
speedup for Point3D::angleTo
patch from Roger Sayle
2021-06-15 04:25:24 +02:00
Greg Landrum
02c269f036 Fixes #4115 (#4117) 2021-05-07 10:21:48 -04:00
Greg Landrum
487b1c9d51 Fix definition of bridgehead stereo (#3968)
* support ring stereo from Ns

* modify the definition of bridgehead from #3958

* changes in response to review
2021-03-24 14:45:35 +01:00
Greg Landrum
4d747d5945 Allow three-coordinate bridgehead N to be chiral. (#3958)
This is a followup from #3632
2021-03-22 19:27:55 +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
b81e313c51 Fix #3631 (#3632)
* Fixes #3631

Still worth investigating *why* this happened.

* a bit of simplification/refactoring
2020-12-12 05:50:29 +01:00
Jin Pan
ab6b164924 Speed up GraphMol/Chirality.cpp/iterateCIPRanks (#3482)
* Speed up GraphMol/Chirality.cpp/iterateCIPRanks

The changes in this patch increases throughput of `iterateCIPRanks` by
about 61.8%.  This patch consists of many changes that all combine to
contribute to the performance gains, and these are the major changes:

* Introduce Bond.getTwiceBondType to avoid floating point operations in
`floor(2*bond->getBondTypeAsDouble() + .1)`
* In RDGeneral/Ranking.h/rankVect, just store the last index (instead of
the last vector) and avoid creating a copy at the current index.
* In GraphMol/Chirality.cpp/iterateCIPRanks, reserve more capacity ahead
of time.
* In GraphMol/Chirality.cpp/iterateCIPRanks, avoid materializing
localEntry and then copying; instead, track the data to be added in a
`counts` vector and a `updatedNbrIdxs` vector.

In GraphMol/Chirality.cpp/iterateCIPRanks, we also make several
micro-optimizations that were individually measured to give a small
performance improvement.

* Chirality.cpp/iterateCIPRanks: avoid materializing allIndices vec

* misc cleanup
2020-12-10 05:36:51 +01:00
Greg Landrum
19bdd21de1 Updated code for chirality perception (#3324)
* add new test (it fails, of course)

* isAtomPotentialTetrahedralCenter() there and tested
tests cases for molecular stereo written (but failing, of course)
create new_chirality.cpp, we will probably want to change this at some point
new StereoInfo structure

* more infrastructure
- isBondPotentialStereoBond()
- two getStereoInfo() functions
- associated unit tests

* backup

* oops

* backup

* switch to always using four atoms for bonds

* backup

* add new test (it fails, of course)

* isAtomPotentialTetrahedralCenter() there and tested
tests cases for molecular stereo written (but failing, of course)
create new_chirality.cpp, we will probably want to change this at some point
new StereoInfo structure

* more infrastructure
- isBondPotentialStereoBond()
- two getStereoInfo() functions
- associated unit tests

* backup

* oops

* backup

* switch to always using four atoms for bonds

* backup

* this now actually works

* doc update

* add a test to demo that ring stereo is not working

* more testing

* add a fun CIP test

* add review note

* debugging

* remove extraneous debugging
turn off tests for ring-double bond stereo

* disable the ring-stereo fix... this breaks a few tests, but we will recover

* works, needs cleanup, chirality code needs re-testing

* nothing works

* Fixes #3322

* Python and C++ tests now pass

* clang-format

* first pass at python wrappers

* improve doctest

* basic optimization...
stop with the copying

* rename

* all tests passing again

* optimization

* fix the sort in the tests

* looks like this might fix the windows-dll build problems

* update tests

* the fun never ends

* comment cleanup

* handle deliberately unspecified atoms/bonds

* add cleanIt option

* add flagPossible

* add option to use the new code to the SMILES parser

* additional testing

* additional testing

* a bit of additional testing never hurts

* changes in response to review

* fixes a bug with potential parastereo not being cleared

other changes in response to review

* update docs
2020-09-02 15:00:29 +02:00
Greg Landrum
1dd2d75615 Fixes #3314 (#3318)
Cleans up and simplifies (a bit) the code for perceiving chirality
based on a conformer and wedged bonds.
2020-08-10 13:12:01 -04:00
Ric
d54e77e375 Add new CIP labelling algorithm (#3234)
* add port of centres

* Several changes:
    - Added a test based on RDKit issue 2984
        (default RDKit fails it, this gets it right)
    - Use bond directions for bond stereo (label is no longer required)
    - Fix bugs in rules 4b and 5new
    - Fix some mem errors
    - clang-formatted
    - some other minor cleanups

* Several changes and some improvements:
    - Added LGPL license, as well as a mention in the doc.
    - Fix/update/add some comments
    - Fix typo/bug in Mancude calculation
    - Fix bug in rules 4b, 5New
    - Fix Sp2 Bond dir reference
    - Re clang-format
    - other minor changes suggested by Dan

* Another bunch of changes:
  - require integer-order bonds; kekulize when required
  - fix fraction comparison
  - rename sq Cis/Trans e/z
  - replace queues with vectors
  - update copyright notices
  - revert LGPL changes
  - fix Asymmetric typo

* move to separate lib/mod, add python validation test

* Moving away from the original implementation:
    - Rename to CIPLabeler
    - Remove the abstraction layer
    - Remove some stats stuff
    - Push some CIPMol functions down to Node
    - Use RDKit's isotope info

* Another bundle of changes. The most relevant ones:
    - fix parity translation
    - use cis trans as bond reference -- breaks #2984 test
    - kill a lot of unused code
    - use lists for queues
    - store nodes and edges in digraph
    - add prefixes to class data member names
    - update changeRoot() test
    - use fastFindRings() for mancude rings
    - update docs
    - add references to the scientific paper
    - Document the Mancude functions
    - Fix Mancude atom types and their comments
    - remove mol data member from SequenceRule
    - replace Fraction with boost::rational
    - update comments, docstrings and the doc

* fix building the test

* Changes here include:
    - adding bitset overload for the labeling function
    - python wrap of the overload
    - handling trigonal pyramids with implicit H
    - setting bond labels sets stereo atoms, cis/trans
    - nix LEFT/RIGHT/TOGETHER/OPPOSITE constants
    - don't use GLOB in cmake
    - a decent amount of refactoring

* Minor edits to new_CIP_labeling (#6)

* Some changes for clarity

Added some documentation and changed some variable names to match
my understanding. Also a ran clang-tidy to ensure that all blocks
were brace-enclosed.

* Return a reference instead of a copy for performance

This is called many times and showed up after some light
profiling. This change bumped throughput by about 20%

* move out of Graphmol

* move .hpp headers to .h

* update documentation; add label set of atoms test

* Address comments:
    - Added references to centres to CIPLabeler.h and Python Wrap.
    - Update validation test to skip sanitization.
    - Document mancude fractional atomic number calculation.
    - Use unittest assertions in python test.
    - Update mancude docstrings to 'resonance' instad of 'tautomers'.
    - Rename prioritise() to prioritize().
    - Add postcondition to check carriers size in Tetrahedral.cpp.
    - Use getNeighbors() in Tetrahedral.cpp.
    - Move findStereoAtoms to Chirality namespace.
    - Move code back into GraphMol.
    - Fix typos and reformat doc.

* More comments:
    - Mention why we use boost's unordered map rather than the std one.
    - Fix include in Python wrapper.

* Addressed second batch of comments:
    - fix the bug in rule 4b
    - fix docstring for rule 2
    - move atomic mass calculation from rule 2 to node
    - addressed some build warnings
    - simplify sp2bond::label(comp)
    - add start/end atoms to Sp2Bond constructor
    - update system/local includes

Co-authored-by: Dan N <dan.nealschneider@schrodinger.com>
2020-07-07 20:34:33 +02: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
Ric
8dd2ce446c Address issue #2890 (#3015)
* add fix

* add tests
2020-03-21 14:01:54 +01:00
wvandertoorn
005688c157 phosphine&arsine chirality support isAtomPotentialChiralCenter() (#3018)
- Add tests for phosphine and arsine chirality
- Add support to isAtomPotentialChiralCenter()
  Accept both 2 (implicit H), 3 and 4 coordinate P and As atoms as potential
chiral centers
2020-03-21 04:59:16 +01: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
Eisuke Kawashima
5cd27a242f Fix typo (#2862)
* Fix typo

* Reflect the comments

* Fix more typos
2019-12-31 06:43:27 +01:00
Paolo Tosco
7d24ed6014 Resolves #2823 (#2863)
* Resolves #2823

* - changes in response to review

* Update Code/GraphMol/Chirality.cpp

Co-Authored-By: Greg Landrum <greg.landrum@gmail.com>

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2019-12-29 06:25:52 +01:00
Greg Landrum
c988dc4c68 Cleanup some unintended consequences of #2553 (#2735)
* backup

* output bond stereoAtoms in debugMol()

* stop removing STEREOCIS/STEREOTRANS markers in setDoubleBondNeighborDirections()

* Re-establish bond dirs in reaction products.

* test all that
(the first set of tests, should do more)

* cleanups

* add SetDoubleBondNeighborDirections() to python API and test it

* add more tests

* changes in response to review

* add another c++ test, fix the java tests
2019-10-25 04:31:06 +02:00
Ric
d0de1298bf Fix set stereo bond labels to SMARTS mol (#2704)
* fix

* add test

* change variable names

* expose setBondStereoFromDirections() to Python

* additional testing
2019-10-14 15:57:46 +02:00
Greg Landrum
cd7771858f Fixes #2695 (#2696) 2019-10-12 17:30:51 -04:00
Greg Landrum
fc374a9622 Fixes: Atoms in non-standard valences not being properly written to mol blocks (#2646)
* Fixes a molblock writing problem
with undervalent atoms from the organic subset

* Fixes #2649

Also ensures that allenes are not written as crossed bonds
(which does not make sense at the moment anyway)

* clang-format run
2019-09-20 09:13:19 -04:00
Ric
574caeba57 Assign stereo bond labels in molecules read from SMARTS (#2623)
* move utility functions to RDKit::Chirality

* assign bond stereo labels from directions

* add a test

* some cleaning up
2019-08-23 14:07:46 -07:00
Ric
df522d02aa E/Z and CIS/TRANS stereo bonds are incorrectly matched (#2596)
* add E/Z to CIS/TRANS translator

* use translator in matching

* add a test
2019-08-21 16:35:35 +02:00
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
494faf119a Fixes #2422 2019-04-26 16:43:35 +02:00
Dan N
f730d38ceb Removes an extra debugging cerr statment (#2360)
This will show up in every 2D SD file read... Whoops!
2019-03-22 15:50:04 +01:00
Dan N
10c3488441 #2329 wrap detect atom stereochemistry (#2351)
* Move DetectAtomStereoChemistry to Molops::assignChiralTypesFromBondDirs

DetectAtomStereoChemistry in MolFileStereochem is more broadly
useful. Additionally, it was not named very clearly for what
it was actually doing.

* Wraps assignChiralTypesFromBondDirs for use in Python

Makes assignChiralTypesFromBondDirs available in Python
and adds a test demonstrating that availability.
2019-03-19 10:54:28 +01:00