Commit Graph

91 Commits

Author SHA1 Message Date
Paolo Tosco
f7c888844d moved test.h from RDBoost to RDGeneral for consistency with export.h (#2074) 2018-10-11 17:35:23 -04:00
Greg Landrum
2ec3b2543d Fixes #2063 (#2075) 2018-10-02 11:39:37 -04:00
Greg Landrum
abcecf7456 enable SVG parsing from Python (#2045)
* add SVG parsing to python
re-enable the moldraw2d tests

* A couple of fixes connected to #2029

* handle problems parsing atom/bond SMILES

* wrap the whole thing in the <metadata> tag

* patch a memory allocation problem in the maeparser v1.0.0 (#2044)
2018-09-17 20:20:21 +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
77078eac66 Add an auto-populated file with cmake config options (#1874)
* this is a rough first pass, needs to be finished and is a strong argument for changing the names of some of the #defines that are currently used

* rationalize the rest of the #defines
add something to the release notes about this
2018-06-09 05:41:28 +02:00
Paolo Tosco
c08ea49bda - enable building DLLs on Windows (#1861)
* - enable building DLLs on Windows

* - export.h and test.h are now auto-generated by CMake
2018-05-16 08:42:41 +02:00
Matt Swain
a6354d1501 Make svg xmlns prefix use more consistent (#1866)
Set svg as the default xmlns, so no prefix is needed for every svg tag. Also remove all code in python wrappers that stripped these prefixes.
2018-05-14 17:07:55 +02:00
Greg Landrum
c9e3d9a040 Fixes #1829 (#1830) 2018-04-20 04:02:37 +02:00
Greg Landrum
656a62ca9e add an additional test to make sure the generated PNG is not empty 2018-04-19 06:26:15 +02:00
Greg Landrum
3637cd4d75 Fixes Issue 1614 (#1781)
* This makes assignStereochemistry cleanIt=True not remove CIS/TRANS
bond stereo chemistry that was manually added as described in issue #1614.

Incorrect CIS/TRANS stereochemistry will still be removed by
'cleanIt=true' if symmetry is detected. However, this symmetry
detection doesn't work in more complex pseudo-stereo chemistry cases:
bond stereo that depends on other bond stereo to break symmetry; and
bond stereo that depends on other atom stereo centers to break
symmetry. Test cases for these cases have been added ifdef'd in based
on USE_NEW_STEREOCHEMISTRY.

However, getting USE_NEW_STEREOCHEMISTRY to work in a copacetic way is
not trivial, I tried a little bit here to no avail. I'm leaving the
test cases checked in as they should be useful when we decide to make
the plunge into using Canon::chiralRankMolAtoms for symmetry detection
instead of the CIP ranks.

So this fixes at least the glaring issue of STEREOCIS and STEREOTRANS
being incorrectly removed by 'cleanIt=true' when it is indeed valid
stereo. The checks made for symmetry are rudimentary, but don't feel
complete.

* add another test; make what's being tested explicit

* test smiles generation and function when Hs have been added

* add a test that fails

* I think that it's ok to remove this

* backup

* At this point all tests pass.
Bond wedging is now handled even if sanitization is turned off when mol files are read

* adjust to code changes

* fix a couple problems caused by rebase

* update docs
2018-04-01 17:48:36 +02:00
Greg Landrum
108d84ab1e Switch from boost::thread to std::thread (#1745)
* boost::thread mostly gone... still need to get rid of once
everything compiles

* replace boost::call_once

* remove link-time dependency on boost::thread

* first pass at using async

* switch to using async everywhere
2018-02-22 03:43:07 +01:00
Greg Landrum
42eecc664d Integrate Coordgen (#1708)
* first pass, does not yet actually work

* pass2, same problems

* pass2, same problems

* another test

* new tests; bugfix

* move the code out to a header

* add a double bond example

* enable auto-downloads of the code

* move the function to its own namespace

* first pass at a basic python wrapper

* change coordgen commit used

* try supporting bond stereo; does not currently work

* cis/trans seems to now work.

* first pass at templates; needs testing

* use the fixed flag too

* need mol align

* expand test

* initial pass at python wrapper for template

* simplify tests

* add an option to directly use a substructure match for alignment

* scaling

* add #define

* Define a cache setting for RDK_COORDGEN_LIBS to allow these to be used in other packages

* return the conformer id from addCoords

* Make CoordGen the default when it’s available.
This is a backup commit… the tests don’t even come close to passing.

* add some debugging options for a bit

* add alignment step to testing when using non-fixed coords

* Add global to allow use of CoordGen to be disabled
get the basic depictor tests working

* make coordgen the default when it is available

* make sure things continue to work when coordgen is disabled

* get windows builds working

* mods to get this building on windows.
something is screwy with the fileParsersTest1

* no need to generate coords for the 1K C string

* fix java wrappers

* works on linux

* update the (stupid) way dependencies were handled on windows.
this allows a lot of cleanup of cmake files (still more to do)
the linux build is unlikely to work due to the way _statics aren't handled

* docs

* extend forceRDKit applicability

* switch coordgen version

* try using templates

* try to get the template dir finding reasonably robust w.r.t. conda install

* continuing to iterate on the way the template file is installed

* fix a problem caused by the merge

* remove test that should never have been checked in

* update expected results for cartridge tests

* switch back to using the RDKit as the default coordinate generator
2018-02-15 05:36:03 +01:00
Greg Landrum
1efa8e696e another clang-format run 2017-10-12 06:42:15 +02:00
Greg Landrum
f94e277856 another pass of clang modernize 2017-10-12 06:35:51 +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
Greg Landrum
56b472ef97 Support continuous highlighting in drawMolecules(). (#1579)
Add a fillHighlights option to DrawOptions
2017-09-22 07:25:17 +02:00
Greg Landrum
9af90524a4 Provide support for color palettes in MolDraw2D (#1546)
* first steps towards flexible colour palettes

* add B&W palette and a test for it

* add python support;
this is, once again, not the best API due to the inability to auto-translate boost::tuples at this point

* more palette control from python

* rename some of the swig-wrapped types to make them more consistent

* handle palettes that do not have a default value
2017-09-08 10:52:01 +02:00
Greg Landrum
16023c83ae Support drawing reactions from C++ (#1444)
* expose and test GetDrawCoords()

* very basics are working; still loads of work to do

* very basics are working; still loads of work to do

* symbols and arrows kind of work

* switch to Nadine's approach for drawing
needs more work (like arrows and pluses) but already is not too bad

* better, but agents still to close to arrow and arrow is too short

* add a test for rxns without agents

* fix picking of cid;
drawing reactions without reactants or without products should in theory now work, but additional work is needed to get the arrows to show up

* make reactions without reactants or without products draw properly

* tweak vshift a bit; would be good to have a better solution to this

* do not draw H2O as OH2

* add option to use highlighting to show atom maps

* highlight bonds too

* cleanup

* add drawReaction to the python wrapper

* docs

* remove some printing

* fix (for real) the drawing of degree zero atoms

* ensure ring finding gets done; add some more tests

* add some SMARTS-based tests; these do not work

* improve reactant highlighting in rxn drawing

- define default colors for highlighting of reactants, atom or bonds
in the drawing options
- make highlighting colors customizable through the API

* rename to test4 in prep for merge

* temporarily disable test4 since it does not work anyway

* fix some kekulization problems

* fix YA unicode problem

* remove a stupid typo
2017-07-07 05:12:33 +02:00
Greg Landrum
5741d37c39 Support drawing reactions from C++ (#1444)
* expose and test GetDrawCoords()

* very basics are working; still loads of work to do

* very basics are working; still loads of work to do

* symbols and arrows kind of work

* switch to Nadine's approach for drawing
needs more work (like arrows and pluses) but already is not too bad

* better, but agents still to close to arrow and arrow is too short

* add a test for rxns without agents

* fix picking of cid;
drawing reactions without reactants or without products should in theory now work, but additional work is needed to get the arrows to show up

* make reactions without reactants or without products draw properly

* tweak vshift a bit; would be good to have a better solution to this

* do not draw H2O as OH2

* add option to use highlighting to show atom maps

* highlight bonds too

* cleanup

* add drawReaction to the python wrapper

* docs

* remove some printing

* fix (for real) the drawing of degree zero atoms

* ensure ring finding gets done; add some more tests

* add some SMARTS-based tests; these do not work

* improve reactant highlighting in rxn drawing

- define default colors for highlighting of reactants, atom or bonds
in the drawing options
- make highlighting colors customizable through the API

* rename to test4 in prep for merge

* temporarily disable test4 since it does not work anyway

* fix some kekulization problems

* fix YA unicode problem

* remove a stupid typo
2017-07-05 14:25:31 -04:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +02:00
Greg Landrum
2a916b1a74 the functionality was already there, this just shows how to use it (#1355) 2017-03-12 09:57:43 -04:00
Greg Landrum
09d7314aed Feat/github1325 (#1347)
* Fixes #1325

* add a smart PRECONDITION
2017-03-08 23:17:29 -05:00
Greg Landrum
527b6cd922 Fixes #1322 (#1342) 2017-03-04 12:33:34 -05:00
Greg Landrum
f196567182 Fixes #1271 (#1272)
* Fixes #1271

* add a comment or two

* fix single-atom molecules too

* add a test for grid drawing too

* simplification of the special cases; no need to make things so complex
2017-01-22 13:49:09 -05:00
Greg Landrum
fc5b52afcd Fixes #1035 (#1135) 2016-11-01 11:41:12 +01:00
Greg Landrum
dc7c9b6f31 Provide SVG output from the cartridge (#1109)
* a bit of header cleanup

* Fixes #1106

* First pass, basics.
Still need tests and handling of parameters.

* initial pass at including JSON parsing of options (not complete)

* handle errors while parsing json instead of just crashing the server

* updated (and working) JSON configuration

* first drawing tests

* document the new function

* it helps to save before committing
2016-10-21 17:05:59 -04:00
Greg Landrum
f0de22fd73 Fixes #1090 (#1105) 2016-10-17 13:05:21 -04:00
Greg Landrum
65f3cab86a Fixes #1056 (#1101) 2016-10-14 11:36:46 -04:00
Greg Landrum
98e3e941da Merge branch 'feat/draw_multiple_mols' of https://github.com/greglandrum/rdkit into greglandrum-feat/draw_multiple_mols 2016-09-14 16:42:48 -07:00
Greg Landrum
23fce87073 Draw crossed bonds (#1052)
* remove dead code

* Draw crossed bonds
2016-09-14 11:01:50 -04:00
Greg Landrum
eb2b81c1e2 handle null molecules 2016-08-31 20:13:45 +02:00
Greg Landrum
53247114a3 more grid 2016-08-31 07:20:21 +02:00
Greg Landrum
29d9251f93 first pass at drawing a grid 2016-08-31 05:01:50 +02:00
Greg Landrum
435a07a30e better control over scaling 2016-08-30 17:56:34 +02:00
Greg Landrum
cb895f93c7 first pass of python wrapper 2016-08-30 17:02:10 +02:00
Greg Landrum
1eb2c4924a grid drawing now working 2016-08-30 15:18:32 +02:00
Greg Landrum
8b6ecda0cd first pass at multiple panels 2016-08-30 14:41:56 +02:00
Greg Landrum
ad79aff187 more or less works 2016-08-30 13:45:36 +02:00
Paolo Tosco
87b69a7d82 Added the option to label deuterium and tritium as D and T (#1011)
* - added the option to label deuterium and tritium as D and T
  to the C++ and Python drawing code

* - added test for deuterium/tritium labels
2016-08-19 04:51:04 +02:00
Greg Landrum
ddb13ecc16 Add an initial version of wavy bonds (#1014)
* Add an initial version of wavy bonds
Used for attachment points and unknown stereochem
This is not a perfect implementation, but is a decent place to start
Currently only supports SVG and Cairo canvases.

* code review cleanup
2016-08-16 08:06:27 +02:00
Greg Landrum
91212a4eb3 A variety of drawing-related changes (#986)
* Fixes #982
also changes bond-wedging algorithm to favor lighter non-ring bonds

* prefer wedging bonds to lower-degree atoms

* Fixes #983

* small fixes
- Fix a problem where a chiral atom is selected to draw a wedge to instead of a ring atom
- Fix a problem where two calls to PrepareMolForDrawing() led to two wedged bonds from an atom.

* Fixes #985

This isn't the most satisfying solution (the wedged bonds are sometimes a bit too large), but it gives reasonable results on the test cases I've tried.
2016-07-25 17:28:41 -04:00
Greg Landrum
0705af7a41 Fixes #953 (#954) 2016-06-24 07:42:21 -04:00
Greg Landrum
7ee545f717 Fixes #932 (#950) 2016-06-21 14:32:39 -04:00
Greg Landrum
126788e473 Fix/github910 (#913)
* A big step towards solving #910

1) Rank atoms by inverse atomic number (ensures Hs go last)
2) Use heavy-atom degree when doing layout (ensures Hs do not change gross geometry)

* basic testing

* take degree into account with ranks too

* further improvements of relative ranking.
definitely need some cleanup of this now

* some cleanup

* add an explicit test
2016-05-20 05:23:12 +01:00
Greg Landrum
e2dca37212 another test case 2016-04-14 15:56:44 +02:00
Greg Landrum
8c3d28da67 Fixes #860 2016-04-14 15:50:36 +02:00
Greg Landrum
33489e70e3 Fixes #852
* Fixes #852

The test added is the usual thing for the drawing code: produce some files for visual inspection.

* limit the number of lines in a short wedge
2016-04-11 13:40:44 -04:00
Greg Landrum
a7d163471d make it easier to draw a molecule with a legend. Note: should clean up the backend code some... there is way too much duplication here 2016-03-05 16:38:07 +01:00
Greg Landrum
3a5d1bd6c8 fix getAtomCoords() and add a test for it 2016-03-05 16:22:02 +01:00
Greg Landrum
db5f8d43aa Add the ability to do legends on molecules in MolDraw2D
Relevant to #424
2016-03-05 15:44:55 +01:00