* 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>
* 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
* 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
* 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
* 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>
* 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>
* 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>
* 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.
* 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
* 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>
* 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>
* 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>
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.
* 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>
* 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>
* 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
* 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
* fix a logic error in one of the chiral volume tests
* check the magnitude of the chiral volume in the atropisomer tests
* make the espression more readable
---------
Co-authored-by: ptosco <paolo.tosco@novartis.com>
* change valence model to use isolobal analogy
Remove support for five-coordinate C+ and, by analogy, five-coordinate N+2
Removes support for charge states that take atoms past the end of the periodic table
i.e. [Lv-4] is no longer supported
* update the tests for that
* remove valence state of 6 for Al
* fix representation of phosphate in the mol2 parser
this is a correction of what was done during #5973
* cleanup the exceptions for P, S, As, and Se
* drop valence states:
Si 6, P 7, As 7
* a couple of additional changes from #7397
* update java tests
* fix an inconsistency: Rb now supports valence -1
* documentation
* - replace operator[] with at() for bounds check
- extract some code into a function to avoid duplication
- use TAB as separator throughout in the periodic table data for consistency
* removing the .at() usage
We know that these vectors aren't empty, so there's no need for the bounds check.
---------
Co-authored-by: ptosco <paolo.tosco@novartis.com>
* Fix bug where different atom orders gave different MCES sizes.
* Update function description.
---------
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
* 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>
- 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>
* - 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>
* 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
* 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
* 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