Commit Graph

3630 Commits

Author SHA1 Message Date
Greg Landrum
99aa358fe0 make it easy to create DAT SGroups from Python (#5544) 2022-09-09 15:20:11 +02:00
Greg Landrum
522811b8d4 Fixes #5402 (#5542)
* support transforms with branches

* improve output when doing verbose canonicalization

* Fixes #5402
2022-09-09 05:06:42 +02:00
Greg Landrum
dc16efd429 fix windows dll ci builds (#5543)
* fix windows dll ci builds

* late breaking mac ci changes

* more flex, get the mac_java one too

* oops
2022-09-09 05:04:18 +02:00
David Cosgrove
383af8895c Fix trans double bonds in large rings. (#5493) 2022-09-06 15:54:56 +02:00
Paolo Tosco
22e99f5e6e MolDraw2D::drawMolecules() should not crash on null molecules (#5503)
* MolDraw2D::drawMolecules() should not crash on null molecules

* changes in response to review

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-09-06 14:42:47 +02:00
Rachel Walker
70753df28e Include element name in atomic data (#5524) 2022-09-06 14:35:29 +02:00
Ric
a19566c2c8 add info to debug (#5526) 2022-09-06 13:03:08 +02:00
David Cosgrove
d209cbd196 Improved bond highlights (#5484)
* First draft.
Polyline round bond joins is smaller.
Continuous highlight bonds mitre.

* Remove historical and now misleading comment.

* Mitre the continuous bond highlights.

* Better bond highlighting with not continuous highlighting.

* Updated hash codes.  Extra test.

* Updated hash codes.

* Script to update hash codes automatically.

* Fix test.

* Fix test.

* Remove debugging file write.

* Removed redundant code.

* More auto.

* Removed newly redundant function.

* More explanation and an extra example/test.

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-09-06 12:55:38 +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
Paolo Tosco
946b88f17c remove spurious doxygen tag (#5488)
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-08-29 17:36:33 +02:00
Brian Kelley
0e7871dc5e Fixes #5466 (#5468)
Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2022-08-03 15:44:41 +02:00
David Cosgrove
d32cf91c2c Fix bug in bond joins (#5482)
* Fix bug in smoothBondJoins caused by not clearing singleBondLines_ in resetEverything.
Updated test results.

* Changes as result of review.

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-08-03 13:16:49 +02:00
David Cosgrove
226ac9eab3 Draws a hydrogen atom light blue if not drawing labels. (#5454)
* Draws a hydrogen atom light blue if not drawing labels.

* Newline at end of file.

* Changes requested from review.

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-08-03 04:47:55 +02:00
Greg Landrum
edb542097b Fixes #5462 (#5463) 2022-08-03 04:46:17 +02:00
Brian Kelley
20673d4cb8 Fix integer overflow in RGroupDecomposition strategy GA (#5460)
* Fix integer overflow in numPermutations

* Use Greg's suggestion to simplify code

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2022-08-03 04:44:06 +02:00
Greg Landrum
222e55485d Fixes #5156 (#5412)
* make 2D coord gen more robust w.r.t. sanitization

* Fixes #5156

prepareMolForDrawing() was being called for mols without coords even if the option was disabled
This resolves that

* update expected hashes
2022-07-27 08:21:28 +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
Brian Kelley
4e8f9e11f5 Molzip: save bond dir when zipping (#5445)
* MolZip now saves the bonddir when zipping

* Add test for saving bonddir in MolZip

* Save either the first or second bond dir, fix the test to actually test

* Add more comprehensive bonddir checking and atom reordering

* Fix the atom swaps after the consistency check

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2022-07-26 05:44:47 +02:00
David Cosgrove
36a345a3cd Fix poor join between wedge and double bond. (#5452)
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-07-24 06:45:58 +02:00
David Cosgrove
cc1484f3fc Clear bond dirs before re-wedging. (#5449)
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-07-24 06:30:31 +02:00
Brian Kelley
07d9a2f915 MolZip: add atom property labels for mol-zipping (#5446)
Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2022-07-24 06:26:50 +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
eec737b432 Fixes #5395 (#5437)
* Fixes #5395

* fix a failing doctest
2022-07-20 16:05:11 +02:00
David Cosgrove
3856398727 Github5420 (#5421)
* Fix #5420.

* Tidy.

* Highlights stay parallel to bonds.

* Change way DrawShapeEllipse is defined, to make it same as DrawShapeArc.

* Change way DrawShapeEllipse is defined, to make it same as DrawShapeArc.

* Make highlight circles bigger when the bond highlights missed initially.

* Update expected test result.

* Update expected test result.

* Turn on check hash code.

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-07-20 13:39:10 +02:00
Eisuke Kawashima
48497c40f8 fix: specify static member variable PrintThread::cout_mutex inline (C++17) (#5428)
closes #5351
2022-07-18 12:42:00 +02:00
Greg Landrum
9fa1df1cf6 Drop usage of CIP information from the canonicalization code (#5385)
* stop using CIP codes in the atomic canonicalization

this will change results in some cases, so lots of tests need to be updated.

* stop breaking string literals... ARGH

* tests now pass

* update double bond canonicalization

* update a python test

* some cleanup

* update expected results for cartridge
2022-07-13 05:40:23 +02:00
Ric
0d8ea2aec1 Fixes #5423 (#5424)
* fix

* always remove molTotValence
2022-07-13 05:36:54 +02:00
Eisuke Kawashima
77db9ede80 fix doxygen comments (#5254) 2022-07-11 13:55:35 +02:00
David Cosgrove
4352b38574 Add draw option to force use of wedge information in MolBlock if pres… (#5417)
* Add draw option to force use of wedge information in MolBlock if present.

* Add check_file_hash.

* Move reapplyMolBlockWedging to MolFileStereochem and test case.
Expose to Python as ReapplyMolBlockWedging.

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-07-11 13:52:58 +02:00
Greg Landrum
0147cd8201 Fixes #5210 (#5408)
* revert duplicate chunk in release notes

* replace deprecated ifdefs
This one gets rid of USE_BUILTIN_POPCNT and RDK_THREADSAFE_SS
use RDK_OPTIMIZE_POPCNT or RDK_BUILD_THREADSAFE_SSS instead

* get rid of BUILD_COORDGEN_SUPPORT from ROMol.i

* fix a stupid typo

* update release notes
2022-07-11 11:20:03 +02:00
Rachel Walker
30547e4451 Fix performance issue in RingUtils::checkFused that slowed down sanitization (#5410) 2022-07-08 05:19:22 +02:00
Ric
d5aa4f5b5c Fixes #5403 (#5407)
* add a test

* add potential fix
2022-07-07 14:42:28 +02:00
Ric
b06bd882c7 Allow removal of non-special H atoms in SGroups (#5399)
* do not remoge H if it has a special purpose in an SGroup

* flip the removeinSGroup default

* do not remove H from H-only SGroups

* remove atoms/bonds from SGroups

* update existing tests

* add tests

* Apply suggestions from code review

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

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2022-07-07 11:05:18 +02:00
Jeff van Santen
73d0d82664 fix: rdkit.Chem.rdDistGeom.EmbedMultipleConfs docstring indentation (#5404) 2022-07-06 06:21:36 +02:00
Greg Landrum
6a56f02a84 Fixes #5383 (#5391)
* Fixes #5383

* response to review
this is a better fix
2022-07-05 12:55:33 +02:00
Ric
a88a89ec34 add missing include (#5398) 2022-07-01 18:20:02 +02:00
Greg Landrum
8676e3da64 Fixes #5386 and #5389 (#5387) 2022-07-01 06:36:26 +02:00
Greg Landrum
f7a98cf718 Support conjugated terminal groups in GetBestRMS() (#5322)
* add symmetrizeConjugatedTerminalGroups to GetBestRMS()

* make the tests clearer
2022-06-21 15:08:47 +02:00
David Cosgrove
4692e29c78 Fix typos in docString. (#5377)
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-06-20 06:08:50 +02:00
Brian Kelley
eddb87b2f0 Fixes #5324 (#5355) 2022-06-18 09:06:08 +02:00
Greg Landrum
7ee0eecd29 Fixes #5372 (#5374) 2022-06-17 12:56:58 -04:00
Ivan Tubert-Brohman
07e5b0cb01 Update docs for ReplaceSubstructs (#5343)
- Use O[CH3] instead of OC for the existing examples, to ensure that the
  the examples produce the output shown (assuming the query is parsed as
  a SMARTS).
- Add a note and an example showing how bonds are formed only to the
  atoms that were connected to the first atom in the substructure query,
  and suggest using ChemicalReaction for finer control.
2022-06-17 06:44:36 +02:00
Greg Landrum
fbbddc6035 Start using string_views in the file parsers (#5301)
* slow steps towards a string_view experiment

* Move first set of file-handling code to use string_view
This is about 12% faster on my machine

* oops, yaehmop had not been updated to C++17

* start moving v3000 over

* disable storing string_views in Dicts.

* a bit more optimization

* get windows builds working

* fix a couple leaks in the test code

* changes in response to review

* changes suggested in review
+ more refactoring

* fix an oversight

* remove another one

* remove debugging numbers
2022-06-14 17:18:40 -04:00
David Cosgrove
b7c9a8b3b7 Add class info for wavy bonds in SVGs. (#5358)
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2022-06-13 11:16:51 +02:00
Greg Landrum
fbaa6fd36c Fixes #5307 (#5310)
* Fixes #5307

* python doc string
2022-06-09 06:11:17 +02:00
Greg Landrum
cb0f48388a Prevent wedging ring bonds (#5356)
* a bit of modernization

* change weighting preferences for wedging bonds

Really try not to wedge ring bonds.
2022-06-09 04:51:32 +02:00
Brian Kelley
5cdcaa933a Fix segfault in mol zip (#5338)
* Fixes #5335

* fix invariant message

* Fix github issue number

* Simplify CHECK_INVARIANT logic and remove debugging output from tests
2022-06-01 05:06:34 +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
fb49a33b5a Fix a couple of problems with MolStandardize (#5319)
* Fixes #5317

* Fixes #5318

* Fixes #5320

* Update Code/GraphMol/MolStandardize/Charge.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2022-05-30 06:00:09 +02:00
Greg Landrum
c4acc9dc36 revert #5251, document the problem (#5335) 2022-05-30 04:32:38 +02:00