useful-rdkit-utils 2.0__tar.gz → 2.0.1__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.
Files changed (95) hide show
  1. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/.readthedocs.yaml +2 -3
  2. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/CHANGELOG.md +29 -0
  3. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/PKG-INFO +29 -9
  4. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/README.md +28 -7
  5. useful_rdkit_utils-2.0.1/docs/source/cli.rst +66 -0
  6. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/conf.py +12 -14
  7. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/index.rst +11 -1
  8. useful_rdkit_utils-2.0.1/docs/source/installation.rst +69 -0
  9. useful_rdkit_utils-2.0.1/docs/source/optional.rst +7 -0
  10. useful_rdkit_utils-2.0.1/docs/source/silly_walks.rst +9 -0
  11. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/pyproject.toml +0 -1
  12. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/__init__.py +1 -1
  13. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/descriptor_preprocessor.py +1 -1
  14. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/descriptors.py +13 -23
  15. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/reactions.py +5 -5
  16. useful_rdkit_utils-2.0/docs/source/installation.rst +0 -28
  17. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/.gitattributes +0 -0
  18. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/.github/CONTRIBUTING.md +0 -0
  19. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/.github/PUBLISHING.md +0 -0
  20. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  21. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/.github/workflows/CI.yaml +0 -0
  22. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/.github/workflows/publish.yaml +0 -0
  23. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/.gitignore +0 -0
  24. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/CODE_OF_CONDUCT.md +0 -0
  25. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/LICENSE +0 -0
  26. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/MANIFEST.in +0 -0
  27. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/data/chembl_ring_systems.csv +0 -0
  28. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/data/test.smi +0 -0
  29. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/Makefile +0 -0
  30. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/descriptor_preprocessor.rst +0 -0
  31. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/descriptors.rst +0 -0
  32. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/geometry.rst +0 -0
  33. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/jupyter.rst +0 -0
  34. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/misc_utils.rst +0 -0
  35. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/model_comparison.rst +0 -0
  36. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/pandas.rst +0 -0
  37. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/reactions.rst +0 -0
  38. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/reos.rst +0 -0
  39. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/ring_systems.rst +0 -0
  40. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/sali.rst +0 -0
  41. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/scaffold_finder.rst +0 -0
  42. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/seaborn.rst +0 -0
  43. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/split_utils.rst +0 -0
  44. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/stats.rst +0 -0
  45. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/docs/source/units.rst +0 -0
  46. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/nikki.png +0 -0
  47. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/README.md +0 -0
  48. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/bootstrap_AUC.ipynb +0 -0
  49. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/catboost_wrapper.py +0 -0
  50. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/compare_mordred_rdkit.ipynb +0 -0
  51. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/data/biogen_logS.csv +0 -0
  52. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/demo_REOS.ipynb +0 -0
  53. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/demo_cross_validate.ipynb +0 -0
  54. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/demo_descriptors.ipynb +0 -0
  55. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/demo_ring_systems.ipynb +0 -0
  56. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/demo_useful_rdkit_utils.ipynb +0 -0
  57. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/explore_functional_group_filters.ipynb +0 -0
  58. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/ffnn.py +0 -0
  59. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/lgbm_wrapper.py +0 -0
  60. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/model_comparison.ipynb +0 -0
  61. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/parallel_conformer_generation.ipynb +0 -0
  62. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/sort_and_slice_ecfp_featuriser.py +0 -0
  63. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/notebooks/zinc_sample.smi +0 -0
  64. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/__init__.py +0 -0
  65. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test.smi +0 -0
  66. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_audit_fixes.py +0 -0
  67. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_chemreps.txt +0 -0
  68. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_descriptor_preprocessor.py +0 -0
  69. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_descriptors.py +0 -0
  70. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_geometry.py +0 -0
  71. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_model_comparison.py +0 -0
  72. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_reactions.py +0 -0
  73. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_reos.py +0 -0
  74. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_ring_systems.py +0 -0
  75. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_sali.py +0 -0
  76. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_scaffold_finder.py +0 -0
  77. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_silly_walks.py +0 -0
  78. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_split_utils.py +0 -0
  79. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/tests/test_useful_rdkit_utils.py +0 -0
  80. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/build_ring_dictionary.py +0 -0
  81. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/geometry.py +0 -0
  82. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/jupyter_utils.py +0 -0
  83. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/misc_utils.py +0 -0
  84. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/model_comparison.py +0 -0
  85. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/optional.py +0 -0
  86. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/pandas_utils.py +0 -0
  87. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/reos.py +0 -0
  88. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/ring_systems.py +0 -0
  89. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/sali.py +0 -0
  90. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/scaffold_finder.py +0 -0
  91. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/seaborn_utils.py +0 -0
  92. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/silly_walks.py +0 -0
  93. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/split_utils.py +0 -0
  94. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/useful_rdkit_utils/stat_utils.py +0 -0
  95. {useful_rdkit_utils-2.0 → useful_rdkit_utils-2.0.1}/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; "extras" brings click, which
