68 Commits

Author SHA1 Message Date
Greg Landrum
1dfc9b7a1b Fixes #9231: improve escaping values in CXSMILES (#9273)
* this is a fix, but it breaks other tests

* all tests pass.

This undoes the changes made as part of the "fix" for #5466

* update js tests

* response to review

---------

Co-authored-by: = <=>
2026-05-17 11:51:14 -04:00
Greg Landrum
251353a217 Ensure that StereoGroups don't have duplicate atoms or bonds (#9258)
* check for duplicate atoms/bonds in StereoGroups

* explicit handling of duplicate stereogroup atoms in CTAB and CXSMILES parsers

---------

Co-authored-by: = <=>
2026-04-29 16:54:00 +02:00
Eisuke Kawashima
e89c9f656a style: apply readability-braces-around-statements (#8136)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-02-09 12:10:50 +01:00
Ricardo Rodriguez
d3d4170e7c CXSMILES: do not add separators for unserializable Substance Groups (#9048)
* do not write extra separators

* add a test

* update tests

* Update Code/GraphMol/SmilesParse/CXSmilesOps.cpp

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2026-01-27 12:35:18 +01:00
Greg Landrum
c2e48f41d8 Stop writing so many atom properties to cxsmiles (#9002)
* fix a bug in copySelectedAtomsAndBonds()
we need to clear computed properties on the atoms here

* prune back the atom properties written to CXSMILES

* update minimallib tests
2025-12-13 04:35:57 +01:00
Chris Von Bargen
732a63356a Change extern types to static consts (#8765)
* When building RDKit as a static library, Ricardo found that the externs aren't
being resolved correctly causing a number of bad std::any casts. This is his
patch (which we apply in the context of the sketcher build) which moves the
definitions up from the types.cpp file, and make them static.

* Use inline keyword to avoid duplication overhead; this still allows the
use of the static keyword to resolve the issue with static libs
https://en.cppreference.com/w/cpp/language/inline.html

* static inline doesn't work in my static builds; inline only does though

* inline constexpr std::string_view

* casting

* inline-constexpr

* add string_view to python converter

* propagate string_view after static types

---------

Co-authored-by: Ric <ricrogz@gmail.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-11-07 05:15:22 +01:00
Brian Kelley
c4678568a9 Use adjustQueryProperties logic when dealing with dummy atoms in cxsmiles (#8907) 2025-11-01 05:38:17 +01:00
Ricardo Rodriguez
af4e8cf01f propagate string_view (#8858) 2025-10-14 19:15:37 +02:00
Ricardo Rodriguez
7b7a8a4e17 Refactor iostreams includes (#8846)
* refactor iostreams includes

* restore ostream to MonomerInfo.cpp
2025-10-08 16:08:01 +02:00
Greg Landrum
768a71a638 Fixes #8586 (#8604) 2025-07-13 21:28:45 +02:00
tadhurst-cdd
ca41fa5bfd Add SCSR parsing to RDKit (#8147)
* Parsing SCSR

* add scsrol to mol

* removed bad include file

* loosen distGeom test slightly

* add wrap test for SCSRMol

* Add test for scsr in python

* tests added for scsr and strict parsing removed

* remove extra stuff

* More fully specified use of SCSRMol for PR CI build

* Added flags for SCSR expansion to not include any leaving groups

* Added MolFromScsrParams to Wrap for python

* added SCSRMol destructor

* Added two tests for RNA macromols, and fixed a bug they revealed

* Added new tests abd expected files

* changes as per PR review

* SCSR Chnages for leaving groups

* fixed testScsr.py

* hydrogen bond treatment

* in SCSR expand, allow Hbond to be autoatically detected

* changes as per code review

* Adding new test file

* chages for SCSR contructors, destructors for CI build

* fixed pyton for SCSR hydrogen bond modes, and added tests

* Added new test files

* fixed edge case for SCSR

* fix checksum for inchi

* consistent capitalization of SCSR throughout

* switch to enum class

* make things shorter

* simplify

* get rid of the ATTCHORD class

* New section for SCSR in RDKit_book

* addeed section to RDKit_Book

* SCSRMol is no longer exposed in Python

* fix leak in MolFromSCSRFile()
light refactoring

* expose MolFromSCSRFile() to python
make the MolFromSCSR functions work with default args
a bit more testing

* removed C++ access to SCSRMol

* CXMsiles now ouputs hbonds, fix to template matching, and a few other things

* Addl fix for bad aromaticity in Hbond rings

* Test files needed

* Test files needed

* try to fix a CI build errors

* CI error fix

* Added missing test file

* CMake version - for CI build

* remove full file compoarison from macromol test file

* accidental change to debug restored to release

* Code review changes

* As per PR review

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-05-14 13:37:59 +02:00
Ricardo Rodriguez
15e0f784b7 Add a custom CXSMILES feature to indicate Zero Order Bonds (#8454)
* implement the ZOB CXSMILES feature

* restore release notes
2025-04-22 09:56:58 +02:00
Greg Landrum
5c1fa74495 Fixes github #8364 and #8365 (#8366)
* Fixes #8365

* Fixes #8364
2025-03-31 15:58:47 +02:00
thomp-j
4efc9a362b Vulnerability fixes (#8116)
* Vulnerability fixes

* Vulnerability fixes

* Move Iterator bounds check to a PRECONDITION for parse_data_sgroup_attr.

* Update MolFileParser.cpp

Remove ill-advised ASCII filter when parsing SDF V3000

* Update MolFileParser.cpp

Remove extra whitespace.

* Squashed commit of the following:

commit 1a1279c137afeca77d4fd68b287a7e36c6bf5c37
Merge: 7d0765c8b 3d2a43470
Author: James Thompson <thompj@google.com>
Date:   Wed Dec 18 14:22:29 2024 +0000

    Merge branch 'vuln_fix' of https://github.com/thomp-j/rdkit_vuln into vuln_fix

commit 7d0765c8ba2e0be54649613fce2f61545ad5d9d2
Author: James Thompson <thompj@google.com>
Date:   Wed Dec 18 14:20:54 2024 +0000

    Squashed commit of the following:

    commit 5a5902a874109d42cc4a20de535bdca0855c429b
    Merge: ec0ff4ee2 3d2a43470
    Author: James Thompson <thompj@google.com>
    Date:   Wed Dec 18 14:18:02 2024 +0000

        Remove whitespace

    commit 3d2a43470f
    Author: thomp-j <58603847+thomp-j@users.noreply.github.com>
    Date:   Wed Dec 18 09:08:57 2024 -0500

        Update MolFileParser.cpp

        Remove extra whitespace.

    commit a8a718923c
    Author: thomp-j <58603847+thomp-j@users.noreply.github.com>
    Date:   Wed Dec 18 09:08:09 2024 -0500

        Update MolFileParser.cpp

        Remove ill-advised ASCII filter when parsing SDF V3000

    commit 270136d6c0
    Author: thomp-j <58603847+thomp-j@users.noreply.github.com>
    Date:   Wed Dec 18 09:07:05 2024 -0500

        Move Iterator bounds check to a PRECONDITION for parse_data_sgroup_attr.

    commit ec0ff4ee29e9cca5bbd9591d30f8a96646484ec5
    Merge: ca4ed2faa 2d257b119
    Author: James Thompson <thompj@google.com>
    Date:   Wed Dec 18 14:04:30 2024 +0000

        Merge branch 'vuln_fix' of https://github.com/thomp-j/rdkit_vuln into vuln_fix

    commit ca4ed2faa4219abfd97628d529be3a1fd97048bf
    Merge: c11caffbd 63123278c
    Author: James Thompson <thompj@google.com>
    Date:   Wed Dec 18 13:59:48 2024 +0000

        Merge branch 'vuln_fix' of https://github.com/thomp-j/rdkit_vuln into vuln_fix

    commit 2d257b1194
    Merge: d45612334 74fc77f95
    Author: thomp-j <58603847+thomp-j@users.noreply.github.com>
    Date:   Wed Dec 18 09:03:06 2024 -0500

        Merge branch 'rdkit:master' into vuln_fix

    commit d456123344
    Merge: c11caffbd 63123278c
    Author: James Thompson <thompj@google.com>
    Date:   Wed Dec 18 13:59:48 2024 +0000

        Merge branch 'vuln_fix' of https://github.com/thomp-j/rdkit_vuln into vuln_fix

    commit c11caffbd7
    Author: James Thompson <thompj@google.com>
    Date:   Tue Dec 17 15:26:41 2024 +0000

        Vulnerability fixes

    commit 74fc77f959
    Author: Paolo Tosco <paolo.tosco.mail@gmail.com>
    Date:   Wed Dec 18 13:40:57 2024 +0100

        normalizeDepiction() should always center coordinates on the coordinate centroid, irrespective of the canonicalize parameter (#8107)

        * normalizeDepiction() should always center coordinates on the coordinate centroid, irrespective of the canonicalize parameter

        * Update Code/GraphMol/Depictor/catch_tests.cpp

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

        * fix catch test

        ---------

        Co-authored-by: ptosco <paolo.tosco@novartis.com>
        Co-authored-by: Greg Landrum <greg.landrum@gmail.com>

    commit e589f173fd
    Author: David Cosgrove <davidacosgroveaz@gmail.com>
    Date:   Wed Dec 18 04:14:11 2024 +0000

        Use endian-aware read/write for length of string. (#8105)

        * Use endian-aware read/write for length of string.

        * Re-run clang-format.

        ---------

        Co-authored-by: David Cosgrove <david@cozchemix.co.uk>

    commit ce35b3c25b
    Author: David Cosgrove <davidacosgroveaz@gmail.com>
    Date:   Wed Dec 18 04:12:07 2024 +0000

        SynthonSearch synth check (#8109)

        * Catch errors when creating products.

        * Extra python test.

        * Fix formatting.

        ---------

        Co-authored-by: David Cosgrove <david@cozchemix.co.uk>

    commit 63123278ca
    Author: James Thompson <thompj@google.com>
    Date:   Tue Dec 17 15:26:41 2024 +0000

        Vulnerability fixes

    commit e640915d4e
    Author: Nikitas Rontsis <nrontsis@gmail.com>
    Date:   Tue Dec 17 15:11:40 2024 +0000

        Avoid unnecessary matching (#8111)

    commit 5aed3d886b
    Author: Greg Landrum <greg.landrum@gmail.com>
    Date:   Mon Dec 16 16:59:13 2024 +0100

        Fixes #8096 (#8104)

        * add test

        * Fixes #8096

        * change in response to review

    commit 6dce5d4080
    Author: Greg Landrum <greg.landrum@gmail.com>
    Date:   Sun Dec 15 05:58:20 2024 +0100

        Fixes #1670 (#8093)

        * add missing descriptors to Lipinski.py
        Fixes #1670

        * add to descriptor list

commit 3d2a43470f
Author: thomp-j <58603847+thomp-j@users.noreply.github.com>
Date:   Wed Dec 18 09:08:57 2024 -0500

    Update MolFileParser.cpp

    Remove extra whitespace.

commit a8a718923c
Author: thomp-j <58603847+thomp-j@users.noreply.github.com>
Date:   Wed Dec 18 09:08:09 2024 -0500

    Update MolFileParser.cpp

    Remove ill-advised ASCII filter when parsing SDF V3000

commit 270136d6c0
Author: thomp-j <58603847+thomp-j@users.noreply.github.com>
Date:   Wed Dec 18 09:07:05 2024 -0500

    Move Iterator bounds check to a PRECONDITION for parse_data_sgroup_attr.

commit 2d257b1194
Merge: d45612334 74fc77f95
Author: thomp-j <58603847+thomp-j@users.noreply.github.com>
Date:   Wed Dec 18 09:03:06 2024 -0500

    Merge branch 'rdkit:master' into vuln_fix

commit d456123344
Merge: c11caffbd 63123278c
Author: James Thompson <thompj@google.com>
Date:   Wed Dec 18 13:59:48 2024 +0000

    Merge branch 'vuln_fix' of https://github.com/thomp-j/rdkit_vuln into vuln_fix

commit c11caffbd7
Author: James Thompson <thompj@google.com>
Date:   Tue Dec 17 15:26:41 2024 +0000

    Vulnerability fixes

commit 74fc77f959
Author: Paolo Tosco <paolo.tosco.mail@gmail.com>
Date:   Wed Dec 18 13:40:57 2024 +0100

    normalizeDepiction() should always center coordinates on the coordinate centroid, irrespective of the canonicalize parameter (#8107)

    * normalizeDepiction() should always center coordinates on the coordinate centroid, irrespective of the canonicalize parameter

    * Update Code/GraphMol/Depictor/catch_tests.cpp

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

    * fix catch test

    ---------

    Co-authored-by: ptosco <paolo.tosco@novartis.com>
    Co-authored-by: Greg Landrum <greg.landrum@gmail.com>

commit e589f173fd
Author: David Cosgrove <davidacosgroveaz@gmail.com>
Date:   Wed Dec 18 04:14:11 2024 +0000

    Use endian-aware read/write for length of string. (#8105)

    * Use endian-aware read/write for length of string.

    * Re-run clang-format.

    ---------

    Co-authored-by: David Cosgrove <david@cozchemix.co.uk>

commit ce35b3c25b
Author: David Cosgrove <davidacosgroveaz@gmail.com>
Date:   Wed Dec 18 04:12:07 2024 +0000

    SynthonSearch synth check (#8109)

    * Catch errors when creating products.

    * Extra python test.

    * Fix formatting.

    ---------

    Co-authored-by: David Cosgrove <david@cozchemix.co.uk>

commit 63123278ca
Author: James Thompson <thompj@google.com>
Date:   Tue Dec 17 15:26:41 2024 +0000

    Vulnerability fixes

commit e640915d4e
Author: Nikitas Rontsis <nrontsis@gmail.com>
Date:   Tue Dec 17 15:11:40 2024 +0000

    Avoid unnecessary matching (#8111)

commit 5aed3d886b
Author: Greg Landrum <greg.landrum@gmail.com>
Date:   Mon Dec 16 16:59:13 2024 +0100

    Fixes #8096 (#8104)

    * add test

    * Fixes #8096

    * change in response to review

commit 6dce5d4080
Author: Greg Landrum <greg.landrum@gmail.com>
Date:   Sun Dec 15 05:58:20 2024 +0100

    Fixes #1670 (#8093)

    * add missing descriptors to Lipinski.py
    Fixes #1670

    * add to descriptor list

commit a4cdf5d21d
Author: Greg Landrum <greg.landrum@gmail.com>
Date:   Sun Dec 15 05:58:03 2024 +0100

    Fixes #8092 (#8094)

    * Fixes #8092
    cross-platform file stuff is just soooooo fun

    * response to review

    * works on windows

commit b7de0585ca
Author: Greg Landrum <greg.landrum@gmail.com>
Date:   Sat Dec 14 18:21:55 2024 +0100

    Add drawMols3D() and improve documentation for IPythonConsole (#8083)

    * Fixes #8082
    more docs

    * changes in response to review

commit 736e309f10
Author: David Cosgrove <davidacosgroveaz@gmail.com>
Date:   Sat Dec 14 17:21:29 2024 +0000

    Fix empty results bug. (#8099)

    Co-authored-by: David Cosgrove <david@cozchemix.co.uk>

commit c90cee9b77
Author: Greg Landrum <greg.landrum@gmail.com>
Date:   Sat Dec 14 17:08:43 2024 +0100

    Add Molecular Interaction Fields (#7993)

    * Add RealValueVect.

    * Add UniformRealValueGrid3D

    * Add Molecular Interaction Fields (MIFs)

    * line endings

    * cherry-pick f1bc94a4c8

    * format

    * Adapt tests for python3.

    * Adapt RealValueVector pickling for python3.

    * Speed-up of MIF calculations.

    * Bugfix in MIFDescriptors.cpp.

    * all tests pass

    * clean up some memory leaks

    * update copyrights

    * rename

    * rename the library

    * complete the rename

    * lost file

    * another forgotten file

    * cleanup

    * clang-tidy

    * clang-tidy

    * windows DLL builds work

    * python wrapper and tests cleanup

    * convert to catch2 testing

    * switch RealValueVect to use std::vector

    * remove obsolete friend

    * - Replace explicit loops with stdlib implicit equivalents
    - Replace explicit types with auto where possible
    - Avoid unnecessary copy operations where possible
    - Replace raw pointers with exception-safe unique_ptr
    - Replace C-style #define with constexpr
    - Replace C-style casts with C++ casts
    - Replace C-style arrays with std::vector
    - Avoid code duplication with templated operators
    - Replace VdWaals class taking multiple atom type definitions and force-field name as string parameter with force-field-specific classes deriving from an abstract VdWaals class
    - Replace x,y,z doubles with Point3D class where possible
    - Removed unused (and untested) DistanceToClosestAtom class
    - Renamed some variables and functions for better clarity
    - Converted tabs to spaces
    - Made the mol parameter in cube read/write functions optional for convenience
    - Made the Python wrappers more pythonic (e.g., avoid C++-style passing objects as parameters which are modified in place)
    - Implemented alternative Python class constructors using boost::python::make_constructor rather than with external non-class functions
    - The Python wrappers taking a sequence of Point3D now take a sequence of sequences, such that the output of Conformer.GetPositions() can be passed
    - Made the Python wrapper sequence parsing more robust
    - Removed duplicated code from Python wrappers

    * - avoid an unnecessary copy

    * progress

    * works

    * more cleanup

    * all tests pass

    * changes in response to review

    ---------

    Co-authored-by: dfhahn <dfhahn@users.noreply.github.com>
    Co-authored-by: ptosco <paolo.tosco@novartis.com>

* Adds error message to parse_data_sgroup_attr PRECONDITION
2025-01-27 17:10:20 +01:00
tadhurst-cdd
c2168cd8be Fix for kekuleAtrop wedge error (#7992)
* Fix for kekuleAtrop error

* Consolodate repeating code in new tests

* as per PR review - simplification
2024-11-15 04:39:38 +01:00
Kollin Trujillo
2e5f7ce80c Support Writing CX Extensions for Reactions (#7838)
* Support writing CX extensions in reactions

* fixed merge conflicts

* wip

* Updated for getCXExtensions

* Refactored and deleted extraneous file.

* Updated function signatures

* Updated some tests

* Removed extraneous include from debugging

* Removed comment in reactionwriter.cpp

* Updated some tests with expected strings

* Updated to add logging for linknodes and substance group hierarchies

* Addressed some issues

* updated tests

* Addressed Greg's comments

* Updated for recommendations

---------

Co-authored-by: Rachel Walker <rachel.walker@schrodinger.com>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-10-24 19:31:04 +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
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
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
Greg Landrum
848b57f654 Revert "Support handling atropisomers without coordinates (#7301)" (#7370)
This reverts commit 2159594164.
2024-04-19 06:05:32 +02:00
tadhurst-cdd
2159594164 Support handling atropisomers without coordinates (#7301)
* 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

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2024-04-19 04:38:27 +02: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
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
Brian Kelley
4200047dc0 Set squiggle bonds to STEREOANY with stereo atoms (#6877)
* Set squiggle bonds to STEREOANY with stereo atoms

* STEREOANY from squigglebonds is set regardless of sanitization now

* Ensure we have stereo atoms

* Add comment for new behavior

* See if a newer version of cmake works

* rev cmake to a slightly new version

* rev cmake to a slightly older version

* Response to review

* Allow setting of CIS/TRANS in set from squiggle bond

* Fix missing paren

* Add test for the actual enumeration

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2023-11-29 04:52:39 +01:00
Greg Landrum
c49692880c Fixes #6309 (#6824) 2023-10-23 16:56:48 +02: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
Greg Landrum
a49380e1ef Fixes #6050 (#6071)
* translate the cxsmiles tests to use catch2

* Fixes #6050

* changes in response to review
2023-02-15 20:34:01 -05:00
Ric
8b368c2847 Fixes bond index parsing for w/c/t/ctu labels in CXSMILES/CXSMARTS (#5722)
* fix issue

* add a test

* address review comments

* fix var name
2022-11-04 22:28:55 +01:00
Greg Landrum
3e3b7b8693 Support stereo for double bonds in rings from CXSMILES (#5636)
* initial support for wiggly and wedged bonds in cxsmiles
add CX_ALL_BUT_COORDS convenience option to CXSMILES writer

* move ClearSingleBondDirFlags to MolOps

* do a better job of handling the wiggly bonds

* mark 3D conformers from CXSMILES

* remove some extraneous printing

* test wD as well

* remove non-applicable test

* basic tests (not passing) for parsing t/c/ctu

* remove test for unimplemented feature

* basic tests (not passing) for parsing t/c/ctu

* backup

* parsing works

* Fixes #5585

* cleanup, use the constant instead of hardcoding

* write ctu block

* document new cxsmiles additions

* more stereo info in the docs

* changes in response to review

* this passes all tests
Need to still think a bit about whether the "basic writing" test results are actually correct

* happier with those results
2022-10-20 07:44:11 +02:00
Greg Landrum
ce082ae96b Revert "Support ring-bond stereo flags in CXSMILES (#5595)" (#5629)
This reverts commit c6388a0ba7.
2022-10-08 17:33:23 +02:00
Greg Landrum
c6388a0ba7 Support ring-bond stereo flags in CXSMILES (#5595)
* initial support for wiggly and wedged bonds in cxsmiles
add CX_ALL_BUT_COORDS convenience option to CXSMILES writer

* move ClearSingleBondDirFlags to MolOps

* do a better job of handling the wiggly bonds

* mark 3D conformers from CXSMILES

* remove some extraneous printing

* test wD as well

* remove non-applicable test

* basic tests (not passing) for parsing t/c/ctu

* remove test for unimplemented feature

* basic tests (not passing) for parsing t/c/ctu

* backup

* parsing works

* Fixes #5585

* cleanup, use the constant instead of hardcoding

* write ctu block

* document new cxsmiles additions

* more stereo info in the docs

* changes in response to review
2022-10-07 17:52:37 +02:00
Greg Landrum
42eed2605d Add CXSMILES support for bond wedging and wiggly bonds (#5575)
* initial support for wiggly and wedged bonds in cxsmiles
add CX_ALL_BUT_COORDS convenience option to CXSMILES writer

* move ClearSingleBondDirFlags to MolOps

* do a better job of handling the wiggly bonds

* mark 3D conformers from CXSMILES

* remove some extraneous printing

* test wD as well

* remove non-applicable test

* basic tests (not passing) for parsing t/c/ctu

* remove test for unimplemented feature

* changes in response to review

* changes in response to review

check for attempt to set the wedging more than once
testing for invalid w blocks
fix a bad comment
2022-09-24 05:44:01 +02:00
Brian Kelley
0e7871dc5e Fixes #5466 (#5468)
Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2022-08-03 15:44:41 +02:00
Brian Kelley
eddb87b2f0 Fixes #5324 (#5355) 2022-06-18 09:06:08 +02:00
Greg Landrum
705ac553f4 stop outputting empty block in CXSMILES (#5293)
* remove extra output from CXSMILES

* do not output an empty section in the CXSMILES
2022-05-16 07:38:59 +02:00
Greg Landrum
4c54b9ce02 remove extra output from CXSMILES (#5291) 2022-05-16 04:41:40 +02:00
Greg Landrum
6e5b01200b Add support for Pol and Mod pseudoatoms (#5264)
* reading pseudoatoms

* basics of writing

* switch to using dummyLabel to make this consistent
add cxsmiles read/write support
2022-05-07 11:10:57 +02:00
Eisuke Kawashima
ba6d8e0d3b clang-tidy: readability-simplify-boolean-expr (#4639) 2022-03-17 13:50:50 +01:00
Greg Landrum
2616a92906 Support CXSMILES/CXSMARTS for reactions (#4895)
* start with some basic tests
these currently fail, of course

* prep work

* minor refactoring and prep work

* get better at handling spaces

* first pass, needs completion and testing
loads more testing required
coordinate bonds don't work at all yet
I'm suspicious about the SGroup hierarchy

* more progress
agents and products are now parsed
more testing added
way more testing needed

* correctly ignore names
test cleanup

* more sgroup improvements and testing
now I think most everything is there and the basics are tested

* all tests pass

* link nodes and variable attachment points

* more cleanup and testing

* changes in response to review
2022-01-26 08:52:10 +01:00
Greg Landrum
db15b372a1 Fix some problems turned up by ossfuzz (#4927)
* resolves oss-fuzz #24399

* clean up some undefined behavior

* fix some UB in mergeQueryHs

* be more defensive

* defensive programming

* fix a _cxsmilesBondIdx bug

* more defensive programming
2022-01-22 04:30:06 +01:00
Greg Landrum
52f73e4be0 Add support for Beilstein generics when doing substructure queries (#4673)
* backup commit
This is mabye heading in the right direction and at least passes the basic tests which are there.

* some progress

* more tests and refactoring

* additional aliases
add carboaryl

* add CYC and ACY

* add ABC

* add AHC

* CBC and AOX

* add CHC and HAR

* add CXX

* cleanup: remove a bunch of nullptrs

* initial tagging support

* remove atom labels/sgroups after using them

* docs

* start handing writing

NOTE: this does not currently work: the generic code needs to move out of SubstructSearch

* move the generic groups to their own library

Signed-off-by: greg landrum <greg.landrum@gmail.com>

* make sure the generic groups end up in ctabs

* add forgotten CMakeLists.txt

* fix includes

* expose this stuff to Python

* CYC needs to initialize rings

* renaming

* add docs

* change in response to review
2021-12-01 06:01:53 +01:00
Greg Landrum
d9f2e8d052 Fixes #4503 (#4507)
* Fixes #4503

* Update Code/GraphMol/SmilesParse/catch_tests.cpp

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

* be more sensible about handling spaces

* document all of that

Co-authored-by: Ric <ricrogz@users.noreply.github.com>
2021-09-15 18:00:18 +02:00
Greg Landrum
cf65020cfe Fixes #4320 (#4419)
* add SmilesWriteParameters

* rename that

* teach the CFFI code about it

* add python wrappers

* basic python testing

* Fixes #4320
support toggling the various CXSMILES output fields

* win64 builds

* it helps to actually commit everything

* I admit that I am just guessing at this point
2021-08-17 10:39:41 -04:00
Greg Landrum
ab3aafa330 CXSMILES improvements (#4396)
* docs

* cleanup

* docs

* backup

* support parsing polymer sgroups from cxsmiles

* add _smilesBondOutputOrder

* make that work with SMARTS too

* get the writer working and update the docs

* ensure processCXSmilesLabels() is called at the appropriate time

* test simplification

* handle multiple s groups
test multiple s groups + data

* set sgroup indices
handled sgroup hierarchy

* write linknodes
2021-08-09 17:21:00 +02:00
Greg Landrum
c8c0f1b296 fix a bug with query handling in CXSMARTS (#4389) 2021-08-06 11:15:24 -04:00
Greg Landrum
6a36dcdf44 Fixes: #4233 Handling of SGroup data blocks in CXSMILES (#4393)
* parse sgroup data fields from CXSMILES

* minor optimization

* support writing SGroup data blocks to cxsmiles too
2021-08-05 13:51:57 +02:00
Greg Landrum
f829c877d8 MinimalLib: add CFFI interface (#4018)
* hello world works

* more

* more
minimallib needs to be tested

* parse substructure parameters from JSON

* add substruct search and parameters

* add descriptors

* register more descriptors

* fingerprints, first pass

* stop outputting tiny coord vals

* support generating 2d coords

* coordgen testing

* return nulls

* initial 3d support; add/removeHs; cleanup

* Embedding parameters from JSON

* update

* pattern fp, fps as bytes

* use json to configure MFP

* use json to configure rdkit and pattern fps

* aligned 2d coords

* parsing options

* options for writers

* rename remove_hs

* get this working on windows (kind of)

* silence some msvc warnings

* cmake updates

* update python tests

* add the CFFI code to CI builds

* cleanup line ending mess?

* a couple small fixes

* make this work with URF

* support coordMap in the 3D coordinate generation

* updates in response to review
2021-04-15 21:33:52 +02:00
Greg Landrum
36c7c04344 basic h bond support (#3871) 2021-03-06 09:39:13 -05:00
Ric
703fe5a225 Remove boost::foreach from public headers (#3820)
* remove include from headers

* update implementation files

* completely remove BOOST_FOREACH (#7)

* convert those changes to use auto

* get rid of all usage of BOOST_FOREACH

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-02-17 14:15:48 +01:00
Greg Landrum
885be973a6 Fixes #3320 (#3595) 2020-11-30 13:50:41 -05:00