Commit Graph

14 Commits

Author SHA1 Message Date
Greg Landrum
21d694e88a fix a problem with stereogroups involving bonds and getMolFrags() (#8558)
This is a continuation of #8542
2025-05-27 16:43:20 +02:00
paconius
1147bcbc6d Fixes #8527 (#8542)
* Add getMolFrags test

confirm bond-only stereogroups are preserved during fragmenation

* Update molopstest.cpp

* Prevent deletion of stereogroups

Prevent removeAtomFromGroups from deleting stereogroups that have bonds but no atoms
2025-05-25 14:58:48 +02:00
Greg Landrum
5e58f20433 improve operator<< for stereogroups (#8489) 2025-05-01 16:43:33 +02:00
Paolo Tosco
71c4103475 Suppress large amounts of 'BOOST_NO_CXX98_FUNCTION_BASE macro redefined' warnings in clang/emcc builds (#7747) 2025-03-29 20:04:58 +01:00
tadhurst-cdd
0de215a1f8 Fix canonicalization of stereogroups (#7041)
* atropisomer handling added

* fixed non-used variables,  linking directives

* BOOST LIB start/stop fixes, linking fix

* Fixes for RDKIT CI errors

* minimalLib fix

* changed vector<enum> for java builds

* check for extra chars in CIP labeling

* removed wrong deprecated message

* fix ostrstream output error?

* restored _ChiralAtomRank to lowercase first letter

* changes for merged master

* Fixed catch label for new Catch package

* update expected psql results

* get swig wrappers building

* restore MolFileStereochem to FileParsers

* fix java wrapper for reapplyMolBlockWedging

* test changes

* some suggestions

* move a couple functions out of Bond

* Merge branch 'master' into pr/atropisomers2

* merged master

* Renamed setStereoanyFromSquiggleBond

* atropisomers in cdxml, rationalize atrop wedging, stereoGroups in drawMol

* Merge branch 'master' into pr/specialQueries

* changes from previous PR

* Iclude false chiral

* rigorous enhnced stereo canoncalization

* Added more tests and clenup

* removed commented out code

* corrected init of SmilesWriteParams

* added MolFileStereoChem.h to the header files

* Renamed Rxn parser to MrvBlockToChemicalReaction

* To make catch2 work, and match the checksum

* Fixed Structchecker errors

* fix CI for DetermineBonds catch test

* error in catch_test for CI

* Allow custom  smileWriteParams  in GetMolLayers

* misnamed entry point

* ReactionFromMrvString change name

* remove adding writeParams to GetMolLayers

* make rigorous enhanced stereo the default, and fix tests

* only one abs group no longer needs Rigorous Enhanced treatment

* changed string_view to string in catch test

* Canonicalize Enhnaced Stereo only resturne unique smiles

* Now allows or and and groups together

* internal routines inside detail scope

* fix test error

* changed string back to string_view and fixed a CHECK

* Fixes for PR review tests

* Fix RDKit_Book.rst failure on build test

* fix xqm sql test

* updated expected files for cxsmiles_test

* Fixed removal of atom attrs

* Fixed tests after merge of master

* More efficient version of Stereo Groups Canonicalization

* Fixes for ctests

* removed debug code

* readded cipLabel test

* fix generalizedSubstruct/catch_tests.cpp error

* hueristics to improve speed

* Rationaized control of abs groups

* removed unused routine

* added rigorous stereo group treatment to test

* some suggested changes

* Changes per PR review and removed some changes to smiles

* Fixed CI errors

* changes per PR review

* more PR review vhanges and cleanup

* Fixed PSql PKL change

* changes as per PR review

* Restored error type for bad mols for canonicalizeStereoGroups and added a test

* Merge master and fix test in MolDraw2D

* Fix for randomize test error and other PR review comments

* Removed unsued variable to fix mac CI

* do not force aromatization in canonicalizeStereoGroups

* changes as per PR review

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-10-11 17:09:18 +02: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
tadhurst-cdd
eb2606d617 fragmentation of mol loses any sgroups (#7056)
* fragmentatin of mol loses any sgroups

* removed unneeded test

* Fixes #7071

* simplification. tests do not pass

* Changed test for sgroup retention as per PR review

* Fix testing errors

* attempt to get CI windows to build

* removed files incorrectly committed, and removed code no longer needed

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-01-25 13:32:55 +01:00
tadhurst-cdd
d5d4d194ec atropisomer handling added (#6903)
* atropisomer handling added

* fixed non-used variables,  linking directives

* BOOST LIB start/stop fixes, linking fix

* Fixes for RDKIT CI errors

* minimalLib fix

* changed vector<enum> for java builds

* check for extra chars in CIP labeling

* removed wrong deprecated message

* fix ostrstream output error?

* restored _ChiralAtomRank to lowercase first letter

* changes for merged master

* Fixed catch label for new Catch package

* update expected psql results

* get swig wrappers building

* restore MolFileStereochem to FileParsers

* fix java wrapper for reapplyMolBlockWedging

* some suggestions

* move a couple functions out of Bond

* Merge branch 'master' into pr/atropisomers2

* merged master

* Renamed setStereoanyFromSquiggleBond

* atropisomers in cdxml, rationalize atrop wedging, stereoGroups in drawMol

* fix for CI build

* attempt to fix java build in CI

* attempt to fix java build in CI #2

* New routine to remove non-explicit  3D-geneated chirality

* changed to use pair for atrop atoms and related bonds

* Changes as per PR reviews

* PR review respnses

* PR review reponse - more

* Fix merge from master

* fixing java ci after merge

* Updated the help doc for atripisomers

* update the atropisomer docs

* improve the images

* add the source CXSMILES

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-12-22 04:58:18 +01:00
Ric
d033aee043 Optionally forward Enhanced Stereo Group ids (#6560)
* add id members to StereoGroup class

* add optional read id argument to StereoGroup constructors

* add functions forward Stereo Group Ids and assign the missing ones

* update ops updating stereogroups to forward read id

* update CX Smiles to parse/write stereogroup ids

* Add test cases for stereo group id forwarding/canonicalization

* update mol block (V3K only) to parse/write stereogroup ids

* update pickling to parse/write stereogroup ids

* update cdxml parser to store stereogroup ids

* update mol interchange to parse/write stereogroup ids

* update draw code with new stere group ids

* update test

* add some tests

* Update Code/GraphMol/Wrap/rdmolfiles.cpp

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

* Update Code/GraphMol/Wrap/rdmolfiles.cpp

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

* Update Code/GraphMol/Canon.cpp

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

* Update Code/GraphMol/SmilesParse/CXSmilesOps.cpp

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

* review

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2023-07-27 18:53:40 +02:00
Ric
a19566c2c8 add info to debug (#5526) 2022-09-06 13:03:08 +02:00
Greg Landrum
c99da95be0 lambda cleanup (#4432) 2021-08-24 10:29:31 -04:00
Greg Landrum
d41752d558 run clang-tidy with readability-braces-around-statements (#2899)
* run clang-tidy with readability-braces-around-statements
clang-format the results
clean up all the parts that clang-tidy-8 broke

* fix problem on windows
2020-01-25 14:19:32 +01:00
Dan N
378a223d66 Python wrap enhanced stereo setters (#2509)
* Allow creation of Enhanced Stereo groups from Python

This wraps creation of Enhanced Stereo groups from Python. It
also allows setting enhanced stereo groups on an RWMol from
Python.

Additionally, this provides a little function to allow C++
vectors to be wrapped for Python, but allow Python list objects
or wrapped C++ vectors to be used as arguments to functions
that take vectors as inputs. I added it only to
Wrap/StereoGroup.cpp, but I _think_ that I should add this
logic to RegisterVectorConverter in RDBoost/Wrap.h. If I
did that, I'd be able to remove a couple of lines in Wrap/Mol.cpp

* enforce atom ownership in SGroups
Some cleanups to make sure you can't add an S group with bogus atoms
to a molecule

* Remove constructor for StereoGroup.

I tried very hard to convince boost Python to allow me to use
with_custodian_and_ward_postcall on an init, and it just never
worked. I've removed the constructor - folks will need to
use the factory function "CreateStereoGroup" if they want
a StereoGroup.
2019-07-03 10:24:26 +02:00
Dan N
eaa44b40c2 Enhanced stereo read/write support in SDF files. (#2022)
* add a couple test files

* backup

* first pass at some theory documentatin

* it's a draft

* Update enhanced stereochemistry documentation

Adds initial target use case and caveats about the tentative
nature of the current implementation.

* Support read/write of molfile enhanced stereochemistry

This includes reading and writing of enhanced stereochemistry
from v3000 molfiles (sdf). Enhanced stereochemistry encodes
the relative configuration of stereocenters, allowing
representation of racemic mixtures and compounds with
unknown absolute stereochemistry.

It does not include:
* Python wrapping
* invalidation of the enhanced stereochemistry
* use of enhanced stereochemistry in search
* depiction of enhanced stereochemistry.

* Update to reflect changes from #1971

* change names of enum elements to allow compilation in VS2017

I think it's also clearer to do things this way

* Addressed most review comments.

* Run missed test "testEnhancedStereoChemistry"
* In tests, added size checks to group equality checks
* Updated copyright statements
* Deleted mol created for a test
* Use perfect forwarding in RWMol::setStereoGroups()
* use references for stereo groups that are checked in write and pickle
* Updated stereogroup.h in hopes of fixing compilation on Windows.
* clang-format

* try allowing a switch to boost regex and requiring it for g++-4.8

* do a better job of that

* typo

* Code review comments. Updated Copyright notice.

* When an atom is deleted, delete stereo groups containing it.

Also updates StereoGroup toUse accessors instead of
constant member attributes. This allows move of StereoGroups.

* RDKit style guide

* Add header required on Windows.

* get the SWIG wrappers to build
2018-09-26 15:44:23 +02:00