useful-rdkit-utils 2.0__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/.readthedocs.yaml +2 -3
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/CHANGELOG.md +74 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/PKG-INFO +30 -10
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/README.md +28 -7
- useful_rdkit_utils-2.0.2/docs/source/cli.rst +66 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/conf.py +12 -14
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/index.rst +11 -1
- useful_rdkit_utils-2.0.2/docs/source/installation.rst +69 -0
- useful_rdkit_utils-2.0.2/docs/source/optional.rst +7 -0
- useful_rdkit_utils-2.0.2/docs/source/silly_walks.rst +9 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/pyproject.toml +2 -2
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_geometry.py +180 -0
- useful_rdkit_utils-2.0.2/tests/test_split_utils.py +154 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_useful_rdkit_utils.py +1 -1
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/__init__.py +1 -1
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/descriptor_preprocessor.py +1 -1
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/descriptors.py +13 -23
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/geometry.py +69 -10
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/reactions.py +5 -5
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/ring_systems.py +5 -4
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/split_utils.py +129 -2
- useful_rdkit_utils-2.0/docs/source/installation.rst +0 -28
- useful_rdkit_utils-2.0/tests/test_split_utils.py +0 -65
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/.gitattributes +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/.github/CONTRIBUTING.md +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/.github/PUBLISHING.md +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/.github/workflows/CI.yaml +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/.github/workflows/publish.yaml +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/.gitignore +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/CODE_OF_CONDUCT.md +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/LICENSE +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/MANIFEST.in +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/data/chembl_ring_systems.csv +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/data/test.smi +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/Makefile +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/descriptor_preprocessor.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/descriptors.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/geometry.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/jupyter.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/misc_utils.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/model_comparison.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/pandas.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/reactions.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/reos.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/ring_systems.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/sali.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/scaffold_finder.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/seaborn.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/split_utils.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/stats.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/docs/source/units.rst +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/nikki.png +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/README.md +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/bootstrap_AUC.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/catboost_wrapper.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/compare_mordred_rdkit.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/data/biogen_logS.csv +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/demo_REOS.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/demo_cross_validate.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/demo_descriptors.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/demo_ring_systems.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/demo_useful_rdkit_utils.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/explore_functional_group_filters.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/ffnn.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/lgbm_wrapper.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/model_comparison.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/parallel_conformer_generation.ipynb +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/sort_and_slice_ecfp_featuriser.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/notebooks/zinc_sample.smi +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/__init__.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test.smi +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_audit_fixes.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_chemreps.txt +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_descriptor_preprocessor.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_descriptors.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_model_comparison.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_reactions.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_reos.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_ring_systems.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_sali.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_scaffold_finder.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/tests/test_silly_walks.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/build_ring_dictionary.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/jupyter_utils.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/misc_utils.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/model_comparison.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/optional.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/pandas_utils.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/reos.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/sali.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/scaffold_finder.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/seaborn_utils.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/silly_walks.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/stat_utils.py +0 -0
- {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.2}/useful_rdkit_utils/units.py +0 -0
|
@@ -22,12 +22,11 @@ sphinx:
|
|
|
22
22
|
# - pdf
|
|
23
23
|
|
|
24
24
|
# Install the package itself, so the runtime dependencies come from pyproject.toml
|
|
25
|
-
# and cannot drift. "docs" brings the Sphinx toolchain
|
|
26
|
-
#
|
|
25
|
+
# and cannot drift. "docs" brings the Sphinx toolchain. The optional extras are not
|
|
26
|
+
# needed: nothing autodoc imports pulls in click or IPython at module level.
|
|
27
27
|
python:
|
|
28
28
|
install:
|
|
29
29
|
- method: pip
|
|
30
30
|
path: .
|
|
31
31
|
extra_requirements:
|
|
32
32
|
- docs
|
|
33
|
-
- extras
|
|
@@ -3,6 +3,80 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
|
|
4
4
|
## [Unreleased]
|
|
5
5
|
|
|
6
|
+
## [2.0.2] - 2026-11-29
|
|
7
|
+
### Fixed
|
|
8
|
+
- Excluded rdkit 2026.9.2 from the dependencies. Its macOS arm64 PyPI wheels raise
|
|
9
|
+
`RuntimeError: bad any cast` from `MurckoDecompose()` on every molecule
|
|
10
|
+
(rdkit/rdkit#9836), which broke `get_scaffold()` and the scaffold-based splits and clustering
|
|
11
|
+
on Apple Silicon. The Linux wheels and the conda-forge build are unaffected, but one exclusion
|
|
12
|
+
keeps the requirement simple. Lift it once a fixed release is out.
|
|
13
|
+
- `mcs_rmsd()` is symmetry corrected, which it was documented and named for but did not do.
|
|
14
|
+
It minimizes the RMSD over every way the MCS maps onto each molecule, but called
|
|
15
|
+
`GetSubstructMatches()` without `uniquify=False`. That default keeps one representative per
|
|
16
|
+
symmetry class, which is exactly the set the minimum was meant to be taken over, so there was
|
|
17
|
+
nothing left to minimize and the comparison was symmetry blind. On pose pairs that differ only
|
|
18
|
+
by a symmetric relabeling, such as a carboxylate's two oxygens swapped, a para-ring flipped or
|
|
19
|
+
two methyls exchanged, it reported 1.40 to 1.70 A where the answer is 0. That straddles the 1.5 A
|
|
20
|
+
threshold conventionally used to call a predicted pose correct, so the error changed verdicts.
|
|
21
|
+
`refine_conformers(use_symmetry=True)` already treats such pairs as identical, so the two
|
|
22
|
+
functions disagreed about what counts as the same arrangement.
|
|
23
|
+
### Added
|
|
24
|
+
- `mcs_rmsd(align=...)`. The default compares the conformers in the frame they arrive in, which
|
|
25
|
+
is what scoring docked or co-folded poses against a crystal structure needs, since the receptor
|
|
26
|
+
fixes a common frame and a pose in the wrong place must score as wrong. `align=True` superposes
|
|
27
|
+
the MCS atoms first, which is what comparing free conformers needs. The docstring had not said
|
|
28
|
+
which of the two it did, and the two answers differ by however far apart the inputs sit.
|
|
29
|
+
- `mcs_rmsd(timeout=...)`, passed through to `FindMCS()`. The MCS search was unbounded, and it is
|
|
30
|
+
the expensive half of the call on large or highly symmetric pairs.
|
|
31
|
+
- `mcs_rmsd(max_matches=...)`, replacing the inherited `GetSubstructMatches()` default of 1000.
|
|
32
|
+
Enumerating all mappings rather than one per symmetry class raises the count a long way, and a
|
|
33
|
+
tetraphenyl scaffold returns 1000 of its 4608 mappings at the old default, silently, so the
|
|
34
|
+
minimum was taken over an arbitrary subset. The cap is now explicit, documented and raisable.
|
|
35
|
+
- `audit_split_leakage()` and `summarize_split_leakage()` in split_utils. The module builds
|
|
36
|
+
splits four ways but had no way to check one it was handed, which is the case whenever a split
|
|
37
|
+
arrives with a public benchmark or from a collaborator. Each test molecule is checked against
|
|
38
|
+
the training set from strictest to loosest: identical InChIKey, identical first InChIKey block,
|
|
39
|
+
identical Bemis-Murcko scaffold, and nearest-neighbor Morgan Tanimoto with the training
|
|
40
|
+
molecule that produced it.
|
|
41
|
+
The first block carries constitution only, so it catches a training molecule that differs just
|
|
42
|
+
in stereochemistry or protonation state. Enantiomers, diastereomers, E/Z isomers and an acid
|
|
43
|
+
against its conjugate base all collapse onto it, and each of those is leakage that an InChIKey
|
|
44
|
+
comparison alone reports as a clean split. It does not see through every tautomer and does not
|
|
45
|
+
see through salts at all, so `strip_salts`, on by default, reduces each molecule to its largest
|
|
46
|
+
fragment first; without it a mesylate of a training compound reads as a new molecule.
|
|
47
|
+
The two strict checks are leakage outright, since a model can score on them without
|
|
48
|
+
generalizing. The scaffold and similarity columns are degrees of optimism rather than errors
|
|
49
|
+
and depend on what the split was built to measure, so they are reported and not judged.
|
|
50
|
+
|
|
51
|
+
## [2.0.1] - 2026-08-27
|
|
52
|
+
### Added
|
|
53
|
+
- Documentation pages for the three modules that had none: silly_walks, optional, and a Command Line
|
|
54
|
+
Tools page covering the `build_ring_dictionary` and `silly_walks` console scripts added in 2.0.
|
|
55
|
+
- sphinx.ext.napoleon. The package mixes two docstring styles, and the NumPy-style Parameters/Attributes
|
|
56
|
+
sections in descriptor_preprocessor and model_comparison were rendering as a run of unformatted text
|
|
57
|
+
because nothing was parsing them.
|
|
58
|
+
- installation.rst and README.md document all of the optional extras (`extras`, `jupyter`, `all`, `docs`,
|
|
59
|
+
`tests`), what each one brings in, and how to run the test suite.
|
|
60
|
+
### Changed
|
|
61
|
+
- conf.py reads the version out of useful_rdkit_utils/__init__.py, the same place hatchling reads it, so
|
|
62
|
+
the docs cannot drift from the package. It was hard-coded to 1.0.0, so the 2.0 docs were titled 1.0.0.
|
|
63
|
+
- index.rst splits the toctree into "Getting Started" and "API Reference".
|
|
64
|
+
- Dropped sphinx-click. Version 6.2.0 does `from sphinx.ext.autodoc import mock`, which resolves to the
|
|
65
|
+
submodule rather than the function on Sphinx 9, so the `.. click::` directive raises
|
|
66
|
+
"TypeError: 'module' object is not callable". The two CLIs are documented by hand instead, which also
|
|
67
|
+
keeps them consistent, since silly_walks uses argparse and sphinx-click only handles click.
|
|
68
|
+
- .readthedocs.yaml no longer installs the `extras` extra for the docs build. Nothing autodoc imports
|
|
69
|
+
pulls in click or IPython at module level.
|
|
70
|
+
### Fixed
|
|
71
|
+
- The docs build is clean: 14 Sphinx warnings and docutils errors down to 0.
|
|
72
|
+
- Docstring markup that docutils could not parse: the code snippets in mol2morgan_fp() and smi2morgan_fp()
|
|
73
|
+
are literal blocks rather than unexpected indentation, the `:param`/`:return` continuation lines in
|
|
74
|
+
enumerate_library() and enumerate_library_sample() are indented so the field lists do not terminate
|
|
75
|
+
early, and the trailing-underscore identifiers ("fr_", `n_features_out_`) are escaped rather than read
|
|
76
|
+
as references to undefined targets.
|
|
77
|
+
- Removed the Methods section from Ro5Calculator's docstring. It duplicated what autodoc already generates
|
|
78
|
+
from the methods themselves, producing four "duplicate object description" warnings.
|
|
79
|
+
|
|
6
80
|
## [2.0] - 2026-08-21
|
|
7
81
|
### Added
|
|
8
82
|
- Python 3.13 to the CI matrix, and 3.11/3.12/3.13 to the package classifiers. requires-python stays at >=3.11:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: useful_rdkit_utils
|
|
3
|
-
Version: 2.0
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: A collection of useful RDKit functions
|
|
5
5
|
Project-URL: Homepage, https://github.com/PatWalters/useful_rdkit_utils
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/PatWalters/useful_rdkit_utils/issues
|
|
@@ -18,7 +18,7 @@ Requires-Dist: numpy
|
|
|
18
18
|
Requires-Dist: pandas
|
|
19
19
|
Requires-Dist: py3dmol
|
|
20
20
|
Requires-Dist: pystow
|
|
21
|
-
Requires-Dist: rdkit
|
|
21
|
+
Requires-Dist: rdkit!=2026.9.2
|
|
22
22
|
Requires-Dist: scikit-learn
|
|
23
23
|
Requires-Dist: scipy
|
|
24
24
|
Requires-Dist: seaborn
|
|
@@ -31,7 +31,6 @@ Provides-Extra: docs
|
|
|
31
31
|
Requires-Dist: sphinx; extra == 'docs'
|
|
32
32
|
Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
|
|
33
33
|
Requires-Dist: sphinx-automodapi; extra == 'docs'
|
|
34
|
-
Requires-Dist: sphinx-click; extra == 'docs'
|
|
35
34
|
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
|
|
36
35
|
Provides-Extra: extras
|
|
37
36
|
Requires-Dist: click; extra == 'extras'
|
|
@@ -51,36 +50,57 @@ A motley collection of useful RDKit functions
|
|
|
51
50
|
|
|
52
51
|
<img src="nikki.png" alt="Robot Nikki" width="300"/>
|
|
53
52
|
|
|
54
|
-
###
|
|
53
|
+
### Installation
|
|
54
|
+
Requires Python 3.11 or newer.
|
|
55
55
|
```bash
|
|
56
|
-
|
|
56
|
+
pip install useful_rdkit_utils
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
A few pieces need optional dependencies. Install `all` to get everything:
|
|
60
60
|
```bash
|
|
61
|
-
pip install useful_rdkit_utils
|
|
61
|
+
pip install useful_rdkit_utils[all]
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
| Extra | Brings in | Needed for |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| `extras` | click | the `build_ring_dictionary` command line tool |
|
|
67
|
+
| `jupyter` | IPython | the `rd_*` helpers that configure RDKit's notebook rendering |
|
|
68
|
+
| `all` | click, IPython | both of the above |
|
|
69
|
+
|
|
64
70
|
### Installing the latest development version
|
|
65
71
|
```bash
|
|
66
72
|
pip install git+https://github.com/PatWalters/useful_rdkit_utils
|
|
67
73
|
```
|
|
68
|
-
### Documentation
|
|
69
74
|
|
|
70
|
-
|
|
75
|
+
### Command line tools
|
|
76
|
+
Installing the package puts two commands on your `PATH`.
|
|
71
77
|
|
|
78
|
+
| Command | What it does |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `build_ring_dictionary` | build a ring system frequency dictionary from a ChEMBL chemreps file, or look up the ring systems in a set of molecules against one |
|
|
81
|
+
| `silly_walks` | build the Morgan fingerprint count dictionary that `SillyWalks` scores against |
|
|
72
82
|
|
|
83
|
+
### Documentation
|
|
73
84
|
|
|
85
|
+
[https://useful-rdkit-utils.rtfd.io](https://useful-rdkit-utils.rtfd.io)
|
|
74
86
|
|
|
75
87
|
### Demos
|
|
76
88
|
The notebooks directory contains Jupyter notebooks that show how to use some of the functions in this collection.
|
|
77
89
|
|
|
90
|
+
### Development
|
|
91
|
+
```bash
|
|
92
|
+
git clone https://github.com/PatWalters/useful_rdkit_utils.git
|
|
93
|
+
cd useful_rdkit_utils
|
|
94
|
+
pip install -e ".[tests,all]"
|
|
95
|
+
pytest -m "not network" # some tests download data; -m "not network" skips them
|
|
96
|
+
```
|
|
97
|
+
|
|
78
98
|
### Contributing
|
|
79
99
|
I'm very open to PRs with corrections and/or contributions.
|
|
80
100
|
|
|
81
101
|
### Copyright
|
|
82
102
|
|
|
83
|
-
Copyright (c) 2021-
|
|
103
|
+
Copyright (c) 2021-2026, Pat Walters
|
|
84
104
|
|
|
85
105
|
### License
|
|
86
106
|
|
|
@@ -8,36 +8,57 @@ A motley collection of useful RDKit functions
|
|
|
8
8
|
|
|
9
9
|
<img src="nikki.png" alt="Robot Nikki" width="300"/>
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Installation
|
|
12
|
+
Requires Python 3.11 or newer.
|
|
12
13
|
```bash
|
|
13
|
-
|
|
14
|
+
pip install useful_rdkit_utils
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
A few pieces need optional dependencies. Install `all` to get everything:
|
|
17
18
|
```bash
|
|
18
|
-
pip install useful_rdkit_utils
|
|
19
|
+
pip install useful_rdkit_utils[all]
|
|
19
20
|
```
|
|
20
21
|
|
|
22
|
+
| Extra | Brings in | Needed for |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `extras` | click | the `build_ring_dictionary` command line tool |
|
|
25
|
+
| `jupyter` | IPython | the `rd_*` helpers that configure RDKit's notebook rendering |
|
|
26
|
+
| `all` | click, IPython | both of the above |
|
|
27
|
+
|
|
21
28
|
### Installing the latest development version
|
|
22
29
|
```bash
|
|
23
30
|
pip install git+https://github.com/PatWalters/useful_rdkit_utils
|
|
24
31
|
```
|
|
25
|
-
### Documentation
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
### Command line tools
|
|
34
|
+
Installing the package puts two commands on your `PATH`.
|
|
28
35
|
|
|
36
|
+
| Command | What it does |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `build_ring_dictionary` | build a ring system frequency dictionary from a ChEMBL chemreps file, or look up the ring systems in a set of molecules against one |
|
|
39
|
+
| `silly_walks` | build the Morgan fingerprint count dictionary that `SillyWalks` scores against |
|
|
29
40
|
|
|
41
|
+
### Documentation
|
|
30
42
|
|
|
43
|
+
[https://useful-rdkit-utils.rtfd.io](https://useful-rdkit-utils.rtfd.io)
|
|
31
44
|
|
|
32
45
|
### Demos
|
|
33
46
|
The notebooks directory contains Jupyter notebooks that show how to use some of the functions in this collection.
|
|
34
47
|
|
|
48
|
+
### Development
|
|
49
|
+
```bash
|
|
50
|
+
git clone https://github.com/PatWalters/useful_rdkit_utils.git
|
|
51
|
+
cd useful_rdkit_utils
|
|
52
|
+
pip install -e ".[tests,all]"
|
|
53
|
+
pytest -m "not network" # some tests download data; -m "not network" skips them
|
|
54
|
+
```
|
|
55
|
+
|
|
35
56
|
### Contributing
|
|
36
57
|
I'm very open to PRs with corrections and/or contributions.
|
|
37
58
|
|
|
38
59
|
### Copyright
|
|
39
60
|
|
|
40
|
-
Copyright (c) 2021-
|
|
61
|
+
Copyright (c) 2021-2026, Pat Walters
|
|
41
62
|
|
|
42
63
|
### License
|
|
43
64
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Command Line Tools
|
|
2
|
+
==================
|
|
3
|
+
Installing the package puts two commands on your ``PATH``.
|
|
4
|
+
|
|
5
|
+
build_ring_dictionary
|
|
6
|
+
---------------------
|
|
7
|
+
Builds a ring-system frequency dictionary from a ChEMBL chemreps file, or looks
|
|
8
|
+
up the ring systems in a set of molecules against an existing dictionary. This is
|
|
9
|
+
the command line front end to
|
|
10
|
+
:func:`~useful_rdkit_utils.ring_systems.create_ring_dictionary` and
|
|
11
|
+
:func:`~useful_rdkit_utils.ring_systems.test_ring_system_lookup`.
|
|
12
|
+
|
|
13
|
+
The command is built with `click <https://click.palletsprojects.com>`_, which is
|
|
14
|
+
an optional dependency. Install it with:
|
|
15
|
+
|
|
16
|
+
.. code-block:: shell
|
|
17
|
+
|
|
18
|
+
$ pip install useful_rdkit_utils[extras]
|
|
19
|
+
|
|
20
|
+
.. code-block:: text
|
|
21
|
+
|
|
22
|
+
Usage: build_ring_dictionary [OPTIONS]
|
|
23
|
+
|
|
24
|
+
Options:
|
|
25
|
+
--mode TEXT [build|search]
|
|
26
|
+
--infile TEXT input file
|
|
27
|
+
--outfile TEXT output file
|
|
28
|
+
--help Show this message and exit.
|
|
29
|
+
|
|
30
|
+
In ``build`` mode ``--infile`` is a ChEMBL chemreps file and ``--outfile`` is the
|
|
31
|
+
ring dictionary CSV to write:
|
|
32
|
+
|
|
33
|
+
.. code-block:: shell
|
|
34
|
+
|
|
35
|
+
$ build_ring_dictionary --mode build --infile chembl_35_chemreps.txt --outfile chembl_ring_systems.csv
|
|
36
|
+
|
|
37
|
+
In ``search`` mode ``--infile`` is a SMILES file and ``--outfile`` is a CSV of the
|
|
38
|
+
ring systems found in it, annotated with their frequency in the reference
|
|
39
|
+
dictionary. Any option you leave off is prompted for.
|
|
40
|
+
|
|
41
|
+
silly_walks
|
|
42
|
+
-----------
|
|
43
|
+
Builds the Morgan fingerprint count dictionary that
|
|
44
|
+
:class:`~useful_rdkit_utils.silly_walks.SillyWalks` scores against, from the
|
|
45
|
+
``canonical_smiles`` column of a ChEMBL chemreps file. The dictionary is written
|
|
46
|
+
as JSON and can be read back with
|
|
47
|
+
:meth:`~useful_rdkit_utils.silly_walks.SillyWalks.load_json_dict`.
|
|
48
|
+
|
|
49
|
+
.. code-block:: text
|
|
50
|
+
|
|
51
|
+
usage: silly_walks [-h] -in INPUT_FILE -out OUTPUT_FILE
|
|
52
|
+
|
|
53
|
+
Generate count_dict from ChEMBL chemreps file.
|
|
54
|
+
|
|
55
|
+
options:
|
|
56
|
+
-h, --help show this help message and exit
|
|
57
|
+
-in, --input_file INPUT_FILE
|
|
58
|
+
Name of the input file containing the ChEMBL chemreps data.
|
|
59
|
+
-out, --output_file OUTPUT_FILE
|
|
60
|
+
Name of the output file where the count_dict will be saved.
|
|
61
|
+
|
|
62
|
+
For example:
|
|
63
|
+
|
|
64
|
+
.. code-block:: shell
|
|
65
|
+
|
|
66
|
+
$ silly_walks -in chembl_35_chemreps.txt -out chembl_35_counts.json
|
|
@@ -26,21 +26,15 @@ project = 'useful_rdkit_utils'
|
|
|
26
26
|
copyright = f'{date.today().year}, Pat Walters'
|
|
27
27
|
author = 'Pat Walters'
|
|
28
28
|
|
|
29
|
-
# The full version, including alpha/beta/rc tags.
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
# The full version, including alpha/beta/rc tags. Read straight out of
|
|
30
|
+
# useful_rdkit_utils/__init__.py, which is also where hatchling reads it, so the
|
|
31
|
+
# version in the docs cannot drift away from the version of the package.
|
|
32
|
+
_init_py = os.path.join(os.path.dirname(__file__), '..', '..', 'useful_rdkit_utils', '__init__.py')
|
|
33
|
+
with open(_init_py) as _fh:
|
|
34
|
+
release = re.search(r'^__version__ = ["\'](?P<version>[^"\']+)["\']', _fh.read(), re.M).group('version')
|
|
32
35
|
|
|
33
36
|
# The short X.Y version.
|
|
34
|
-
|
|
35
|
-
'(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?:-(?P<release>[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+(?P<build>[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?',
|
|
36
|
-
release,
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
version = parsed_version.expand('\g<major>.\g<minor>.\g<patch>')
|
|
41
|
-
|
|
42
|
-
#if parsed_version.group('release'):
|
|
43
|
-
# tags.add('prerelease')
|
|
37
|
+
version = '.'.join(release.split('.')[:2])
|
|
44
38
|
|
|
45
39
|
# -- General configuration ---------------------------------------------------
|
|
46
40
|
|
|
@@ -61,13 +55,17 @@ modindex_common_prefix = ["useful_rdkit_utils."]
|
|
|
61
55
|
extensions = [
|
|
62
56
|
'sphinx.ext.autosummary',
|
|
63
57
|
'sphinx.ext.autodoc',
|
|
58
|
+
# The package mixes two docstring styles: ":param x:" in most modules and
|
|
59
|
+
# NumPy-style "Parameters/Attributes" sections in descriptor_preprocessor
|
|
60
|
+
# and model_comparison. Napoleon is what turns the latter into real sections
|
|
61
|
+
# rather than a run of unformatted text.
|
|
62
|
+
'sphinx.ext.napoleon',
|
|
64
63
|
'sphinx.ext.coverage',
|
|
65
64
|
'sphinx.ext.intersphinx',
|
|
66
65
|
"sphinx.ext.todo",
|
|
67
66
|
'sphinx.ext.mathjax',
|
|
68
67
|
'sphinx.ext.viewcode',
|
|
69
68
|
'sphinx_autodoc_typehints',
|
|
70
|
-
'sphinx_click.ext',
|
|
71
69
|
'sphinx_automodapi.automodapi',
|
|
72
70
|
'sphinx_automodapi.smart_resolver',
|
|
73
71
|
# 'texext',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
useful_rdkit_utils |release| Documentation
|
|
2
2
|
==========================================
|
|
3
|
+
A motley collection of useful RDKit functions.
|
|
3
4
|
|
|
4
5
|
.. toctree::
|
|
5
6
|
:maxdepth: 2
|
|
@@ -7,10 +8,19 @@ useful_rdkit_utils |release| Documentation
|
|
|
7
8
|
:name: start
|
|
8
9
|
|
|
9
10
|
installation
|
|
11
|
+
cli
|
|
12
|
+
|
|
13
|
+
.. toctree::
|
|
14
|
+
:maxdepth: 2
|
|
15
|
+
:caption: API Reference
|
|
16
|
+
:name: api
|
|
17
|
+
|
|
10
18
|
reos
|
|
11
19
|
ring_systems
|
|
12
20
|
descriptors
|
|
21
|
+
descriptor_preprocessor
|
|
13
22
|
scaffold_finder
|
|
23
|
+
silly_walks
|
|
14
24
|
split_utils
|
|
15
25
|
reactions
|
|
16
26
|
geometry
|
|
@@ -22,7 +32,7 @@ useful_rdkit_utils |release| Documentation
|
|
|
22
32
|
units
|
|
23
33
|
sali
|
|
24
34
|
model_comparison
|
|
25
|
-
|
|
35
|
+
optional
|
|
26
36
|
|
|
27
37
|
Indices and Tables
|
|
28
38
|
------------------
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Installation
|
|
2
|
+
============
|
|
3
|
+
useful_rdkit_utils requires Python 3.11 or newer.
|
|
4
|
+
|
|
5
|
+
The most recent release can be installed from
|
|
6
|
+
`PyPI <https://pypi.org/project/useful_rdkit_utils>`_ with:
|
|
7
|
+
|
|
8
|
+
.. code-block:: shell
|
|
9
|
+
|
|
10
|
+
$ pip install useful_rdkit_utils
|
|
11
|
+
|
|
12
|
+
The most recent code and data can be installed directly from GitHub with:
|
|
13
|
+
|
|
14
|
+
.. code-block:: shell
|
|
15
|
+
|
|
16
|
+
$ pip install git+https://github.com/PatWalters/useful_rdkit_utils.git
|
|
17
|
+
|
|
18
|
+
To install in development mode, use the following:
|
|
19
|
+
|
|
20
|
+
.. code-block:: shell
|
|
21
|
+
|
|
22
|
+
$ git clone https://github.com/PatWalters/useful_rdkit_utils.git
|
|
23
|
+
$ cd useful_rdkit_utils
|
|
24
|
+
$ pip install -e .
|
|
25
|
+
|
|
26
|
+
Extras
|
|
27
|
+
------
|
|
28
|
+
Everything in the API reference works from a plain install except for the pieces
|
|
29
|
+
listed below, which need an optional dependency.
|
|
30
|
+
|
|
31
|
+
.. list-table::
|
|
32
|
+
:header-rows: 1
|
|
33
|
+
:widths: 15 25 60
|
|
34
|
+
|
|
35
|
+
* - Extra
|
|
36
|
+
- Brings in
|
|
37
|
+
- Needed for
|
|
38
|
+
* - ``extras``
|
|
39
|
+
- click
|
|
40
|
+
- the :doc:`build_ring_dictionary <cli>` command line tool
|
|
41
|
+
* - ``jupyter``
|
|
42
|
+
- IPython
|
|
43
|
+
- the ``rd_*`` helpers in :doc:`jupyter`, which configure RDKit's notebook
|
|
44
|
+
rendering. RDKit implements that on top of IPython.
|
|
45
|
+
* - ``all``
|
|
46
|
+
- click, IPython
|
|
47
|
+
- both of the above
|
|
48
|
+
* - ``docs``
|
|
49
|
+
- the Sphinx toolchain
|
|
50
|
+
- building this documentation
|
|
51
|
+
* - ``tests``
|
|
52
|
+
- pytest
|
|
53
|
+
- running the test suite
|
|
54
|
+
|
|
55
|
+
Install one with, for example:
|
|
56
|
+
|
|
57
|
+
.. code-block:: shell
|
|
58
|
+
|
|
59
|
+
$ pip install useful_rdkit_utils[all]
|
|
60
|
+
|
|
61
|
+
Running the tests
|
|
62
|
+
-----------------
|
|
63
|
+
Some of the tests download data from the internet and are marked ``network``.
|
|
64
|
+
To run everything else:
|
|
65
|
+
|
|
66
|
+
.. code-block:: shell
|
|
67
|
+
|
|
68
|
+
$ pip install -e .[tests,all]
|
|
69
|
+
$ pytest -m "not network"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Silly Walks
|
|
2
|
+
===========
|
|
3
|
+
Flag molecules that contain substructures unlike anything in a reference set, by
|
|
4
|
+
scoring the fraction of a molecule's Morgan fingerprint bits that do not appear
|
|
5
|
+
in a count dictionary built from that reference set. The
|
|
6
|
+
:doc:`silly_walks <cli>` command line tool builds the count dictionary.
|
|
7
|
+
|
|
8
|
+
.. automodule:: useful_rdkit_utils.silly_walks
|
|
9
|
+
:members:
|
|
@@ -21,7 +21,8 @@ classifiers = [
|
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
23
|
'numpy',
|
|
24
|
-
|
|
24
|
+
# 2026.9.2 macOS arm64 PyPI wheels break MurckoDecompose (rdkit/rdkit#9836)
|
|
25
|
+
'rdkit!=2026.9.2',
|
|
25
26
|
'pandas',
|
|
26
27
|
'pystow',
|
|
27
28
|
'matplotlib',
|
|
@@ -47,7 +48,6 @@ all = ['click', 'ipython']
|
|
|
47
48
|
docs = [
|
|
48
49
|
'sphinx',
|
|
49
50
|
'sphinx-autodoc-typehints',
|
|
50
|
-
'sphinx-click',
|
|
51
51
|
'sphinx-automodapi',
|
|
52
52
|
'sphinx-rtd-theme',
|
|
53
53
|
]
|