Commit Graph

5226 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
Gareth Jones
21df90304a Add getUIntVectProp to RDProps (#7507) 2024-06-23 07:01:07 +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
0edde326ac - Restore mol writing functions in the RDKFuncs module (#7544)
- Add a couple of tests to avoid similar regressions in the future

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-06-21 05:51:18 +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
Greg Landrum
18eb648d56 Expose the property pickle options to SWIG (#7448)
* support pickle params in SWIG wrappers
csharp tests need to be tested

* make that work with csharp too
2024-05-24 07:37:06 +02:00
Riccardo Vianello
b5041c3c51 Fix a python 3.12 compatibility issue (#7450) 2024-05-24 07:32:50 +02:00
Gareth Jones
930c7d6345 Handle query atoms and bonds in SWIG wrappers (#7431)
* Query atom information in swig

* Atom query swig wrapping working

* SWIG wrapper for queries

* Add match to QueryAtom and QueryBond

* CShart test

* Added Java test

* Replace var with type for Java test

* Apply suggestions from code review

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

* Update Code/JavaWrappers/Queries.i

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

* Apply suggestions from code review

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

* Get SWIG build working again

* Remove trailing whitespace from Queries.i

* Update Queries.i to use shared_ptr

* small simplification

* remove boost::make_iterator from ROMol.i

* further simplification

---------

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-05-23 07:18:49 +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
3457c1eb60 a couple of additional cleanups (#7432) 2024-05-13 06:07:45 +02:00
Anna Brünisholz
d315e246e1 Cleanup: Force field (#7406)
* fix unsigned int to int comparison

* revert previous mistake

* declaration & init together, sinthetaSq in [0, 1]

* using std::swap

* use that sinThetaSq in [0,1]

* declare & init at same time

* use knowledge about target range

* use std::clamp

* use std::max

* numerically more stable trigonometrics

* numerically more stable trigonometrics

* numerically more stable trigonometrics

* range based for-loop

* actually do the assignement

* Update Code/ForceField/MMFF/Params.h

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

* implemented suggested changes

* Revert "implemented suggested changes"

This reverts commit f56e8f0ab2.

* auto typing

* remove old comment

* revert to numerically more stable expression

* now correctly formatted

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-05-10 13:22:15 +02:00
Syed Zayyan Masud
c2369f9041 Update MinimalLib for Function Exposure: runReactants (#7210) 2024-05-09 19:30:49 +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
Gareth Jones
7ec4661f84 C sharp rascal mcs wrapper (#7390)
* Added Wrapper Files

* Addd interface file

* Edited interface file

* Rascal SWIG wrapper finished

* Remove from Java wrapper

* add java wrappers too

* Update GraphMolCSharp.i

* Update Code/JavaWrappers/RascalMCES.i

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

* Update Code/JavaWrappers/RascalMCES.i

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

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2024-05-05 05:52:24 +02: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
Riccardo Vianello
38162c222b extend mol_to_smiles mol_to_cxsmiles to support optional non-isomeric output (#7395) 2024-04-29 09:24:43 +02:00
Michael Cho
08e4ffe82d Include header for boost::numeric_cast (#7389)
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-04-28 06:19:42 +02:00
Christoph Berg
779a9e54b2 Code/PgSQL: Fix Pointer vs Datum (#6733)
PostgreSQL 16 got stricter wrt proper Pointer and Datum handling.
2024-04-28 06:17:55 +02:00