Commit Graph

4035 Commits

Author SHA1 Message Date
Ricardo Rodriguez
ba7deb89a0 Fixes #7346 (#7347)
* add a test

* fix issue
2024-04-11 16:16:47 +02:00
Greg Landrum
9367e207d5 remove some warnings with -Wextra (#7339) 2024-04-11 11:01:59 +02:00
Yakov Pechersky
c25abde7cf Include macrocycles in atropisomer calculation by not sanitizing them away (#7291)
* Include macrocycles in atropisomer calculation

Previously, atropisomeric bonds were sanitized away if they were part of a "ring bond", which happens in macrocyclic systems.
None of the existing test cases fail if that sanitization check is removed.
The sanitization step is removed to support biaryls that are part of a larger macrocyclic system.
A set of test cases is included that cover potential macrocyclic atropisomeric systems

* Remove unmentioned files

* Keep ring check, and narrow it to when bond is in as many rings as atoms

* exclude atropisomer bonds if in rings < 8 atoms

Co-authored-by: tadhurst-cdd <112502803+tadhurst-cdd@users.noreply.github.com>

* Clarify macrocycle behavior in RDKit book

* fix typo

---------

Co-authored-by: tadhurst-cdd <112502803+tadhurst-cdd@users.noreply.github.com>
2024-04-09 06:05:25 +02:00
Riccardo Vianello
0979a9c391 fix 1,3- 1,5- conjugated cation normalizer transforms (#7330)
* fix 1,3- 1,5- conjugated cation normalizer transforms

* small refactoring

* add some test cases related to the normalization of conjugated cations
2024-04-09 06:00:32 +02:00
Anna Brünisholz
82dbf4c66b switch to range-based for loops (#7278)
* switch to range-based for loops

* Update Code/GraphMol/testChirality.cpp

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

* fix a leak in the new DCLV code (#7279)

* fixes #7295 (#7303)

* tag 2024.03 release (#7308)

* tag release

* attempt to solve constant MD5 problems

* switch to getting the ComicNeue font from github instead of as a zip

* open new release cycle (#7314)

* restrict the application of 1,3- 1,5- conjugated cation normalization (#7287)

* propagate yaehmop build status (#7316)

* Fixes #7299 (#7304)

* clean up of python and c++ for-loops

* clang formatted testChirality

* fix test file

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
Co-authored-by: Riccardo Vianello <riccardo.vianello@gmail.com>
2024-04-08 14:16:27 +02:00
Ricardo Rodriguez
9e1dbd2f33 Fixes #7327 (#7328)
* add tests

* fix
2024-04-08 06:12:56 +02:00
Riccardo Vianello
722cbba894 cleanup RDKit::MolOps::detectBondStereochemistry (#7329) 2024-04-04 19:28:32 +02:00
tadhurst-cdd
7412566a27 Wedge bond from atrop error (#7321)
* changed string_view to string in catch test

* fix bug in atrop wedge determination

* reverted changes from string_view to string
2024-04-03 15:35:42 +02:00
Ricardo Rodriguez
73e91a6344 Fixes #7318 (#7319)
* fix hybridization for atoms with outgoing dative bonds

* expose and wrap C++ numPiElectrons

* deprecate AtomPairs.Utils.NumPiElectrons

* add & update tests

* fix draw2d test

* update expected hash

* add hybridization test

* move numPiElectrons to Atom.h

* take reference instead of ptr
2024-04-03 15:34:37 +02:00
Matt Swain
aec4a2a868 Remove misleading walrus operators (#7323) 2024-04-03 06:41:35 +02:00
Greg Landrum
0c9b8d7ff3 Fixes #7299 (#7304) 2024-04-02 05:13:00 +02:00
Riccardo Vianello
35ac4accd9 restrict the application of 1,3- 1,5- conjugated cation normalization (#7287) 2024-04-01 06:38:38 +02:00
Greg Landrum
ba0b6f3baf tag 2024.03 release (#7308)
* tag release

* attempt to solve constant MD5 problems

* switch to getting the ComicNeue font from github instead of as a zip
2024-03-28 19:59:56 +01:00
Greg Landrum
0a0b158633 fixes #7295 (#7303) 2024-03-28 04:46:33 +01:00
Greg Landrum
eebad845f5 fix a leak in the new DCLV code (#7279) 2024-03-21 12:56:41 +01:00
Rachael Pirie
58023dd3b8 Add Double Cubic Lattice Volume (DCLV). (#7234)
* Add Double Cubic Lattice Volume (DCLV).

Method to compute the solvent accessible surface area and volume, van der Waals volume, compactness and packing density of a protein. Implemented from:  Frank Eisenhaber, Philip Lijnzaad, Patrick Argos, Chris Sander and Michael Scharf, "The Double Cubic Lattice Method: Efficient Approaches to Numerical Integration of Surface Area and Volume and to Dot Surface Contouring of Molecular Assemblies", Journal of Computational Chemistry, Vol. 16, No. 3, pp. 273-284, 1995.

* refactor

* DCLV is no longer a configuration option

* add to the docs

* standalone test has been removed

* reduce use of pointers as args

* DCLV to catch_tests

* update python wrapper

* add copyright statements

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-03-20 13:35:54 +01:00
Paolo Tosco
f5431728db make sure outdated ring fusion information is recomputed before attempting to use it (#7274)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-03-20 09:37:10 +01:00
Brian Kelley
693796d7af Enhance molzip to properly handle RGroupDecompositions (#7202)
* Fix zipping of rgroup decomps with broken rings

* Add utility to molzip rgroup rows

* Add RGroupRow molzip

* Fix typo in example and test

* Fix warning on integer size

* Don't use ssize_t

* a couple of suggestions

* Update Code/GraphMol/ChemTransforms/MolFragmenter.cpp

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

* Update Code/GraphMol/ChemTransforms/MolFragmenter.cpp

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

* Move molzip rgroup row from RGroupDecomp to ChemTransforms

* Fix exports

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-03-19 17:02:45 +01:00
Greg Landrum
81af0dbd63 add option to symmetrize conjugated terminal groups when RMS pruning conformers (#7270)
* expose symmetrizeTerminalAtoms() to the public API

* support symmetrizing terminal groups in RMS pruning in confgen

* add that to the python wrapper

* add backwards compatibility note

* allow JSON config of the new option
2024-03-19 04:38:29 +01:00
Greg Landrum
9bb5e4834f Support zero order bonds in V3K CTABs (#7269) 2024-03-18 18:45:08 +01:00
Greg Landrum
a6f0493fdd add HetAtomProtomerv2 (#7253) 2024-03-17 10:58:47 +01:00
Greg Landrum
6664dd7fe4 Some modernization of core GraphMol classes (#7228)
* simple modernization

* more

* done with RWMol for this pass

* the ROMol.cpp variant

* Atom

* minor change to bond

* simplify Conformer

* monomerinfo, queryatom, querybond

queryatom and querybond cpp files still need to be done

* typos

* revert a dumb change

* suggestion from review
2024-03-17 06:04:04 +01:00
Greg Landrum
b1890ccf2b remove a bunch of std::endls (#7233) 2024-03-17 06:03:37 +01:00
PatrickPenner
aaa06faa0f Custom decimal precision (#7229)
* MolToMolBlock V3000 double precision coordinates

- Added MolWriteParams
- Added python interfaces with MolWriteParams
- Added double precision test

* Added params interface for file writing functions

* First comments

- read precision from stream and reset
- MolWriteParams renamed to MolWriterParams

* MolToMrv and MolToXYZ precision interface extension

- extend the mol to marvin and mol to XYZ functions with coordinate precision
- propogate to python interface
- harmonized documentation occasionally

* Implement review
2024-03-17 06:03:03 +01:00
Ric
e94baa184c Fixes #7259 (#7260)
* insert line breaks in stereo groups

* Add a test

* simplify the approach

* fix test issue

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-03-16 15:19:44 +01:00
Ric
5063bc1477 Fixes #7246 (#7247)
* add a test

* fix parsing empty sgroup fields
2024-03-16 07:37:16 +01:00
Ric
3187496d59 make _NonExplicit3DChirality a public property (#7258) 2024-03-16 06:25:22 +01:00
Ric
5c73d27f84 Fixes #7256 (#7257)
* add a test

* allow 0 as a value in M RAD lines
2024-03-16 06:24:10 +01:00
Rachel Walker
94c902ba54 Postpone clearing computed properties until after all Hs removed (#7241) 2024-03-16 06:14:24 +01:00
Greg Landrum
3cff4d08af fix a problem with tautomeric systems being extended too far (#7200)
* fix a problem with tautomeric systems being extended too far

* add backwards incompatibility note
2024-03-15 16:42:22 +01:00
Ric
e86c4e1fe1 speed up cleanMolStereo (#7244) 2024-03-14 04:52:43 +01:00
Greg Landrum
6f3275f927 Fixes #7181 (#7206)
* Fixes #7181

adds a new constrainedAtoms member to the etkdgdetails structure which is used to propagate info about the coordMap into the ETK minimizations

* Update Code/DistGeom/DistGeomUtils.cpp

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

* Update Code/DistGeom/DistGeomUtils.cpp

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

---------

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2024-03-12 04:47:22 +01:00
Greg Landrum
029b1e3789 Fixes #7162 (#7220) 2024-03-09 15:40:51 -05:00
Ric
38154cc6e2 add moveTo to v1suppliers (#7222) 2024-03-09 05:11:26 +01:00
Riccardo Vianello
84f8186954 Fix Uncharger applying to already neutralized perhalic groups (#7211) 2024-03-07 07:57:24 +01:00
Greg Landrum
e7084bb400 Do not wedge bonds to attachment points (#7212)
* make sure added attachment points have valences set

* do not wedge bonds to attachment points if at all possible
2024-03-05 21:13:26 +01:00
Brian Kelley
499700ff1d optimize batch operations when editing molecules (#7145)
* Add private functions for batch removal of atoms/bonds

* Reset the unique_ptr not the bitvector

* Remove unused variable

* Forgot to reset stero atoms

* Remove unecessary post batch edit check

* Set min_idx to the number of bonds, this makes it a sentinel

* Don't need rdcast

* Responses to review

* Removed unused variable

* Add missing braces

* Consolidate bond removal loops

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2024-03-05 16:03:34 +01:00
Greg Landrum
6981cb0a39 allow perception of stereo from T-shaped structures (#7183)
* allow perception of stereo from T-shaped structures

* document that in the release notes
2024-03-05 15:59:11 +01:00
Paolo Tosco
6c966b4fe5 RGD code cleanup (#7186)
* RGD code cleanup
- made an effort to give more meaningful names to variables (e.g., renamed most instances of attachment (point) to avoid ambiguity as attachment may be interpreted as either the R-group atom or its neighbor atom on the core, which are two different things)
- replaced the old school removeAtom() method with begin/commitBatchEdit()
- added std::move and std::make_move_iterator where relevant to avoid potential unintended copying
- replaced instances of container.size() == 0 and !container.size() with container.empty() for better clarity
- replaced std::map::find() with std::map::at() where the key was not needed
- replaced expensive std::find_if with more efficient alternative
- added some missing const keywords and added references to avoid copying where appropriate
- replaced for loops with modern implicit looping alternatives where convenient
- avoid calling MolToSmiles when VERBOSE is not defined as the result is anyway not used
- removed "oops, exponential is a pain" code snippet as I believe 1. it is never executed 2. it is not tested 3. I do not think it is correct
- removed check for data->matches.size() > 1 as I do not believe it is correct
- Use std::unique_ptr::reset instead of defining a new std::unique_ptr and moving it to the original one

* changes in response to review

* change in response to review

* replaced std::set with boost::dynamic_bitset to save time on std::set::insert and std::set::find

* make sure we do not go out of bounds

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-03-03 05:34:13 +01:00
Greg Landrum
3a27ca2910 V2 API for the MolSuppliers (#7168)
* backup

* backup

* backup

* new testing file

* reorder things in the SMILES and SMARTS parser
parameters to allow easier struct initialization

* add v2 of SmilesMolSupplier

v1 is not yet there

* add TDTMolSupplier

add some very basic tests for v1 suppliers

* more progress

* all tests passing

I think all the suppliers are now moved over

* check for maeparser before building the tests

* get SWIG builds working

* changes in response to review
2024-02-29 06:46:56 +01:00
Greg Landrum
01ec60a856 Fixes #7078 (#7155)
* add MolOps::expandAttachmentPoints, along with tests

* support expandAttachmentPoints in the mol file parser

* switch the v2 stuff in the guts of the reaction parser

* add collapseAttachmentPoints()
add addAsQueries option to expandAttachmentPoints()

lots of testing

* an edge case and some cleanup

* add python wrapper for those two functions

* Update Code/GraphMol/FileParsers/FileParsers.h

Co-authored-by: Ric <ricrogz@users.noreply.github.com>

* changes in response to review

- support addCoords in expandAttachmentPoints()
- support the new attachment point stuff to/from CXSMILES
- add MolOps::details::addExplicitAttachmentPoint() and MolOps::details::isAttachmentPoint() utility functions

---------

Co-authored-by: Ric <ricrogz@users.noreply.github.com>
2024-02-28 17:05:53 +01:00
Greg Landrum
8b8ae1561d Improve output of debugMol (#7172)
* better bond output with debugMol

* update atom output

* fix typo in the StereoGroup output
2024-02-25 17:46:21 +01:00
Théophile Gaudin
0c445f41e9 Adding missing headers in ReactionParser.h (#7163)
* Adding missing include

* Removing ROMol.h in favor of a forward declaration as per requested.

---------

Co-authored-by: Theophile Gaudin <tgaudin@exscientia.co.uk>
2024-02-24 06:45:17 +01:00
Greg Landrum
b2606f5c20 fix a problem with reading older pickles (#7180) 2024-02-22 14:03:45 +01:00
Paolo Tosco
a4c9ef9e56 Fix #7157 (#7166)
* - 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>
2024-02-22 13:31:30 +01:00
Ric
ae4a7dbf1f Fixes #7064 (#7141)
* insert stereogroups

* insert Substance Groups

* fix ownership, bond indexes

* add test

* fix comparison signednedss

* update test

* Brian's suggestion

* allow more than one ABS group
2024-02-22 06:46:39 +01:00
Ric
34a2203db0 fix leaks and add a test (#7178) 2024-02-22 06:44:55 +01:00
Greg Landrum
716b38a2d8 Fixes #7140 (#7150)
* Fixes #7140

deprecates the old version and creates a new one in Chirality.h
adds it to the python wrappers

* changes in response to review

* backup

* support custom labels with templates
2024-02-12 15:50:02 +01:00
David Lounsbrough
4b78547bf9 fixing issue 5890 (#7152) 2024-02-09 13:24:59 +01:00
Greg Landrum
09aa009f19 [v2 API] reaction parsers (#7138)
* basic approach to v2api

* does not work, backup commit

* well, that now compiles

* cleaner

* more cleanup and testing

* get the SWIG wrappers to build

* swig wrappers now build

* switch back to using references to default values

* adjust to new catch version

* move the implementation to v2 and call it from v1

* update the parameter object too

* move debugParse down

* a couple of review changes

* make v2 naming consistent with Python

* first pass at v2 for the ctab parsers

* move a the writing functionality to a different header

this is just an organizational thing at the moment; we still import the writers header in the parsers header so as to not break code

* do v2 of the tpl parser

* fix missing dependency

* Mol2 parser

* move over the XYZ parser

* switch over the PDB parsers too

* get mac and java builds working (hopefully)

* add v2 API for the reaction parsers

Fixes #7075

* v2 of the fileparser API about done

This cannot be completed until the CDXML changes are merged
2024-02-07 17:41:01 +01:00