137 Commits

Author SHA1 Message Date
Greg Landrum
e35f7db009 Cleanup/get atoms and bonds (#9243) 2026-04-18 05:22:09 +02:00
tadhurst-cdd
c948297d98 added new attributes for scsr template as per BIOVIA doc 2023 (#8911)
* added new attributes for scsr template as per BIOVIA doc 2003

* changed to allow any attributes for an SCSR Template def

* removed unneeded defs for TEMPLATE attribute names
2025-11-06 12:24:45 +01:00
Greg Landrum
00583fc1ab Fix a couple issues related to atom list handling in V3000 mol blocks (#8824)
Fixes #8820
Fixes #8823
2025-10-09 05:26:01 +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
Brian Kelley
2a57debe75 Throw error when V2000 coords are out of range (#8269)
* Throw error when V2000 coords are out of range

* Update Code/GraphMol/FileParsers/MolFileWriter.cpp

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

* Response to review.  Fixes Max/Min, force v3000 when out of bounds

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-02-20 07:50:40 +01:00
Greg Landrum
fa048eacc5 Replace GetImplicitValence() and GetExplicitValence() with GetValence() (#7926) 2025-01-28 21:09:03 +01:00
Hussein Faara
8411f4535e remove no-op macros and dead code (pt 2) (#8035)
* remove no-op macros and dead code (pt 2)

* test failures due to whitespace changes?

* actually run the testFeatures tests

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2025-01-11 14:10:00 +01:00
Greg Landrum
a0a21e6ec6 Fixes #8023 (#8024) 2024-11-21 14:28:19 +01: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
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
Greg Landrum
ea6fbeec30 add MolToV2KMolBlock() (#7511)
* 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
2024-06-13 09:43:59 +02:00
Paolo Tosco
a7e1f3014e - avoid inconsistency between V2K and V3K MDL output wrt isotopic labelling of R groups (neither should be isotopically labelled) (#7504)
- isotopic labelling should not depend on the presence of a query atom feature, but rather on the presence of common_properties::_MolFileRLabel

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-06-09 07:32:16 +02:00
Greg Landrum
9bb5e4834f Support zero order bonds in V3K CTABs (#7269) 2024-03-18 18:45:08 +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
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
Greg Landrum
a2ecd6723c Fixes #5819 (#6897)
* Fixes #5819
still some things to think about there

* test parsing

* make sure the fix for 5819 also shows up in reactions

* patch some other holes
2023-11-22 17:35:58 +01:00
tadhurst-cdd
d7c01af9c8 Fixes for canonicalization, and stereochemistry (#6743)
* Fixes for canonicalization, and stereochemistry

* chnages from code review

* test that was omitted for canon correction

* PR review changes

* changes as per PR review

* missed file checkint to make PR tests compile

* PR conflict resolution

* change to fix PR buld errors (hopefully)

* line delete to force re-running of tests

* changes as per PR review

* resolve merge conflicts with master

* some suggestions

* revert chirality modifications when sanitization isn't being done

* addl changes: no stereo percept when no sanitize

* missing test expected files added

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-11-06 07:40:23 +01:00
Ric
3720c2ceaf Fixes #6703 (#6705)
* add test

* fix the issue

* make imines w/ implicit H unspecified, but allow unknown

* improve test in 6527

* do not mark double bonds as EITHERDOUBLE if no neighbors
2023-09-28 05:16:17 +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
Ric
82a36ff592 Fixes #6502 (#6503)
* add a test

* fix

* fix rxnTestCatch
2023-07-14 06:31:26 +02:00
Greg Landrum
3068f3b26b Fixes #6316 (#6387) 2023-05-31 13:13:14 +02:00
Greg Landrum
8fbc3e66b1 Fixes #5930 (#5931) 2023-01-07 05:13:00 +01:00
Greg Landrum
cba7ecf3a4 Fixes #5785 (#5871)
* make the test for how to write valences more robust w.r.t. unsanitized molecules

* Fixes #5785
2022-12-16 16:00:30 +01:00
Greg Landrum
2c16e09796 Fixes #5718 (#5825)
* add test

* Fixes #5718
2022-12-02 14:58:32 +01:00
Greg Landrum
939d8c3c02 Move to C++17 (#5155)
* bump to c++17

* remove binary_function

* update our boost::hash implementation too
2022-04-12 13:53:07 +02:00
Eisuke Kawashima
ba6d8e0d3b clang-tidy: readability-simplify-boolean-expr (#4639) 2022-03-17 13:50:50 +01:00
Eisuke Kawashima
27f711a658 Run clang-tidy (readability-braces-around-statements) (#4977)
https://github.com/rdkit/rdkit/pull/3024#discussion_r526549843
2022-03-10 08:00:10 +01:00
Greg Landrum
90c6ffa472 Support writing V3000 reactions (#4982)
* first pass at writing v3K rxns

* python wrapper

* test other C++ call

* cleanup

* Fixes Windows DLL build issue

* changes in response to review

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2022-02-08 14:37:53 +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
69b143edd0 Swap from RDUNUSED_PARAM to unnamed parameters (#4433)
* cleanup

* more cleanup
2021-08-24 17:19:46 -04:00
Greg Landrum
3108236868 fixes #4345 (#4376)
* fixes #4345
some tests still failing

* changes in response to review
2021-08-02 04:35:54 +02:00
Greg Landrum
36c7c04344 basic h bond support (#3871) 2021-03-06 09:39:13 -05:00
Greg Landrum
009e593b5c MolDraw2D: first pass at rendering atom lists (#3804)
* first pass at rendering atom lists

* a bit of additional cleanup
2021-02-17 15:25:53 +01: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
a068a18a53 all tests now passing 2020-12-08 15:39:45 +01:00
greg landrum
55bc8d7ec1 backup 2020-12-08 15:39:45 +01:00
Greg Landrum
9949b4cbf6 Fixes #3597 (#3600)
* Fixes #3597

* add a test for super small values
2020-11-30 16:31:42 +01:00
Rocco Moretti
3cc2123637 Fix undefined behavior in testCoordGen test (#3495)
* Fix ROMol->RWMol static casts

* Fix accessing of end-iterator.

* Fix some test build issues I saw while compiling with Clang.

* Add build settings for sanitizers.

* Revert "Add build settings for sanitizers."

This reverts commit 5dc84374f0.
2020-10-17 04:26:13 +02:00
Greg Landrum
1630540ef0 Add cxsmiles query atoms to CTAB parsers and writers (#3261)
* allow CXSMILES generic query atoms to be parsed from mol;
need more tests here

* remove vestigial directory

* Add d_queryType to Query
This opens up additional flexibility with customizing the way queries are handled
Also includes some assorted cleanups in the Query directory

* remove the MolFileSymbol hack added in #3235
We don't need it anymore

* Add support for additional ChemAxon extensions and document them

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

* bump pickle version

* add an additional test
2020-07-03 12:51:19 -04:00
Greg Landrum
cc4b726c55 LINKNODEs are ignored by the CTAB parsers (#3247)
* make sure LINKNODE is saved from v3k mol files
v2k still needs work since the format is different

* write v3k linknodes

* support reading V2000 mol blocks too
2020-06-23 12:56:32 -04:00
Greg Landrum
45b9aef28b clang-tidy modernize-use-default-member-init and modernize-use-emplace (#3190)
* run clang-tidy with modernize-use-default-member-init

* results from modernize-use-emplace

* one uniform initialization per line
otherwise SWIG is unhappy

Co-authored-by: Brian Kelley <fustigator@gmail.com>
2020-05-28 09:07:58 +02:00
Greg Landrum
2ee798ddca Add support for the rest of the v3000 atom properties (#3007)
* Add convenience functions for generating v3K mol blocks and mol files

* first pass at parsing/writing the remaining atom properties from the CTAB spec

* handle SUBST

* write out the bond props that were being read but not written

* add an additional test

* fix a couple of problems caught in review
2020-03-14 04:58:07 +01:00
Greg Landrum
9991c5247a cleanup of the SMILES/SMARTS parsing and writing code (#2912)
* first cleanup

* next round of changes. all tests pass

* Fixes #2909

* Fixes #2910

* further cleanup

* some cleanup/refactoring of the Dict class

* remove now extraneous calls to hasProp() before clearProp()

* minor refactoring of RDProps.h

* Switch from using our own version of round() to std::round()

* replace some boost::math stuff with the equivalents from std::

* cleanups in SmartsWrite

* refactor out a bunch of duplicated code

* fix an instance of undefined behavior

* changes in response to review
2020-01-29 15:13:39 +01: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
Eisuke Kawashima
5cd27a242f Fix typo (#2862)
* Fix typo

* Reflect the comments

* Fix more typos
2019-12-31 06:43:27 +01:00
Greg Landrum
fc374a9622 Fixes: Atoms in non-standard valences not being properly written to mol blocks (#2646)
* Fixes a molblock writing problem
with undervalent atoms from the organic subset

* Fixes #2649

Also ensures that allenes are not written as crossed bonds
(which does not make sense at the moment anyway)

* clang-format run
2019-09-20 09:13:19 -04:00
Greg Landrum
d8c49e6dab Code cleanups from PVS/Studio (#2531)
* first round of cleanups based on PVS-studio suggestions

* a couple more

* a few more cleanups

* another round of cleanups

* undo one of those cleanups
we want the integer rounding behavior here

* add a comment to make that clear

* Fix for filter catalog PRECONDITION redundancy
2019-07-13 07:25:37 +02:00
Greg Landrum
5a79190261 rename SGroup -> SubstanceGroup (#2375)
We leave the names of the bit connected with Mol files as SGroups, since that is
appropriate there, but the more generic pieces are renamed
2019-03-30 14:53:24 -04:00