Commit Graph

28 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
Brian Kelley
553424d6b6 Revert "Create a function to extract some specified atoms from a ROMol as a new ROMol by creating new graph (#8742) (#8743)" (#8814)
This reverts commit 040bdb61c7.

During testing of using this as a replacement for portions of
getTheFrags in getMolFrags, several issues came up regarding
how copies should actually work in practice.  These are being
corrected in a new pr:  https://github.com/rdkit/rdkit/pull/8811

Co-authored-by: Brian Kelley <bkelley@glysade.com>
2025-09-25 10:54:36 +02:00
Hussein Faara
040bdb61c7 Create a function to extract some specified atoms from a ROMol as a new ROMol by creating new graph (#8742) (#8743)
* Create a function to extract some specified atoms from a ROMol as a new ROMol by creating new graph (#8742)

This adds a new api, `RDKit::MolOps::ExtractMolFragment`, to allow efficient
extractions of mol fragments from large mols. Compared to the approach where
we delete "unwanted" atoms/bonds from the input mol, this api is faster for
small mols (about 2x faster) and at least 3x faster for big mols
(was 10x faster for "CCC"*1000).

* clang-format

* review comments

* cleanup

* review comments

* fix build failure

---------

Co-authored-by: Your Name <you@example.com>
2025-09-24 06:39:52 +02:00
Greg Landrum
cb6caa161b Add option to only include shortest paths for topological torsion fingerprints (#6090)
* get findAllPaths versions working

* add that to the python wrapper

* add overlooked test file

* update test

* change in response to review
2023-02-20 11:13:53 +01:00
Ichiru Take
9822e9439c [ENH]: Support greater use of findAtomEnvironmentOfRadiusN() (#4970)
* [WIP-ENH]: Support greater use of `findAtomEnvironmentOfRadiusN()`

This PR is the feature support for PR 4262. I am not so confident when coding the C++ as it is my first time hands-on experience

There are still many thing that should be done but I still need several support

* Update MolOps.cpp

* Fix build error

Fix according to this? https://www.boost.org/doc/libs/1_42_0/libs/python/doc/v2/object.html#object-spec-ctors

* Fix build error

* Fix test2.cpp

* Fix `include` issue

* Fixed as requested

* Update Subgraphs.cpp

* Update Subgraphs.cpp

* Update Subgraphs.cpp

* Fix reported error, correct doc

* Update MolOps.cpp

* Update test and fix error

* Fix default argument

* Fix duplication

* Update Subgraphs.cpp

* Fix test bug

* Updated a test and fix reported error

* Update Subgraphs.cpp

* Fix reported error

* Update test2.cpp

* Fix reported error of memleak and introduce new function

* Fix incorrect variable

* Update test2.cpp

* Update test2.cpp

* Update MolOps.cpp

* Update MolOps.cpp

* Fix algorithm & Add test docs

* Update test2.cpp

* Update Subgraphs.cpp

* New argument `bondDist` - Optimize the `FindAtomEnvFromMToN`

Documentation is syncronized the meaning between C++ and Python

- New argument `bondDist`
- `findAtomEnvironmentOfRadiusMToN()` now called once instead of twice due to the introduction of `bondDist`

* Update Subgraphs.cpp

* Update test2.cpp

* Fix casting

* Correct the test

* Update Subgraphs.cpp

* Remove buggy function and replace argument position

* Update Subgraphs.h

* Fix build failed

* Optimization

Reduce graph expansion if it is the last radius

* Adjust codebase based on review

- Update Copyright
- Add doc to prove optimization

* suggested changes

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2022-03-09 14:01:24 +01:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02: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
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
ba12d98ad0 Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers (#1713)
* Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers

* Actually delete atoms and bonds...

* RWMol::clear now calls destroy to handle atom/bond deletion

* Changes broken Atom lookup for windows/gcc

* Adds tests for running with valgrind

* Adds test designed for valgrind and molecule deletions

* Removes RNG, actually tests bond deletions

* update swig wrappers

* deal with most recent changes on the main branch
2018-01-07 14:19:47 -05:00
Greg Landrum
915cf08faa run clang-format with c++-11 style over that 2017-04-22 17:19:10 +02:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +02:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Riccardo Vianello
7c346d7c2e Code/RDBoost/Exceptions.h moved to Code/RDGeneral 2015-03-16 22:31:48 +01:00
Greg Landrum
f5cf3322fe code cleanup: removing compiler warnings 2014-05-08 06:06:07 +02:00
Greg Landrum
a77371902f more work on sf.net issue 250 2012-09-13 04:40:28 +00:00
Greg Landrum
853d8f4750 fix and test sf.net issue 250 2012-09-11 06:39:21 +00:00
Greg Landrum
28747ea745 checkin some fragment and fingerprint changes. these are not yet well tested 2011-01-14 06:24:03 +00:00
Greg Landrum
3b3d44db16 remove exe property from source files 2011-01-13 04:22:56 +00:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
4b78f97572 add findAllPathsOfLengthsMtoN(), corresponds to findAllSubgraphsOfLengthsMtoN()
support path-based (i.e. non-branched fingerprints)
2010-08-21 00:20:18 +00:00
Greg Landrum
e05580e495 This is a sizeable one: change the way BGL is used so that atoms and bonds are stored as bundled properties
instead of using the property map interface.
A nice side-effect is that the wart of having to use property maps to loop over bonds or atom neighbors
is now gone.
This potentially breaks lots of client C++ code.
2009-02-11 20:19:25 +00:00
Greg Landrum
a8ea9cba40 Clean up includes so that this might build with the gcc 4.3 series.
This still needs to be tested on win.
2008-08-05 19:48:21 +00:00
Greg Landrum
3cd8d1cd7e a bit of optimization and code cleanup 2008-06-27 04:13:19 +00:00
Greg Landrum
8f8a885b50 test required fp trends;some optimization work 2008-04-09 07:10:30 +00:00
Greg Landrum
3e6cb74075 cleanup and documentation changes 2007-11-14 06:09:52 +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