26
- # sphinx-click needs to document the build_ring_dictionary command.
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,35 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  ## [Unreleased]
5
5
 
6
+ ## [2.0.1] - 2026-08-27
7
+ ### Added
8
+ - Documentation pages for the three modules that had none: silly_walks, optional, and a Command Line
9
+ Tools page covering the `build_ring_dictionary` and `silly_walks` console scripts added in 2.0.
10
+ - sphinx.ext.napoleon. The package mixes two docstring styles, and the NumPy-style Parameters/Attributes
11
+ sections in descriptor_preprocessor and model_comparison were rendering as a run of unformatted text
12
+ because nothing was parsing them.
13
+ - installation.rst and README.md document all of the optional extras (`extras`, `jupyter`, `all`, `docs`,
14
+ `tests`), what each one brings in, and how to run the test suite.
15
+ ### Changed
16
+ - conf.py reads the version out of useful_rdkit_utils/__init__.py, the same place hatchling reads it, so
17
+ 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.
18
+ - index.rst splits the toctree into "Getting Started" and "API Reference".
19
+ - Dropped sphinx-click. Version 6.2.0 does `from sphinx.ext.autodoc import mock`, which resolves to the
20
+ submodule rather than the function on Sphinx 9, so the `.. click::` directive raises
21
+ "TypeError: 'module' object is not callable". The two CLIs are documented by hand instead, which also
22
+ keeps them consistent, since silly_walks uses argparse and sphinx-click only handles click.
23
+ - .readthedocs.yaml no longer installs the `extras` extra for the docs build. Nothing autodoc imports
24
+ pulls in click or IPython at module level.
25
+ ### Fixed
26
+ - The docs build is clean: 14 Sphinx warnings and docutils errors down to 0.
27
+ - Docstring markup that docutils could not parse: the code snippets in mol2morgan_fp() and smi2morgan_fp()
28
+ are literal blocks rather than unexpected indentation, the `:param`/`:return` continuation lines in
29
+ enumerate_library() and enumerate_library_sample() are indented so the field lists do not terminate
30
+ early, and the trailing-underscore identifiers ("fr_", `n_features_out_`) are escaped rather than read
31
+ as references to undefined targets.
32
+ - Removed the Methods section from Ro5Calculator's docstring. It duplicated what autodoc already generates
33
+ from the methods themselves, producing four "duplicate object description" warnings.
34
+
6
35
  ## [2.0] - 2026-08-21
7
36
  ### Added
8
37
  - 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.1
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
@@ -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
- ### Download
53
+ ### Installation
54
+ Requires Python 3.11 or newer.
55
55
  ```bash
56
- git clone git@github.com:PatWalters/useful_rdkit_utils.git
56
+ pip install useful_rdkit_utils
57
57
  ```
58
58
 
