Skip to content

Commit 495d1a4

Browse files
committed
updated Readme file
1 parent 511eac3 commit 495d1a4

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

README.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,61 @@
44

55
This repository is maintained by the [KNIME Team Rakete](mailto:team-rakete@knime.com).
66

7-
It provides a template for creating KNIME Python extensions.
7+
It provides a template for creating a KNIME Python extension that integrates [RDKit](https://rdkit.org/docs/index.html) functionality.
88

99
## Contents
1010

11-
This repository contains a template KNIME Python Extensions.
11+
This repository contains a template KNIME Python Extension that integrates RDKit functionality.
12+
It contains one simple example node that counts the number of carbons in molecules provided in an input table.
13+
Note that this tutorial only works with KNIME AP version 5.6 or higher.
1214
The code is organized as follows:
1315

1416
```
1517
.
1618
├── icons
17-
── icon.png
19+
── icon.png
1820
├── src
21+
│ └── __init.py__
1922
│ └── extension.py
2023
├── demos
21-
│ └── Example_with_Python_node.knwf
24+
│ └── demo-chemistry-python-adapter.knwf
25+
├── tests
26+
│ ├── test
27+
│ └── conftest.py
28+
│ └── test_extension.py
2229
├── knime.yml
2330
├── pixi.toml
2431
├── config.yml
2532
│── LICENSE.TXT
2633
└── README.md
2734
```
2835

29-
## Instructions
36+
## General Instructions
3037

31-
You can find instructions on how to work with our code or develop python extensions for KNIME Analytics Platform in the KNIME documentation:
38+
You can find general instructions on how to work with our code or develop python extensions for KNIME Analytics Platform in the KNIME documentation:
3239
* [KNIME Python Extension](https://docs.knime.com/latest/pure_python_node_extensions_guide/index.html)
3340

34-
## Minimal Instructions to create a KNIME Python extension
41+
## Create a KNIME Python extension using RDKit based on this repository
3542
### Prerequisites:
3643
* [KNIME Analytics Platform](https://www.knime.com/downloads/overview)
3744
* [git](https://git-scm.com/downloads)
3845
* [pixi](https://pixi.sh/latest/)
3946

47+
4048
### Instructions:
41-
1. **Clone** this repository or use it as a **template** (click on the green "Use this template" button):
42-
2. **Edit** `knime.yml` - provide your metadata, license, ...
43-
3. _(Optional)_ Modify the `src/extension.py` file to implement your own logic.
49+
1. **Clone** this repository or use it as a **template** (click on the green "Use this template" button).
50+
2. **Edit** `knime.yml` to provide your metadata, license, etc. The last two lines of this file indicate that the extension created with this repository depends on the KNIME Base Chemistry Types & Nodes and the RDKit extensions.
51+
3. **Modify** the `src/extension.py` file or **add** further files to implement your own logic. Note that every py file equivalent to one node needs to be imported in the init.py file.
4452
4. _(Optional)_ Add python packages to the environment with the following command, or by manually editing the `pixi.toml` file:
4553
```bash
4654
pixi add <package_name>
4755
```
56+
If you leave the `pixi.toml` file unchanged, the Python environment that you will create in the next step will have the RDKit package installed per default.
4857
5. **Install** the python environment:
4958
```bash
5059
pixi install
5160
```
52-
6. **Test** the extension in the KNIME Analytics Platform with the extension in debug mode by adding the following line to the knime.ini file (adjust <path_to_this_repository> in the config.yml):
61+
6. **Test** the extension in the KNIME Analytics Platform with the extension in debug mode by adding the following line to the `knime.ini` file (adjust <path_to_this_repository> in the `config.yml`):
5362
```
5463
-Dknime.python.extension.config=<path/to/your/config.yml>
5564
```
@@ -71,6 +80,19 @@ You can find instructions on how to work with our code or develop python extensi
7180
7281
For detailed instructions on how to create a KNIME Python extension, please refer to the [KNIME Python Extension documentation](https://docs.knime.com/latest/pure_python_node_extensions_guide/index.html).
7382
83+
84+
### Background information:
85+
From KNIME AP version 5.6 on, the KNIME Base Chemistry Types & Nodes extension is shipped with extended adapator functionality between Python and Java.
86+
87+
It also provides two functions designed to simplify the work of node developers:
88+
89+
`to_rdkit_series`: convert a pandas series of KNIME chemistry types to a series of RDKit Mol objects
90+
91+
`is_molecule`: True if the column holds any supported chemistry type
92+
93+
The adaptor file can be found in the following location of the KNIME AP installation /plugins/org.knime.chem.types_<version>/python/src/org/knime/types/chemistry.py.
94+
95+
7496
## Join the Community
7597
7698
* [KNIME Forum](https://forum.knime.com)

0 commit comments

Comments
 (0)