19 Commits

Author SHA1 Message Date
Ricardo Rodriguez
7b7a8a4e17 Refactor iostreams includes (#8846)
* refactor iostreams includes

* restore ostream to MonomerInfo.cpp
2025-10-08 16:08:01 +02:00
Niels Maeder
591748d019 add function to overwrite __setattr__ to only accept valid arguments (#8448) 2025-04-18 05:33:16 +02:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Paolo Tosco
19c9a3905c Enhanced generateDepictionMatching2DStructure functionality (#3811)
* - generateDepictionMatching2DStructure can be used with referencePattern smaller than reference
  to only use part of a scaffold
- adds generateDepictionMatching2DStructure overload to pass a matchVect instead of doing a substructure match
- adds allowRGroups parameter to enable using a scaffold bearing R groups as reference

* changes in response to review

* added comments

* fixes failing doctest

* - reverted change committed accidentally
- fixed get_sss_json for the case where R groups are not included in the match
- added tests for the return value of generate_aligned_coords

* Documented the value returned by GenerateDepictionMatching2DStructure (Python)

* changes in response to review

* - changes in response to review
- fixed sortMatchesByDegreeOfCoreSubstitution that was not working
- added Python wrappers for sortMatchesByDegreeOfCoreSubstitution and getMostSubstitutedCoreMatch
- added C++ and Pyhon unit tests for the above

* added missing variable initialization

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2021-02-24 05:37:31 +01:00
Ric
d54e77e375 Add new CIP labelling algorithm (#3234)
* add port of centres

* Several changes:
    - Added a test based on RDKit issue 2984
        (default RDKit fails it, this gets it right)
    - Use bond directions for bond stereo (label is no longer required)
    - Fix bugs in rules 4b and 5new
    - Fix some mem errors
    - clang-formatted
    - some other minor cleanups

* Several changes and some improvements:
    - Added LGPL license, as well as a mention in the doc.
    - Fix/update/add some comments
    - Fix typo/bug in Mancude calculation
    - Fix bug in rules 4b, 5New
    - Fix Sp2 Bond dir reference
    - Re clang-format
    - other minor changes suggested by Dan

* Another bunch of changes:
  - require integer-order bonds; kekulize when required
  - fix fraction comparison
  - rename sq Cis/Trans e/z
  - replace queues with vectors
  - update copyright notices
  - revert LGPL changes
  - fix Asymmetric typo

* move to separate lib/mod, add python validation test

* Moving away from the original implementation:
    - Rename to CIPLabeler
    - Remove the abstraction layer
    - Remove some stats stuff
    - Push some CIPMol functions down to Node
    - Use RDKit's isotope info

* Another bundle of changes. The most relevant ones:
    - fix parity translation
    - use cis trans as bond reference -- breaks #2984 test
    - kill a lot of unused code
    - use lists for queues
    - store nodes and edges in digraph
    - add prefixes to class data member names
    - update changeRoot() test
    - use fastFindRings() for mancude rings
    - update docs
    - add references to the scientific paper
    - Document the Mancude functions
    - Fix Mancude atom types and their comments
    - remove mol data member from SequenceRule
    - replace Fraction with boost::rational
    - update comments, docstrings and the doc

* fix building the test

* Changes here include:
    - adding bitset overload for the labeling function
    - python wrap of the overload
    - handling trigonal pyramids with implicit H
    - setting bond labels sets stereo atoms, cis/trans
    - nix LEFT/RIGHT/TOGETHER/OPPOSITE constants
    - don't use GLOB in cmake
    - a decent amount of refactoring

* Minor edits to new_CIP_labeling (#6)

* Some changes for clarity

Added some documentation and changed some variable names to match
my understanding. Also a ran clang-tidy to ensure that all blocks
were brace-enclosed.

* Return a reference instead of a copy for performance

This is called many times and showed up after some light
profiling. This change bumped throughput by about 20%

* move out of Graphmol

* move .hpp headers to .h

* update documentation; add label set of atoms test

* Address comments:
    - Added references to centres to CIPLabeler.h and Python Wrap.
    - Update validation test to skip sanitization.
    - Document mancude fractional atomic number calculation.
    - Use unittest assertions in python test.
    - Update mancude docstrings to 'resonance' instad of 'tautomers'.
    - Rename prioritise() to prioritize().
    - Add postcondition to check carriers size in Tetrahedral.cpp.
    - Use getNeighbors() in Tetrahedral.cpp.
    - Move findStereoAtoms to Chirality namespace.
    - Move code back into GraphMol.
    - Fix typos and reformat doc.

* More comments:
    - Mention why we use boost's unordered map rather than the std one.
    - Fix include in Python wrapper.

* Addressed second batch of comments:
    - fix the bug in rule 4b
    - fix docstring for rule 2
    - move atomic mass calculation from rule 2 to node
    - addressed some build warnings
    - simplify sp2bond::label(comp)
    - add start/end atoms to Sp2Bond constructor
    - update system/local includes

Co-authored-by: Dan N <dan.nealschneider@schrodinger.com>
2020-07-07 20:34:33 +02:00
Greg Landrum
5712176605 Implement the two deprecations that were planned for the 2020.09 release cycle (#3047)
* Deprecation: planned removal of .message() and .getMessage() methods

* Deprecation: planned removal of old MolHash code

* document deprecations

* output the diffs when the psql tests fail

* remove .message() from SWIG wrappers

note that the KeyError doesn't work properly. We should clean up the the exceptions here anyway

* typo
2020-04-01 14:30:07 +02:00
Ric
9188c70a64 Override what() in exceptions (Addresses #2920) (#2928)
* add overrides for what()

* translation fot KeyErrorException; update tests

* Switch all exceptions to `const char *` as a return type from message() (#4)

* switch return type of message() from std::string to const char *

* adjust one test to the new return type from message()
remove unnecessary verbosity from some tests

* fix cartridge build: update call to message().c_str()

* rebase agains master; fix another issue in cartridge build

* add deprecation note for message() and getMessage()

* amend Release notes

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2020-02-05 08:20:17 +01:00
Paolo Tosco
c08ea49bda - enable building DLLs on Windows (#1861)
* - enable building DLLs on Windows

* - export.h and test.h are now auto-generated by CMake
2018-05-16 08:42:41 +02:00
Brian Kelley
1f344c4c4d Uses toUserString (versioning and build system filename removal) 2016-01-21 12:22:44 -05:00
Brian Kelley
daf8005637 Adds translate_invariant_error for better python exceptions 2016-01-21 12:22:44 -05:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Riccardo Vianello
458ed03bf1 Code/RDBoost/Exceptions.h moved to Code/RDGeneral 2015-03-16 23:26:45 +01:00
Riccardo Vianello
3358ec5925 initial set of changes introducing python3 support 2014-06-17 18:26:41 +02:00
Greg Landrum
f3d06ac331 refactor a bit to make this more logical 2012-03-26 03:08:02 +00:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
052ec66542 cleanups:
remove x bit from headers and sources;
remove a couple empty files from Code/GraphMol
2010-09-08 04:25:57 +00:00
Greg Landrum
2dd27c168d small motion towards getting the boost.build stuff working on windows. 2008-02-06 05:39:56 +00:00
Greg Landrum
5d03333c22 setup svn keywords (should have done this before import... grn) 2006-05-06 22:54:39 +00:00
Greg Landrum
75a79b6327 initial import 2006-05-06 22:20:08 +00:00