59
- ### Installation
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
- [https://useful-rdkit-utils.rtfd.io](https://useful-rdkit-utils.rtfd.io)
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-2025, Pat Walters
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
- ### Download
11
+ ### Installation
12
+ Requires Python 3.11 or newer.
12
13
  ```bash
13
- git clone git@github.com:PatWalters/useful_rdkit_utils.git
14
+ pip install useful_rdkit_utils
14
15
  ```
15
16
 
16
- ### Installation
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
- [https://useful-rdkit-utils.rtfd.io](https://useful-rdkit-utils.rtfd.io)
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-2025, Pat Walters
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
- release = '1.0.0'
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
- parsed_version = re.match(
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
- descriptor_preprocessor
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,7 @@
1
+ Optional
2
+ ========
3
+ Functions that are kept out of the main modules to hold down the dependency
4
+ burden, or because they are worked examples rather than recommended practice.
5
+
6
+ .. automodule:: useful_rdkit_utils.optional
7
+ :members:
@@ -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:
@@ -47,7 +47,6 @@ all = ['click', 'ipython']
47
47
  docs = [
48
48
  'sphinx',
49
49
  'sphinx-autodoc-typehints',
50
- 'sphinx-click',
51
50
  'sphinx-automodapi',
52
51
  'sphinx-rtd-theme',
53
52
  ]
@@ -21,4 +21,4 @@ from .model_comparison import *
21
21
  from .descriptor_preprocessor import *
22
22
  from .silly_walks import *
23
23
 
24
- __version__ = "2.0"
24
+ __version__ = "2.0.1"
@@ -215,7 +215,7 @@ class DescriptorPreprocessor(BaseEstimator, TransformerMixin):
215
215
 
216
216
  Returns
217
217
  -------
218
- X_out : ndarray of shape (n_samples, n_features_out_)
218
+ X_out : ndarray of shape ``(n_samples, n_features_out_)``
219
219
  Cleaned, imputed, and (optionally) standardized matrix.
220
220
 
221
221
  Raises
@@ -101,10 +101,12 @@ class Smi2Fp:
101
101
  def mol2morgan_fp(mol: Mol, radius: int = 2, nBits: int = 2048) -> DataStructs.ExplicitBitVect:
102
102
  """
103
103
  Convert an RDKit molecule to a Morgan fingerprint
104
- To avoid the rdkit deprecated warning, do this
105
- from rdkit import rdBase
106
- with rdBase.BlockLogs():
107
- uru.smi2numpy_fp("CCC")
104
+
105
+ To avoid the rdkit deprecated warning, do this::
106
+
107
+ from rdkit import rdBase
108
+ with rdBase.BlockLogs():
109
+ uru.smi2numpy_fp("CCC")
108
110
 
109
111
  :param mol: RDKit molecule
110
112
  :param radius: fingerprint radius
@@ -118,10 +120,12 @@ def mol2morgan_fp(mol: Mol, radius: int = 2, nBits: int = 2048) -> DataStructs.E
118
120
 
119
121
  def smi2morgan_fp(smi: str, radius: int = 2, nBits: int = 2048) -> Optional[DataStructs.ExplicitBitVect]:
120
122
  """Convert a SMILES to a Morgan fingerprint
121
- To avoid the rdkit deprecated warning, do this
122
- from rdkit import rdBase
123
- with rdBase.BlockLogs():
124
- uru.smi2numpy_fp("CCC")
123
+
124
+ To avoid the rdkit deprecated warning, do this::
125
+
126
+ from rdkit import rdBase
127
+ with rdBase.BlockLogs():
128
+ uru.smi2numpy_fp("CCC")
125
129
 
126
130
  :param smi: SMILES
127
131
  :param radius: fingerprint radius
@@ -190,7 +194,7 @@ class RDKitDescriptors:
190
194
 
191
195
  :param desc_names: Optional list of descriptor names to use. If not provided, the full RDKit descriptor list is used.
192
196
  :param hide_progress: If true, progress bars are disabled when processing lists.
193
- :param skip_fragments: If true, descriptors whose names contain "fr_" are excluded.
197
+ :param skip_fragments: If true, descriptors whose names contain ``fr_`` are excluded.
194
198
  :raises ValueError: if desc_names contains a name the installed RDKit does not provide
195
199
  :return: None
196
200
  """
@@ -382,20 +386,6 @@ class Ro5Calculator:
382
386
  A list of names of the properties to be calculated.
383
387
  functions : List[Callable[[Mol], float]]
384
388
  A list of functions used to calculate the properties.
385
-
386
- Methods
387
- -------
388
- calc_mol(mol: Mol) -> np.ndarray
389
- Calculates properties for a RDKit molecule.
390
-
391
- calc_smiles(smi: str) -> Optional[np.ndarray]
392
- Calculates properties for a SMILES string.
393
-
394
- pandas_smiles(smiles_list: List[str]) -> pd.DataFrame
395
- Calculates properties for a list of SMILES strings and returns them as a pandas DataFrame.
396
-
397
- pandas_mols(mol_list: List[Mol]) -> pd.DataFrame
398
- Calculates properties for a list of RDKit molecules and returns them as a pandas DataFrame.
399
389
  """
400
390
 
401
391
  def __init__(self: "Ro5Calculator") -> None:
@@ -32,10 +32,10 @@ def enumerate_library(rxn_mol: ChemicalReaction, reagent_lol: List[List[Mol]]) -
32
32
 
33
33
  :param rxn_mol: A chemical reaction represented as an RDKit ChemicalReaction object.
34
34
  :param reagent_lol: A list of lists, where each inner list represents a set of reagents. Each reagent is an
35
- RDKit Mol object. The molecule object must have a "_Name" property that contains a string identifier.
35
+ RDKit Mol object. The molecule object must have a "_Name" property that contains a string identifier.
36
36
  :return: A list of lists, where each inner list represents a product. Each product is represented as a list
37
- containing a SMILES string of the product and a string identifier formed by joining the identifiers of
38
- the reagents used to form the product.
37
+ containing a SMILES string of the product and a string identifier formed by joining the identifiers of
38
+ the reagents used to form the product.
39
39
  """
40
40
  prod_list = []
41
41
  num_failed = 0
@@ -62,10 +62,10 @@ def enumerate_library_sample(rxn: ChemicalReaction, reagent_lol: List[List[Mol]]
62
62
 
63
63
  :param rxn: A chemical reaction represented as an RDKit ChemicalReaction object.
64
64
  :param reagent_lol: A list of lists, where each inner list represents a set of reagents. Each reagent is an
65
- RDKit Mol object. The molecule object must have a "_Name" property that contains a string identifier.
65
+ RDKit Mol object. The molecule object must have a "_Name" property that contains a string identifier.
66
66
  :param num_to_generate: The number of products to generate.
67
67
  :return: A pandas DataFrame with the generated products. Each row contains a SMILES string of the product and a
68
- string identifier.
68
+ string identifier.
69
69
  """
70
70
  used = set()
71
71
  prod_list = []
@@ -1,28 +0,0 @@
1
- Installation
2
- ============
3
- The most recent release can be installed from
4
- `PyPI <https://pypi.org/project/useful_rdkit_utils>`_ with:
5
-
6
- .. code-block:: shell
7
-
8
- $ pip install useful_rdkit_utils
9
-
10
- To get the extras, install with:
11
-
12
- .. code-block:: shell
13
-
14
- $ pip install useful_rdkit_utils[extras]
15
-
16
- The most recent code and data can be installed directly from GitHub with:
17
-
18
- .. code-block:: shell
19
-
20
- $ pip install git+https://github.com/PatWalters/useful_rdkit_utils.git
21
-
22
- To install in development mode, use the following:
23
-
24
- .. code-block:: shell
25
-
26
- $ git clone https://github.com/PatWalters/useful_rdkit_utils.git
27
- $ cd useful_rdkit_utils
28
- $ pip install -e .