helmkit 0.1.0__tar.gz → 0.3.0__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.
- {helmkit-0.1.0 → helmkit-0.3.0}/PKG-INFO +23 -4
- {helmkit-0.1.0 → helmkit-0.3.0}/README.md +22 -3
- helmkit-0.3.0/benchmarks/README.md +55 -0
- {helmkit-0.1.0/tests → helmkit-0.3.0/benchmarks}/data/monomers.sdf +1155 -0
- helmkit-0.3.0/benchmarks/helmkit-benchmark.py +30 -0
- helmkit-0.3.0/benchmarks/helmkit-parallel-benchmark.py +29 -0
- helmkit-0.3.0/benchmarks/helmkit-with-reload-benchmark.py +29 -0
- helmkit-0.3.0/benchmarks/pypept-benchmark.py +34 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/pyproject.toml +5 -1
- helmkit-0.3.0/src/helmkit/__init__.py +11 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/src/helmkit/molecule.py +15 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/tests/data/generate_sdf.py +5 -2
- helmkit-0.3.0/tests/data/monomers.sdf +23797 -0
- helmkit-0.3.0/tests/data/peptides.csv +7299 -0
- helmkit-0.3.0/tests/test_parallel_load.py +42 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/uv.lock +257 -1
- helmkit-0.1.0/src/helmkit/__init__.py +0 -5
- {helmkit-0.1.0 → helmkit-0.3.0}/.gitignore +0 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/.python-version +0 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/LICENSE +0 -0
- {helmkit-0.1.0/tests → helmkit-0.3.0/benchmarks}/data/peptides.csv +0 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/src/helmkit/data/monomers.sdf +0 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/src/helmkit/py.typed +0 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/tests/cycpeptmpdb.py +0 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/tests/data/monomers.csv +0 -0
- {helmkit-0.1.0 → helmkit-0.3.0}/tests/random_peptides.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: helmkit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Parse HELM strings into RDKit molecules
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Requires-Python: >=3.11
|
|
@@ -17,7 +17,7 @@ A Python library for converting HELM (Hierarchical Editing Language for Macromol
|
|
|
17
17
|
from helmkit import Molecule
|
|
18
18
|
|
|
19
19
|
# Create a molecule from a HELM string
|
|
20
|
-
helm_string = "PEPTIDE1{A.R.G}
|
|
20
|
+
helm_string = "PEPTIDE1{A.R.G}$$$$"
|
|
21
21
|
molecule = Molecule(helm_string)
|
|
22
22
|
|
|
23
23
|
# Access the RDKit molecule object
|
|
@@ -31,7 +31,7 @@ from helmkit import Molecule
|
|
|
31
31
|
from rdkit.Chem import AllChem, Draw
|
|
32
32
|
|
|
33
33
|
# Create a simple tripeptide (Ala-Arg-Gly)
|
|
34
|
-
molecule = Molecule("PEPTIDE1{A.R.G}
|
|
34
|
+
molecule = Molecule("PEPTIDE1{A.R.G}$$$$")
|
|
35
35
|
|
|
36
36
|
# Generate 2D coordinates for visualization
|
|
37
37
|
AllChem.Compute2DCoords(molecule.mol)
|
|
@@ -67,7 +67,7 @@ custom_sdf_path = "/path/to/your/custom_monomers.sdf"
|
|
|
67
67
|
custom_monomers = load_monomer_library(custom_sdf_path)
|
|
68
68
|
|
|
69
69
|
# Create molecule with custom monomer data
|
|
70
|
-
molecule = Molecule("PEPTIDE1{A.R.G}
|
|
70
|
+
molecule = Molecule("PEPTIDE1{A.R.G}$$$$", monomer_df=custom_monomers)
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
## SDF File Structure Requirements
|
|
@@ -110,3 +110,22 @@ Ala
|
|
|
110
110
|
|
|
111
111
|
$$$$
|
|
112
112
|
```
|
|
113
|
+
|
|
114
|
+
## Parallel Processing of Peptides
|
|
115
|
+
|
|
116
|
+
For workflows involving a large number of peptides, `helmkit` provides a function to process them in parallel, significantly improving performance.
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from helmkit import load_monomer_library
|
|
120
|
+
from helmkit import load_peptides_in_parallel
|
|
121
|
+
|
|
122
|
+
# Load your custom monomer data (optional)
|
|
123
|
+
custom_sdf_path = "/path/to/your/custom_monomers.sdf"
|
|
124
|
+
monomer_db = load_monomer_library(custom_sdf_path)
|
|
125
|
+
|
|
126
|
+
# A list of HELM strings
|
|
127
|
+
helm_strings = ["PEPTIDE1{A.R.G}$$$$", "PEPTIDE1{S.G.T}$$$$"]
|
|
128
|
+
|
|
129
|
+
# Process peptides in parallel
|
|
130
|
+
molecules = load_peptides_in_parallel(helm_strings, monomer_db)
|
|
131
|
+
```
|
|
@@ -8,7 +8,7 @@ A Python library for converting HELM (Hierarchical Editing Language for Macromol
|
|
|
8
8
|
from helmkit import Molecule
|
|
9
9
|
|
|
10
10
|
# Create a molecule from a HELM string
|
|
11
|
-
helm_string = "PEPTIDE1{A.R.G}
|
|
11
|
+
helm_string = "PEPTIDE1{A.R.G}$$$$"
|
|
12
12
|
molecule = Molecule(helm_string)
|
|
13
13
|
|
|
14
14
|
# Access the RDKit molecule object
|
|
@@ -22,7 +22,7 @@ from helmkit import Molecule
|
|
|
22
22
|
from rdkit.Chem import AllChem, Draw
|
|
23
23
|
|
|
24
24
|
# Create a simple tripeptide (Ala-Arg-Gly)
|
|
25
|
-
molecule = Molecule("PEPTIDE1{A.R.G}
|
|
25
|
+
molecule = Molecule("PEPTIDE1{A.R.G}$$$$")
|
|
26
26
|
|
|
27
27
|
# Generate 2D coordinates for visualization
|
|
28
28
|
AllChem.Compute2DCoords(molecule.mol)
|
|
@@ -58,7 +58,7 @@ custom_sdf_path = "/path/to/your/custom_monomers.sdf"
|
|
|
58
58
|
custom_monomers = load_monomer_library(custom_sdf_path)
|
|
59
59
|
|
|
60
60
|
# Create molecule with custom monomer data
|
|
61
|
-
molecule = Molecule("PEPTIDE1{A.R.G}
|
|
61
|
+
molecule = Molecule("PEPTIDE1{A.R.G}$$$$", monomer_df=custom_monomers)
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## SDF File Structure Requirements
|
|
@@ -101,3 +101,22 @@ Ala
|
|
|
101
101
|
|
|
102
102
|
$$$$
|
|
103
103
|
```
|
|
104
|
+
|
|
105
|
+
## Parallel Processing of Peptides
|
|
106
|
+
|
|
107
|
+
For workflows involving a large number of peptides, `helmkit` provides a function to process them in parallel, significantly improving performance.
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from helmkit import load_monomer_library
|
|
111
|
+
from helmkit import load_peptides_in_parallel
|
|
112
|
+
|
|
113
|
+
# Load your custom monomer data (optional)
|
|
114
|
+
custom_sdf_path = "/path/to/your/custom_monomers.sdf"
|
|
115
|
+
monomer_db = load_monomer_library(custom_sdf_path)
|
|
116
|
+
|
|
117
|
+
# A list of HELM strings
|
|
118
|
+
helm_strings = ["PEPTIDE1{A.R.G}$$$$", "PEPTIDE1{S.G.T}$$$$"]
|
|
119
|
+
|
|
120
|
+
# Process peptides in parallel
|
|
121
|
+
molecules = load_peptides_in_parallel(helm_strings, monomer_db)
|
|
122
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Benchmarks
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This benchmark evaluates the **reading speed** of
|
|
6
|
+
[`helmkit`](https://github.com/adaliaramon/helmkit) and
|
|
7
|
+
[`pyPept`](https://github.com/Boehringer-Ingelheim/pyPept) for parsing HELM notation
|
|
8
|
+
strings into RDKit molecules. The goal is to compare their performance and usability
|
|
9
|
+
differences when processing peptides in HELM format.
|
|
10
|
+
|
|
11
|
+
## Feature Comparison
|
|
12
|
+
|
|
13
|
+
The libraries differ in key implementation aspects that affect speed and robustness:
|
|
14
|
+
|
|
15
|
+
| Feature | `pyPept` | `helmkit` |
|
|
16
|
+
| ----------------------------- | ---------------------------------------------------- | ------------------------ |
|
|
17
|
+
| **Monomer library loading** | Reloaded for every peptide | Loaded once per session |
|
|
18
|
+
| **Conversion path** | HELM → BILN → Sequence → RDKit | HELM → RDKit |
|
|
19
|
+
| **Dependencies** | `rdkit`, `pandas`, `biopython`, `requests`, `igraph` | `rdkit` |
|
|
20
|
+
| **Monomer library input** | Requires directory + library name | Requires only file path |
|
|
21
|
+
| **Directory format** | Must be a Python module (with `__init__.py`) | No such requirement |
|
|
22
|
+
| **Monomer format strictness** | Very strict (e.g., fails on parentheses, dashes) | More tolerant |
|
|
23
|
+
| **Error handling** | Exits the process on error | Raises Python exceptions |
|
|
24
|
+
|
|
25
|
+
These differences influence both speed and ease of use, especially the monomer library
|
|
26
|
+
loading and conversion path.
|
|
27
|
+
|
|
28
|
+
## Reading Speed Results
|
|
29
|
+
|
|
30
|
+
We used the [CycPeptMPDB](http://cycpeptmpdb.com/peptides/type_PAMPA/) dataset,
|
|
31
|
+
comprising 7,298 cyclic peptides in HELM format. Peptides including monomers with names
|
|
32
|
+
that `pyPept` cannot handle were excluded (monomers with names containing whitespace,
|
|
33
|
+
hyphens or parenthesis), resulting in a total of 4694 peptides. We measured the total
|
|
34
|
+
and average parsing time:
|
|
35
|
+
|
|
36
|
+
| Tool | Total Time (s) | Avg Time per Peptide (s) |
|
|
37
|
+
|-------------------------------------|----------------|--------------------------|
|
|
38
|
+
| `pyPept` | 676.65 | 0.144 |
|
|
39
|
+
| `helmkit` | 3.60 | 0.00077 |
|
|
40
|
+
| `helmkit` (DB reload every peptide) | 261.81 | 0.056 |
|
|
41
|
+
|
|
42
|
+
`helmkit` outperforms `pyPept` by approximately 188× when loading the monomer library
|
|
43
|
+
once per session. When forced to reload the library for every peptide (needs disabling
|
|
44
|
+
memoization in the source code), `helmkit` is still about 3× faster.
|
|
45
|
+
|
|
46
|
+
## Environment
|
|
47
|
+
|
|
48
|
+
Benchmarks were run on an Intel Core i7-4790 (4 cores, 8 threads, 3.6 GHz) with 31.1 GiB
|
|
49
|
+
RAM and SSD storage, using Python 3.12.10 on Arch Linux (kernel 6.15.7). Key package
|
|
50
|
+
versions:
|
|
51
|
+
|
|
52
|
+
- `polars 1.31.0` (CSV parsing and dataframe processing)
|
|
53
|
+
- `rdkit 2025.3.3` (target output format and structure processing)
|
|
54
|
+
- `pypept 1.0.0` (commit `ade9f5840691ad1f8fa22d13939a665c25175d5a`)
|
|
55
|
+
- `helmkit 0.1.0` (local development version)
|