- add missing Fingerprints dependency to MinimalLib CMakeLists.txt
- remove conditional RGroupDecomposition dependency in MinimalLib CMakeLists.txt, as it is always needed because of relabelMappedDummies()
wip
Co-authored-by: ptosco <paolo.tosco@novartis.com>
* - When depictions are made using the useMolBlockWedging flag, make sure that kekulization is done after original wedging has been applied to reduce the odds that bond wedges are placed on double bonds
- Refactored MinimalLib code to avoid code duplication
- get_molblock() should reapplyMolBlockWedging on a copy of the passed molecule rather than on the original
- Added unit tests
* Update Code/MinimalLib/jswrapper.cpp
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
---------
Co-authored-by: ptosco <paolo.tosco@novartis.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
* - fix#7157
- add the assignCIPLabels flag to MinimalLib's mol_from_input()
- added cffi and JS tests
- refactored process_details(), process_mol_details() and process_rxn_details() to take a struct reference as parameter rather than a long list of parameters
- this also allowed to get rid of one of the ugly GET_JSON macros
- exposed panelWidth, panelHeight and noFreetype (the latter is useful for testing)
- made width and height to default to -1 in mol_to_svg since we now support flexicanvas
* added a bunch of assignments I'd forgotten in the deprecated process_mol_details() overload
* MSVC does not like inner functions
* updated docstrings
---------
Co-authored-by: ptosco <paolo.tosco@novartis.com>
* atropisomer handling added
* fixed non-used variables, linking directives
* BOOST LIB start/stop fixes, linking fix
* Fixes for RDKIT CI errors
* minimalLib fix
* changed vector<enum> for java builds
* check for extra chars in CIP labeling
* removed wrong deprecated message
* fix ostrstream output error?
* restored _ChiralAtomRank to lowercase first letter
* changes for merged master
* Fixed catch label for new Catch package
* update expected psql results
* get swig wrappers building
* restore MolFileStereochem to FileParsers
* fix java wrapper for reapplyMolBlockWedging
* some suggestions
* move a couple functions out of Bond
* Merge branch 'master' into pr/atropisomers2
* merged master
* Renamed setStereoanyFromSquiggleBond
* atropisomers in cdxml, rationalize atrop wedging, stereoGroups in drawMol
* fix for CI build
* attempt to fix java build in CI
* attempt to fix java build in CI #2
* New routine to remove non-explicit 3D-geneated chirality
* changed to use pair for atrop atoms and related bonds
* Changes as per PR reviews
* PR review respnses
* PR review reponse - more
* Fix merge from master
* fixing java ci after merge
* Updated the help doc for atripisomers
* update the atropisomer docs
* improve the images
* add the source CXSMILES
---------
Co-authored-by: greg landrum <greg.landrum@gmail.com>
* Compile time and runtime deprecation warnings
* Used [[deprecated]] attribute to mark deprecation on cpp side
* Used RDLog to escalate deprecation warnings to python
* deprecated non fingerprint generator fingerprint generation functions
* Address build errors
* suppress deprecation warnings in cpps and tests
* experiment with new SWIG versions in the mac azure pipeline
* More deprecation suppression
* revert mac java experiment
* Fix SWIG syntax errors
* Attempt to fix windows unit test
* Remove test because of logging behavior
* Change linux java build to SWIG 4.1
- removes the need for preprocessor interaction
* Change mac java build to SWIG 4.1
* try updating the CI buid
* lock cmake version
needed to find JNI correctly
* update compiler versions
needed for the boost
* Fix typo and unavailable version
* Fix version conflict
* update mac build
* get linux build working?
---------
Co-authored-by: Patrick Penner <patrick@ppenner.com>
* - added a convenience function to relabel R-groups in a chemist-friendly fashion
- exposed functionality to MinimalLib through a JSON option at molecule creation time
- added relevant unit tests
* changes in response to review
* added missing library
* fixed Python test
---------
Co-authored-by: ptosco <paolo.tosco@novartis.com>
* Revert "Revert "Removed some code duplication between Depictor.cpp and common.h (#6368)" (#6797)"
This reverts commit 824616c5b9.
* security blanket: add back tests of the current usage pattern
* - fixed bug in get_sss_json() (#6806)
- added unit test for the above
Co-authored-by: ptosco <paolo.tosco@novartis.com>
---------
Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
Co-authored-by: ptosco <paolo.tosco@novartis.com>
* - implemented alignOnly mode into RDDepict::generateDepictionMatching2DStructure()
- the allowRGroups option now also supports potentially missing R groups (i.e., R groups that do not match any atom, such as those connected to generic aromatic atoms)
- added the adjustMolBlockWedging parameter (which defaults to true) to invert/clear molblock wedging information as appropriate
- added unit tests for the above new features
- added RDDepict::generateDepictionMatching2DStructure() overloads taking RDDepict::ConstrainedDepictionParams parameter for convenience
- removed some redundant RDDepict:: namespace specifications
* Fix chirality handling when the chiral atom is the first one in a SMARTS (#6730)
* Set _SmilesStart when parsing SMARTS.
* SmartsWriter should also invert first atoms, like SMILES.
* Update test cases now these SMILES match themselves as SMARTS.
* rerun bison
* cleanup a possible repeated define
* When an atom moves from the first to second position winding should flip in SMARTS (i.e. same as SMILES).
---------
Co-authored-by: greg landrum <greg.landrum@gmail.com>
* Some small cleanups from the UGM Hackathon (#6744)
* move definition of a couple global constants from a .h to a .cpp
* careful removal of some redundant atom PRECONDITIONS
* careful remove of some redundant ROMol PRECONDITIONS
a bit of additional cleanup
* optimization masquerading as modernization
* some more tidying
* a bit more atom cleanup
* change in response to review
* Fixes#6756 (#6780)
* update release notes and cmakelists for beta (#6788)
* move problematic functions to Chirality namespace
* - implemented alignOnly mode into RDDepict::generateDepictionMatching2DStructure()
- the allowRGroups option now also supports potentially missing R groups (i.e., R groups that do not match any atom, such as those connected to generic aromatic atoms)
- added the adjustMolBlockWedging parameter (which defaults to true) to invert/clear molblock wedging information as appropriate
- added unit tests for the above new features
- added RDDepict::generateDepictionMatching2DStructure() overloads taking RDDepict::ConstrainedDepictionParams parameter for convenience
- removed some redundant RDDepict:: namespace specifications
* move problematic functions to Chirality namespace
* added missing dependency
* let's check what is going wrong
* CoordGen tests should not run if CoordGen support is not available in the build
---------
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
Co-authored-by: John Mayfield <john@nextmovesoftware.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
1. tee: the log is captured in a buffer but also sent to the native output channel
2. capture: the log is captured in a buffer without being sent to the native output channel
- removed duplicate logging_needs_init and needs_init atomic bool variables from cffiwrapper.cpp and consolidated them into a static LoggingFlag d_loggingNeedsInit class variable
- added relevant C and JS tests
Co-authored-by: ptosco <paolo.tosco@novartis.com>
- setAromaticity (defaults to true)
- fastFindRings (defaults to true; only used when sanitize=false)
- assignStereo (defaults to true)
These options avoid doing unnecessary work when the molecule is only used for specific purposes (e.g., computing FPs or doing substructure searches)
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
* avoid that assignStereochemistry() fails when removeHs=true
* changes in response to review
* Remove unused variable declarations
As suggested in the code review
---------
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
`and` is a C++ keyword, but it isn't supported by default on
some compilers (msvc). I'd like to disable it on _all_ platforms
in Schrodinger builds so that people don't accidentally post
code that fails on a single platform.
However, that means external headers need to use `&&` and `||`
instead of `and` and `or`, even in platform-specific code.
* - fix indentation
- fix regex check (which currently always fails)
* wip
* - added clearMolBlockWedgingInfo()
- added invertMolBlockWedgingInfo()
- MinimalLib::generate_aligned_coords() now inverts stereochemistry if a rigid-body alignment transformation caused chiality inversion
- MinimalLib::generate_aligned_coords() now clears stereochemistry if coordinates changed
- added JSMol::clear_prop() to the already existing JSMol::get_prop() and JSMol::set_prop()
- renamed commonchem to rdkitjson in JS unit test
- added relevant unit tests
* fixed mistake in logic
* - added add_hs_in_place() and remove_hs_in_place() to the JS MinmalLib
- added relevant tests
* - removed check for existence of a property ahead of clearing it as it is not necessary; updated the clearProp docstring to reflect this
- updated the MolFileStereochem.h docstrings based on review comments and fixed a typo
- fixed two (legitimate) compiler warnings as get_molblock() and get_v3kmolblock() should return nullptr and not a pointer to an empty string; added tests for this as there was none
- in MinimalLib/common.h, moved the check of whether a molecule has undergone a flip around the Z axis to a function in the anonymous namespace
- in MinimalLib/common.h, added logic to preserve original wedging (and eventually invert it) also when alignOnly is set to false, in case the wedging is all within the constrained scaffold
- added thourough testing of the wedging logic on both CFFI and JS sides
* - added equality operator to CXXAtomIter and CXXBondIter classes such that they can used with implicit loop STL algorithms
- added relevant unit tests
* fix Windows build
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
* write stereogroups
* Parse stereogroups
* add parameters to python wrappers
* more tests
* write substancegroups
* parse SubstanceGroups
* Fix a crashing bug with null molecules
* more testing
* add some docs
* update expected cffi results
* oh, this is delightful syntax
* adapt minimallib and the cartridge tests
some small cleanups
* stupid padding
* update expected
* changes in response to review
* - enable get_molblock(details_json) from MinimalLib as it is already enabled in CFFI
- enable useMolBlockWedging on get_molblock() in both CFFI and JS MinimalLib
- add tests
* - expose also addChiralHs
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
* - extend prepareAndDrawMolecule() with missing optional parameters already supported by prepareMolForDrawing()
- enable useMolBlockWedging, wedgeBonds, addChiralHs, forceCoords, wavyBonds in CFFI/MinimalLib
- add relevant CFFI and JS unit tests
* Replace AllProps with a smaller subset
* make sure we pickle properties Python-side
* changes in response to review
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
- removed details from get_maccs_fp calls since there are no adjustable parameters
- exposed get_maccs_fp to JS
- added tests and adjusted existing ones since some deprecated functions were removed and do not need testing anymore
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
* expose highlighAtomColors, highlighBondColors and highlightAtomRadii to CFFI and JS
* removed comment
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
* update AvalonTools to version 2.0.1
* Improvements to 2D depiction and alignment/RMSD calculation
- Refactored the straightenDepiction code which is now much simpler and more readable and supports a minimizeRotation parameter
- added C++, Python and JS tests for the new minimizeRotation parameter
- refactored tests to use CalcRMS rather than an internal implementation to compute RMS deviations
- Removed duplicated code in CalcRMS() and getBestRMS() and made their APIs consistent with respect to supported parameters
IMPORTANT NOTE: for backwards compatibility I set the CalcRMS() default for the new symmetrizeConjugatedTerminalGroups
to false as this parameter was not originally supported. @greg: I would be very much in favor of setting this to true instead
if you agree, even though it might change results for existing scripts, as I think it is a much more sensible default.
- Improved documentation to clarify the difference between CalcRMS() and getBestRMS()
- Added unit tests for CalcRMS() as there was none previously
- Added tests for the additional CalcRMS() and getBestRMS() parameters
- Added a new getBestAlignmentTransform() function
- The CFFI function set_2d_coords_aligned() now returns the matching atoms similarly to the C++, Python and JS counterparts
IMPORTANT NOTE: this required an API change for the additional char ** parameter used to return the match.
Existing code using set_2d_coords_aligned() will fail to compile and will require a last NULL parameter to be added to compile again
- Removed duplicated code between CFFI set_2d_coords_aligned() and JS generate_aligned_coords()
- Added has_2d_coords() to the CFFI library
- generate_aligned_coords() now supports JSON parameters and the previous versions are deprecated
- set_2d_coords_aligned() and generate_aligned_coords() both support an alignOnly parameter (which defaults to false).
If set to true, rather than re-generating a fresh 2D layout around templateMol, the existing coordinates (if any) are simply aligned
to the provided templateMol. If the molecule has no coordinates, a set of 2D coordinates is generated independently of templateMol
and then aligned to the provided templateMol
- avoid that when acceptFailure is false set_2d_coords_aligned() and generate_aligned_coords() overwrite existing coordinates
* - explicitly link testDepictor to MolAlign library
* - add MolAlign dependency to testDepictor (rather than to the catch test as in the previous commit)
- add a couple of tweaks
* suppress compiler warnings (1st pass)
* warnings: 2nd pass
* warnings: 3rd pass
* - alignOnly mode should also support allowRGroups
* - fixed C++ build
- added tests for allowRGroups+alignOnly combination
* changes in response to review
* added an entry to backward incompatible changes regarding set_2d_coords_aligned()
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
* - exposed reaction drawing in MinimalLib
- fixed a typo in the error message "JSON doesn't contain 'atoms' field, or it is not an array"
- replaced RapidJson HasMember() with FindMember() to avoid a duplicate lookup in case the member exists and can be accessed
- some cosmetic style changes (avoid multiple variable declarations on a single line, use curly bracket also for one-liner if clauses, use auto where possible)
- capitalized "greg Landrum" to "Greg Landrum" (well deserved)
- exposed other FPs in addition to Morgan and Pattern FPs in MinimalLib
- added relevant tests
* - update CXSMARTS test in MinimalLib
* Changes in response to review:
- exposed reaction drawing functionality to CFFI and added relevant tests
- refactored fingerprint code to use JSON details and deprecated the Morgan/pattern fingerprint functions that used multiple parameters
- all fingerprints are now exposed to both JS and CFFI with no code duplication
- fixed a potential crash bug in the CFFI library where calling get_morgan_fp(), get_rdkit_fp() or get_pattern_fp with a NULL mol_pkl would result in dereferencing a nullptr
* removed debugging printouts committed accidentally
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
* - adds normalizeDepiction() and Python wrappers
- adds straightenDepiction() and Python wrappers
- adds an early check for R-labels to be in the accepted range to avoid throwing an exception later on
- adds a kekulize flag to process_details() to enable depicting molecules which fail to kekulize from JavaScript
- adds JavaScript functions to get fingerprints as Uint8Array
- adds JavaScript function to generate pickled molecule as Uint8Array
- adds JavaScript function to restore molecule from Uint8Array pickled
- adds has_coords() JavaScript function
- adds set_new_coords() to set JSMol coordinates in-place
- adds get_mol_copy() to obtain a JSMol copy
* fix build failures
* changes in response to review
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
* Remove accidentally tracked files and unset x flag
* Ignore ComicNeue
* Unify test tag to `reader`
* Trivial destructors
* Bump CMAKE_CXX_STANDARD to 14 (#4165)
* - expose SubstructureLibrary to MinimalLib
- expose acceptFailure flag to MinimalLib generate_aligned_coords
- expose merge_query_hs functionality to MinimalLib
- expose kekulize flag to MinimalLib get_mol
- add relevant JS tests
* integrates previous commit
* changes in response to review
Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
* Swap to using a data structure for default normalization parameters
* bring the default fragment data into the code too
* cleanup
* add reionizer parameters via data
change fragment parse failures to ValueErrorExceptions
* tautomer parameters in the code
* got a little over-enthusiastic in that last cleanup
* use boost::flyweight to cache normalization and charge data params
* a bit more cleanup
* support reading params from JSON
* fragments from JSON
single-call for fragment removal
* add a one-liner for the canonical tautomer
* quick refactor
* Fixes#4115
* complete the parents
* docs
* move the definitions to a namespace and make them const
* see if switching to c++14 fixes the CI compile problems with g++ 5.5
* somewhat uglier way of solving the initalizer list problem
* set all source code files to have native line endings
* normalized all source code line endings
Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
* hello world works
* more
* more
minimallib needs to be tested
* parse substructure parameters from JSON
* add substruct search and parameters
* add descriptors
* register more descriptors
* fingerprints, first pass
* stop outputting tiny coord vals
* support generating 2d coords
* coordgen testing
* return nulls
* initial 3d support; add/removeHs; cleanup
* Embedding parameters from JSON
* update
* pattern fp, fps as bytes
* use json to configure MFP
* use json to configure rdkit and pattern fps
* aligned 2d coords
* parsing options
* options for writers
* rename remove_hs
* get this working on windows (kind of)
* silence some msvc warnings
* cmake updates
* update python tests
* add the CFFI code to CI builds
* cleanup line ending mess?
* a couple small fixes
* make this work with URF
* support coordMap in the 3D coordinate generation
* updates in response to review