Commit Graph

5282 Commits

Author SHA1 Message Date
David Cosgrove
df3403f767 Allow atom map numbers to be ignored when generating canonical SMILES (#7732)
* Add option to ignore atom map numbers when generating canonical SMILES.

* Remove blank line.

* Improve docs.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2024-08-23 17:15:31 +02:00
David Cosgrove
4c8b27717a Don't do the fancy merging of solid wedges and bond lines for triple … (#7738)
* Don't do the fancy merging of solid wedges and bond lines for triple bonds.

* Changes after review.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
2024-08-23 17:14:15 +02:00
Paolo Tosco
752e9e8182 JSMol, where the underlying RWMol is stored as a unique_ptr, is now complemented by JSMolShared, where the underlying RWMol is stored as ROMOL_SPTR; both classes inherit from JSMolBase (#7744)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-08-23 13:49:00 +02:00
Paolo Tosco
ac19430d1f Code cleanup, minor refactoring and typos (#7742)
* - code cleanup, minor refactoring and typos

* changes in response to the review

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-08-23 12:48:50 +02:00
Paolo Tosco
6ad31c6e8a expose two additional boolean flags for mol creation to MinimalLib (CFFI, JS), assignChiralTypesFromMolParity and makeDummiesQueries, both defaulting to false (#7743)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-08-23 05:13:34 +02:00
nmaeder
e1cd9f68c5 Reduce code duplication in ff (#7715)
* move distance constraint to forcefield

* move position and torsion constraint to force field, also remove some unused includes

* sorting includes

* add missing files
2024-08-22 05:54:35 +02:00
nmaeder
168b111fe3 Ensure 13 bounds constraints are added to angles that are part of an improper torsion (#7729)
* make sure 13 bounds constraints are added to angles that are part of an impropper torsion

* make sure angles are constrained with higher force constant to prevent rings from folding

* adapt tests to new behavior

* move comment to correct place

* add min bounds test

* make sure we are not terribly outside of the bounds matrix
2024-08-21 16:06:29 +02:00
nmaeder
a45d4d9857 New contribs for DG (#7711)
* add angles and distances

* add Inversions

* add torsiona angle contribs

* use new contribs in test

* use new inversion and torsion contribs in dg

* use new distance contribs in dg

* use new angle constraints in dg

* use new constraints in FF tests

* update docstrings

* remove unused import

* include new contribs

* cleanup includes

* make changes requested by @greglandrum

* use std::move instead of release
2024-08-21 06:06:58 +02:00
Paolo Tosco
3568879dae restore the ability to build RDKit_minimal.js after #7700 (#7734)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-08-21 04:52:44 +02:00
Greg Landrum
67f507a15c Some cmake cleanup work (#7720)
* cmake modernization

- get rid of some warnings
- switch to what I hope is the correct way of doing things
- bump min cmake version to 3.16
- bump min boost version to 1.70

This builds on linux

* remove some usages of PYTHON_EXECUTABLE

* remove old-school python usage from coverage tests

* remove unused CI file

* bump boost version for windows builds to 1.84

* still trying to get the ci builds working

* typo

* eventually the CI will work

* robustify some tests
2024-08-16 17:11:31 +02:00
Eisuke Kawashima
b340eb9bb9 doc: fix -Wdocumentation-html (#7721)
#7525

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-08-16 08:12:42 +02:00
Riccardo Vianello
62e3b985e9 fix RDKitEquals strategy of gmol_consistent and greaction_consistent (#7695) 2024-08-13 15:39:06 +02:00
Riccardo Vianello
add896f578 refactor MolStandardize::PipelineOptions::allowEmptyMolecules (#7699) 2024-08-13 15:33:13 +02:00
Greg Landrum
b1663052b8 Remove Descriptors as a dependency of many other RDKit libraries (#7700)
* move mol weight and formula calculators to MolOps and refactor them a bit.
The descriptors are still there and should remain.

* remove other unnecessary dependencies on Descriptors

* Update adapter.cpp

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

---------

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2024-08-13 13:22:43 +02:00
Paolo Tosco
1bd39b2ad2 only test InChI functionality if it was built into JS MinimalLib (#7706)
Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-08-13 06:02:49 +02:00
Andrew Kane
5771d9c181 Add support for building the CFFI lib without InChI (#7698) 2024-08-10 21:16:58 +02:00
nmaeder
0be2c3a1b6 Make sure angleconstraints only take angles between 0 and 180 degrees. (#7688) 2024-08-10 06:32:25 +02:00
Brian Kelley
3d972a9e2f Removes call to debugMol that logs to std::err (#7690) 2024-08-06 15:41:56 +02:00
Greg Landrum
1790de84d3 Fixes #7675 (#7680)
* Fixes #7675

* update expected psql results
these changed because of the version bump to the pickles
2024-08-02 09:24:34 +02:00
Greg Landrum
86f197caac Fixes #7674 (#7681)
* Fixes $7674

* typo
2024-08-01 17:19:58 +02:00
Riccardo Vianello
3f7caf0147 Extend RDKit::MolStandardize with a validation and standardization Pipeline (#7582)
* Extend RDKit::MolStandardize with a validation and standardization Pipeline

* suggested changes

* apply clang-format

* apply yapf

* MolStandardize::FeaturesValidation optionally disallow dative bonds

* add allowDativeBondType to MolStandardize::PipelineOptions

* apply clang-format

* make the API of other validation classes more consistent with MolStandardize::FeaturesValidation

* apply clang-format

* PipelineStage to enum class
remove virtual functions from Pipeline class
be explicit about enums

* light refactoring to avoid what I think is an unnecessary call to `parse`

* a bit of modernization

* make the pipeline configurable

* make parse and serialize configurable too

* switch to storing pipeline stages using uints

* add a simple test for providing a pipeline

* update pointer alignment for clang-format

* test modifying the parser and serializer

* update swig requirement

* changes in response to review

* changes in response to review

* rename PipelineResult's *MolBlock members to *MolData

* upgrade swig to 4.2 in the CI environments

* add a few missing export directives

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-07-30 17:09:16 +02:00
Greg Landrum
138bdc8d58 Fix some missing headers when doing "make install" (#7667)
* remove unnecessary include

* add a couple of missing include files to rdkit_headers

* fix header destination
2024-07-25 11:07:03 -04:00
Greg Landrum
8e57151157 Fixes #6757 (#7664)
* assignStereochemistry() should call updatePropertyCache() if it is needed

* Fixes #6757

* update expectations in current tests

* add another test
2024-07-25 15:26:22 +02:00
nmaeder
3f3ff3858a Refactor distgeom minimizations (#7652)
* refactor skeleton

* fix contribs

* adapt documentation

* clarify function names

* make variable names more readable and update documentation

* switch boost dynamic bitset with std::vector<bool>

* clearer const name

* fix typo and go back to dynamic bitset

* go back to old function signature

* add inline overload with fewer arguments

* remove unecessary doc lines and add tol to distance directly in function call

* use constexpr for known distance force constant

* update documentation

* enhance documentation

* english

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

* make changes requested by @greglandrum

* make all constexprs

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-07-25 06:14:12 +02:00
Ricardo Rodriguez
bd49c8ae81 Fix parsing RBCNT from mol files, and add exporting it (#7638)
* write RBCNT

* Fix RBCNT allowed values

* add a test
2024-07-25 04:54:46 +02:00
Greg Landrum
9d26fc229d Fixes #7642 (#7643) 2024-07-25 04:48:00 +02:00
Greg Landrum
1b6b126d55 Fixes #7364 (#7657) 2024-07-24 12:51:57 -04:00
Greg Landrum
6f2cf3a16b fixes #7583 (#7644) 2024-07-24 14:35:46 +02:00
Greg Landrum
4f7a7d0523 Revert "Update rdkit_gist.c fixes #7493 (#7547)" (#7653)
This reverts commit 40d4c55a39.
2024-07-23 12:32:25 +02:00
Paolo Tosco
a0da0b16d4 - fix misformatted molblock and make sure unit test is actually executed (#7647)
- consolidate two neighboring if clauses into one

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-07-23 08:37:44 +02:00
Ernst-Georg Schmid
40d4c55a39 Update rdkit_gist.c fixes #7493 (#7547)
This fixes #7493, where way too much LEAF-nodes had to be re-checked for structure isomorphism.
2024-07-23 06:09:02 +02:00
David Cosgrove
80381c61fd Rascal atom and bond equivalences (#7612)
* C++ implementation of equivalent atoms via SMARTS.

* Python wrapper.

* Tidy.

* Check for too many classes.

* Better handling of spaces in split.

* Pass string by reference.  Doh.

* Add ignoreBondOrders option.
2024-07-23 06:02:33 +02:00
Riccardo Vianello
427a54291b Update commutator/negator settings for operator @= (#7596)
* Redefine @='s commutator and negator (fix #7459)

* "Fix" update script for postgres < 17

* bump version to 4.6.0
2024-07-23 06:01:56 +02:00
Eisuke Kawashima
4dc7dbe6e7 fix(rdmolfiles): fix parameters and docstrings (#7648)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-07-23 05:59:59 +02:00
Greg Landrum
a26ea07d21 Fixes #7556 (#7646)
* backup, does not work

* fix a copy-pasta typo

remove debugging messages

all tests pass here

* last bit of modernization
2024-07-22 16:34:08 +02:00
Greg Landrum
350a8bcd05 Fixes #7598 (#7604)
* add test

* Fixes #7598
2024-07-15 14:15:32 -04:00
Greg Landrum
2c5ae534f2 Optimizations of the DistanceGeometry forcefield (#7600)
* First try at using DistViolationContribs

only the most basic of testing has been done

also add ForceField::distance2 to allow some optimizations

* allow testing using old approach

* optimization

At this point testUFFForceFieldHelpers fails since the check for std::max_element
in the e_contribs vector at Embedder.cpp:513 is now doing something totally different
(instead of a bunch of small distance violation contribs, we have one big one).
We'll need to come up with something for this.

With the benchmarking set that I'm using - 500 DG conformers for ~465 COD molecules
using 10 threads - this runs in almost 10% less time than master.

* backup;
builds, tests do not pass

* all tests pass except the old failure

* more constification

* backup/debugging

* add fourthdim contribs the same way

* tests now pass

* deprecations

* remove unused vars and code

* changes in response to review
2024-07-15 14:14:39 -04:00
Brian Kelley
8f9cf80a04 Fix an out of bounds access in ForwardMolSupplier (#7607)
* Fix an out of bounds access

* Prefer .empty over .size for strings

* Add another check for empty tempStr

* Fixed two more empty tmpStrs

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2024-07-15 04:41:12 +02:00
Hussein Faara
cba05a9b3a Update CMake modules for finding flex and bison(#7590) (#7591)
* Update CMake modules for finding flex and bison(#7590)

This will improve the executable finding procedures and allow us to
require minimum release versions. The current modules have been around
for about 15 years, and currently limits us from using newer flex
features.

* remove modules
2024-07-10 05:56:07 +02:00
Franz Waibl
8bc2b5d025 Improve PDB formatting with incomplete Monomer info (#7286)
* Fix PDB formatting if residue name is set but atom name is not.

* additionally, sets the width of the atom name to 4. If the name is set
  to something shorter than 4 letters, fill up with whitespace. This
  avoids bad column alignment. If the name is set to something with more
  than 4 characters, the PDB will still be invalid.

* Add a test for missing residue name and short atom names

* Fix atom name alignment in unit test

* Small updates to PDB line formatting, add a unit test

* Truncate residue names to 3 letters, and atom names to 4
* Add a unit test to ensure that atom and residue names are truncated.
* Switch from std::array<char, 2> to std::string for the atom number.
* Use name.empty() instead of name.size() == 0

---------

Co-authored-by: Franz Waibl <waiblfranz@gmail.com>
2024-07-10 04:43:08 +02:00
Brian Kelley
b44478d04b Don't register FilterMatcherBase twice (#7589)
* Don't register FilterMatcherBase twice

* Delete commented out line

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2024-07-09 16:02:00 +02:00
nmaeder
6675315b85 Fix/kminimization (#7535)
* first try

* do over with @greglandrum: fix atomPairs, lower SP angle force constant.

* change test file for 'update parameters from JSON':'ETKDGv2'

* adapt length to fix

* remove overwritten random seed

* adapt test files to changes

* adapt amide test, check with Greg

* fix python tests and remove unused imports

* proposal for new test molecule

* remove double comparison, increase threshold. Check with greg

* remove TODO comments

* remove debugging statements

* same code for both since they are doing the same

* format docstring to make more readable

* remove todo comments

* add indentation to angle param

* adapt doctest to newly generated conformers

* fix test to pass with fewer failures and move mol to mol file for less cluttered test.

* a bit of modernization

* remove cerrs and format correcly

* reverted test to old behavior

* use insert and make force field contribs exception safe

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-07-08 15:29:45 +02:00
Anna Brünisholz
d96bf3712c Geometry (#7433)
* fix unsigned int to int comparison

* revert previous mistake

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

* range based for-loops

* switch-statements

* declaration position changed

* declaration position changed

* declaration position changed

* declaration position changed, switch statements

* declaration position changed

* declaration position changed

* change in if statement

* now with const iterators

* declaration at initialization

* convert to static casts

* use switch when possible, no breaks

* Update Code/Geometry/point.h

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

* change from review

remove redundant PRECONDITION

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-07-08 15:29:14 +02:00
Dan Nealschneider
db0e71bc1c Speed up GetPropsAsDict(), especially on mac (#7584)
I noticed that we have some workflows for which
GetPropsAsDict() is a bottleneck. This function _should be_ pretty
fast, but exception stack unwinding is pretty slow, especially
on Mac. I'd expect conversion to int or double to _often_ fail
for properties with "string" type tag.

I created a molecule with 100 string properties and called
GetPropsAsDict() 3000 times.

On my M3 macbook pro...

Before this change: 100s
After this change:  0.12s

So, a 1000x speedup! That won't translate to a 1000x speedup
in the workflows I was looking up, but it definitely will change
the rate-limiting step.
2024-07-04 12:20:23 -04:00
David Cosgrove
58d7254c1d Add atom map number to complex query atom symbol. (#7571)
* Add atom map number to complex query atom symbol.

* Changes after review.
2024-07-04 06:45:19 +02:00
Greg Landrum
08c964075a Fixes #7306 (#7510)
* Fixes #7306

Do not cross bonds which were previously aromatic

* revert one of the test changes

* change in response to review

---------

Co-authored-by: Riccardo Vianello <riccardo.vianello@gmail.com>
2024-07-01 05:00:24 +02:00
Paolo Tosco
14ccb65731 Add missing GetRow method and fix Python parameter names (#7575)
* add missing GetRow method and fix Python parameter names

* - return type of getRow() should be unsigned int, not double, since atomicData.Row() returns unsigned int
- added missing overloads

* fix compilation error in test

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-06-28 12:47:34 +02:00
Greg Landrum
ad3e570dea add findMesoCenters (#7574)
* add option to use chiral presence in atom ranking

* add findMesoCenters

* add includeChiralPresence to python wrapper

* add python wrapper for that

* backup, not working

* backup

* all tests pass

* add tests for partial coverage of stereo groups

all tests pass

* backout the cleanup operations for the initial merge

* track the meso atoms with atom properties.

this is an optimization for later.

* changes in response to review
2024-06-28 04:55:49 +02:00
Greg Landrum
a3b2e50ad3 A collection of small improvements from Roger S (#7566)
* get builds working on cygwin

contribution from Roger Sayle

* rearrange memory layout of bond object

This reduces the memory used by 7 bytes/bond,
but due to the padding there's no visible difference.

Contribution from Roger Sayle

* Simplify the smiles lexer so that io.h is no longer needed.


Contribution from Roger Sayle

* make an analogous change to the SMARTS parser
2024-06-26 08:29:57 +02:00
Greg Landrum
df0224fb7d Fixes #7552 (#7564)
* Fixes #7552

* Change in response to review

* suppress a warning
2024-06-26 04:42:33 +02:00