Commit Graph

4084 Commits

Author SHA1 Message Date
Brian Kelley
2b99ee477c Allow fragments to be grouped in cdxml (#7529)
* Allow fragments to be groups in CDXML

* Add support for grouped reactants

* run clang-format

* Change github issue to 7528

* Add documents to the code

* response to review, check grouped reactants in cdxml against rxn file

* Remove unused code

* Add missing file

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2024-06-23 07:02:19 +02:00
Paolo Tosco
b5d4b54d20 - patch RapidJSON 1.1.0 release backporting a fix from the master branch to avoid a compilation error on newer compilers (fix #7485) (#7550)
- update MinimalLib Dockerfile to Debian Bookworm and patch RapidJSON in case someone wants to build an older release (fix #7530)

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-06-23 06:59:52 +02:00
Paolo Tosco
50aea5cf62 Fix issues arising from useMolBlockWedging and the new atropisomer kekulization code (#7540)
* - 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>
2024-06-20 19:32:41 +02:00
Greg Landrum
d3061b03ef Fixes github #7533 (#7539)
* Fixes #7533

Fixes problem with SparseIntVect and SparseBitVect where the intention is to
be able to store all possible values of the index type: in these cases
you could not store (or access) the final element.

* increase the verbosity of the DataStructs tests
so that we can see what's going on
2024-06-20 09:27:27 +02:00
Anna Brünisholz
3a8199e4ca Numpy 2 Support (#7531)
* facilitate numpy 2.0 support

* so that all tests run smoothly

* not yet ready for this

* w/ casting to bool

* remove formatting changes from this PR
2024-06-19 07:54:50 +02:00
Ricardo Rodriguez
d6171aaade Fixes #7509 (#7513)
* add a test

* scale pseudo 3d offset

* update inchi test

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-06-14 05:39:48 +02:00
Greg Landrum
ea6fbeec30 add MolToV2KMolBlock() (#7511)
* add MolToV2KMolBlock()

small refactoring in the mol block writing

* throw an exception for more than 999 atoms, bonds, or SGroups
update docs for that

changes in response to review
2024-06-13 09:43:59 +02:00
Riccardo Vianello
256515f40d Optionally limit the MolStandardize::Uncharger to only alter the protonation state (#7458)
* refactoring of the Uncharger class

* optionally limit the Uncharger to only change the protonation state

* changes in response to review

* refactor the handling of positively charged atoms

* changes in response to review

* changes in response to review

* Revert "changes in response to review"

This reverts commit d42e1286d5.

* changes in response to review
2024-06-13 08:37:24 +02:00
tadhurst-cdd
4ce1a5640a Ring stereo atropisomers (#7486)
* changed string_view to string in catch test

* fix for ring-stereo atropisomers

* removed debug cout

* removed change to build in debug mode

* change catch arg to a rerference

* changes as per PR review
2024-06-13 08:35:42 +02:00
Paolo Tosco
a7e1f3014e - avoid inconsistency between V2K and V3K MDL output wrt isotopic labelling of R groups (neither should be isotopically labelled) (#7504)
- isotopic labelling should not depend on the presence of a query atom feature, but rather on the presence of common_properties::_MolFileRLabel

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-06-09 07:32:16 +02:00
nmaeder
685e781b54 Allow creation of an empty forcefield (#7494)
* add posibility to create a force field that does not have any contributions.

* move to FFConvenience.h and add C++ tests

* deallocate memory

* use range based for loop

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

* Making adjustments according to the review of @greglandrum

* undo unintentional formatting

* replace TEST_ASSERT with CHECK

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-06-08 05:18:22 +02:00
Greg Landrum
93e8a746bf Shrink the tautomeric zone for the v2 hash of things like imines (#7502) 2024-06-07 05:09:57 +02:00
Greg Landrum
8c27805fa3 Allow wedged double and aromatic bonds (#7495)
* support wedging in double and aromatic bonds

This is a first pass and the testing isn't really there.

* add expected test results (from windows...)
switch to not using freetype for the tests

* response to review
2024-06-07 05:09:33 +02:00
Greg Landrum
c40fb8791c Favor nonwedged bonds in kekulization (#7456)
* Try not to make wedged bonds double in the kekulization code

This is a first pass implementation and definitely needs more testing of the new feature.
Probably looking at optimizing the code would also not be terrible.

All tests pass with this commit

* Some changes to the kekulization in presence of wedged bonds and additional testing

* additional kekulization test case

* start the kekulization in rings with wedged bonds

add some bulk tests

all tests now passing for me

* changes from review

---------

Co-authored-by: Riccardo Vianello <riccardo.vianello@gmail.com>
2024-06-05 13:56:00 +02:00
Ricardo Rodriguez
67ef181233 install atrop header (#7487) 2024-06-04 16:15:21 +02:00
Rachael Pirie
c651ca61de Dclv fix (#7480)
* fix for ligand only DCLV calcs

* formatting suggestion from review

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-06-04 16:14:05 +02:00
Inwan Yoo
fbad8f7399 fix: Add aromatic aluminium token (#7428)
* fix: Restrict lowercase atomic numbers

* fix: Add missing test for aromatic aluminum

* fix: Add independent test case for aromatic aluminum
2024-05-31 14:47:14 +02:00
Greg Landrum
ba5f43fa6f Fixes #7438 (#7474)
This moves the function into the Chirality namespace.
2024-05-31 14:41:22 +02:00
Brian Kelley
2a1f488582 Remove unnecessary wrapped pointers (#7465) 2024-05-30 14:12:33 +02:00
Ricardo Rodriguez
9a9eacc8b6 MaeWriter: handle the R group label property and update the Maestro property prefixing (#7454)
* update prefix to _rdkit_, special treatment for group label prop

* update tests
2024-05-30 14:11:19 +02:00
Brian Kelley
3a4a744611 Allow the substruct library to be deleted when refcount goes to 0 (#7462)
* Allow the substruct library to be deleted when refcount goes to 0

* Remove whitespace changes

* Update Code/GraphMol/SubstructLibrary/Wrap/SubstructLibraryWrap.cpp

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

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-05-28 04:39:54 +02:00
Greg Landrum
2bc3a2d3e2 Allow disabling output of dative bonds to SMILES (#7384)
* basic code to convert dative to single if we aren't outputting dative to the SMILES

add forms of GetAtomSmiles() and GetBondSmiles() that take SmilesWriteParams

* dative/coordinate bond support when writing CXSMILES

* expose all of that to Python

* remove usage of _doIsoSmiles property
add params to smarts writers

* allow disabling dative bonds in SMARTS

* typo

* add support to the reaction writers

* support params for SMARTS
2024-05-25 06:48:55 +02:00
Riccardo Vianello
b5041c3c51 Fix a python 3.12 compatibility issue (#7450) 2024-05-24 07:32:50 +02:00
Greg Landrum
db952786b6 Expose a couple of additional functions to Python (#7444) 2024-05-17 04:47:30 +02:00
Ricardo Rodriguez
a9b7881b8b Fixes #7153 (#7441)
* ignore ct stereo status, enh stereo status, atom type on read

* do not prefix maestro properties

* add a test
2024-05-16 19:42:46 +02:00
Greg Landrum
748f36f7d8 Fixes #7434 (#7446) 2024-05-16 14:32:38 +02:00
Ricardo Rodriguez
bedd58e10c Fixes #7367 (#7426)
* make wedgeBondsFromAtropisomers get symm SSSR if not present

* add atropisomer wedging ring info test

* add a test

* update test
2024-05-16 09:24:55 +02:00
Ricardo Rodriguez
d71e82179d Fixes #7375 (#7381)
* check for ringinfo levels instead of init

* check for ring info in kekulizefragment

* add a test

* update tests

* update doctests

* revert ringinfo level checks
2024-05-16 09:13:32 +02:00
Greg Landrum
6bc3aa4b47 Make CXSMILES writer use the default conformer ID (#7415)
* Fixes #7414
Fixes #7409

* skip that test if cairo is not enabled
2024-05-09 14:43:49 +02:00
Greg Landrum
a64ab4ef5f fix a lifetime bug Andrew Dalke identified (#7408) 2024-05-08 22:25:43 -04:00
Greg Landrum
18d1ff5f8f Prefer wedging ring bonds around atropisomers (#7373)
* prefer wedging ring bonds for atropisomers

* update expected results

* handle 3D as well

* prefer wedging to larger rings

wedging bonds in 5 rings make later attempts at improving kekulization very difficult

update expected results

* extend those changes to 3D

* update tests for those changes

* avoid wedging atropisomers if possible

response to review
2024-05-08 06:04:23 +02:00
tadhurst-cdd
a2b149a806 No coords atropisomers - fix smiles output of atrop wedges after reordering (#7418)
* removed string_view in favor of string for catch test

* add parsing and generation of atropisomers when coords not present

* changed string_view to string in catch test

* more docs

* reformulation of the docs

* make an error message a little bit more useful

* small optimization
clang-format

* add `BondWedgingParameters` to new function

* changes for CIP test errors

* Updated internal doc to match what it does

* changes per PR review

* removed cout statements in tests

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-05-07 17:06:33 +02:00
David Cosgrove
f48c87444d Expose replaceAtomWithQueryAtom to Python (#7380)
* Expose QueryOpts::replaceAtomWithQueryAtom.

* Indentation error.

* Response to review.

* Update docstrings in response to review.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2024-05-07 06:50:59 +02:00
tadhurst-cdd
9386481b19 fix location of MolFileSterechem.h (#7420) 2024-05-07 06:26:42 +02:00
Greg Landrum
34e5569866 deprecations for the 2024.09 release (#7398)
* deprecations for the 2024.09 release

* update doctests

* Fixes #7402

* get tests passing when the cairo build is not there

* fix a problem in the tests
2024-05-05 07:30:00 -04:00
Greg Landrum
31f11952e0 Fix #7311: problem with InChI for phosphinic acid (#7419)
* backup

* remove default valence for Tl
2024-05-03 21:23:37 +02:00
Greg Landrum
a7ac25cbe8 Fixes #7300 (#7413) 2024-05-02 17:32:05 +02:00
Riccardo Vianello
187d2ca007 Prevent the normalization of conjugated cations from applying to the oxime oxygen (#7403) 2024-04-30 17:06:07 +02:00
Brian Kelley
9764f70d41 Allow any bond (smiles ~) recognition in CDXML (#7363)
* Allow any bond (smiles ~) recognition in CDXML

* Move anybond.cdxml to the right place

* a bit of simplification

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-04-29 16:20:23 +02:00
Ricardo Rodriguez
a085df44a5 Fix performance issue in PR 7327 (#7391)
* use references, skip batch remove if nothing to remove

* fix commitBatchEdit

* reword comment
2024-04-28 06:16:20 +02:00
Riccardo Vianello
15eaad4bea Allow reapplyMolBlockWedging() to restore the original wedging regardless the bond type (#7386)
* Allow reapplyMolBlockWedging to restore the original wedging regardless the bond type

* update python wrapper for Chirality::reapplyMolBlockWedging

* changes in response to review

* update the API documentation
2024-04-27 06:40:36 +02:00
Riccardo Vianello
24aba6904e Fix the Uncharger 'force' option w/ non-neutralizable negatively charged sites (#7382) 2024-04-24 09:19:27 +02:00
Greg Landrum
254817127c fixes bug with overly large count_bounds (#7368)
* fixes bug with overly large count_bounds

bug found and submitted by Andrew Dalke

* add another test
2024-04-23 07:34:04 +02:00
Greg Landrum
4f5d641e34 Fixes github 7331 (#7352)
* Fixes #7331

Essentially this modifies the code to use the isolobal analogy

Also improves error reporting a bit.

* generalize that a bit

* more testing
2024-04-19 10:17:02 +02:00
Greg Landrum
848b57f654 Revert "Support handling atropisomers without coordinates (#7301)" (#7370)
This reverts commit 2159594164.
2024-04-19 06:05:32 +02:00
tadhurst-cdd
2159594164 Support handling atropisomers without coordinates (#7301)
* removed string_view in favor of string for catch test

* add parsing and generation of atropisomers when coords not present

* changed string_view to string in catch test

* more docs

* reformulation of the docs

* make an error message a little bit more useful

* small optimization
clang-format

* add `BondWedgingParameters` to new function

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-04-19 04:38:27 +02:00
Paolo Tosco
2bb8952d7b Added JSON parameters to MinimalLib get_(cx)?sm(ile|art)s() functions (#7194)
* - renamed getParamsFromJSON() to updateSmilesWriteParamsFromJSON() and moved it from the anonymous namespace to the RDKit namespace such that it is publicly available
- implemented updateCXSmilesFieldsAndRestoreBondDirOptionFromJSON()
- added CFFI and JS tests
- get_smiles(), get_smarts(), get_cxsmiles() and get_cxsmarts() are now available in MinimalLib in both CFFI and JS layers and they can be passed JSON parameters
- CFFI get_qmol() now returns NULL if it fails to generate a RWMol rather than returning the "Error!" const char[] string, for consistency with what get_mol() and get_rxn() do. This was documented in release notes

* suggestions

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-04-18 06:28:36 +02:00
David Cosgrove
3d550bc1db Fixes problem from discussion 7317 (#7345)
* Extend double bond far enough.

* Oops.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2024-04-11 18:31:48 +02:00
David Cosgrove
29a166dff6 Add option for RASCAL to restrict atom matching to atoms of same degree (#7344)
* Add exactConnectionsMatch option.

* Better python test.

* Better C++ test.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2024-04-11 16:20:38 +02:00
Ricardo Rodriguez
ba7deb89a0 Fixes #7346 (#7347)
* add a test

* fix issue
2024-04-11 16:16:47 +02:00