helmkit 0.5.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.
@@ -0,0 +1,10 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
@@ -0,0 +1 @@
1
+ 3.12
helmkit-0.5.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 adaliaramon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
helmkit-0.5.1/PKG-INFO ADDED
@@ -0,0 +1,182 @@
1
+ Metadata-Version: 2.4
2
+ Name: helmkit
3
+ Version: 0.5.1
4
+ Summary: Parse HELM strings into RDKit molecules
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: rdkit>=2025.3.3
8
+ Description-Content-Type: text/markdown
9
+
10
+ # helmkit
11
+
12
+ A Python library for converting HELM (Hierarchical Editing Language for Macromolecules) notation to RDKit molecules.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Basic Usage](#basic-usage)
17
+ - [Installation](#installation)
18
+ - [Quick Example](#quick-example)
19
+ - [Understanding HELM Notation](#understanding-helm-notation)
20
+ - [Using Custom Monomer Data](#using-custom-monomer-data)
21
+ - [SDF File Structure Requirements](#sdf-file-structure-requirements)
22
+ - [Parallel Processing of Peptides](#parallel-processing-of-peptides)
23
+ - [Development Setup](#development-setup)
24
+ - [Running Tests](#running-tests)
25
+
26
+ ## Basic Usage
27
+
28
+ ```python
29
+ from helmkit import Molecule
30
+
31
+ # Create a molecule from a HELM string
32
+ helm_string = "PEPTIDE1{A.R.G}$$$$"
33
+ molecule = Molecule(helm_string)
34
+
35
+ # Access the RDKit molecule object
36
+ rdkit_mol = molecule.mol
37
+ ```
38
+
39
+ ## Installation
40
+
41
+ To install `helmkit`, you can use either [`uv`](https://github.com/astral-sh/uv) or `pip`.
42
+
43
+ ### With [`uv`](https://github.com/astral-sh/uv)
44
+
45
+ ```bash
46
+ uv pip install helmkit
47
+ ```
48
+
49
+ or if you have added it as a dependency to your `pyproject.toml`:
50
+
51
+ ```bash
52
+ uv add helmkit
53
+ ```
54
+
55
+ ### Without `uv`
56
+
57
+ ```bash
58
+ pip install helmkit
59
+ ```
60
+
61
+ ## Quick Example
62
+
63
+ ```python
64
+ from helmkit import Molecule
65
+ from rdkit.Chem import AllChem, Draw
66
+
67
+ # Create a simple tripeptide (Ala-Arg-Gly)
68
+ molecule = Molecule("PEPTIDE1{A.R.G}$$$$")
69
+
70
+ # Generate 2D coordinates for visualization
71
+ AllChem.Compute2DCoords(molecule.mol)
72
+
73
+ # Save the image
74
+ img = Draw.MolToImage(molecule.mol)
75
+ img.save("tripeptide.png")
76
+ ```
77
+
78
+ ## Understanding HELM Notation
79
+
80
+ HELM (Hierarchical Editing Language for Macromolecules) is a notation for representing complex biomolecules. A basic HELM string has the following format:
81
+
82
+ ```
83
+ PEPTIDE1{A.R.G}|PEPTIDE2{S.G.C}$PEPTIDE1,PEPTIDE2,1:R1-3:R3$$$V2.0
84
+ ```
85
+
86
+ Where:
87
+ - `PEPTIDE1{A.R.G}` defines the first chain (a peptide with amino acids A, R, G)
88
+ - `PEPTIDE2{S.G.C}` defines the second chain
89
+ - `PEPTIDE1,PEPTIDE2,1:R1-3:R3` defines a connection between the chains (R1 of residue 1 in PEPTIDE1 connects to R3 of residue 3 in PEPTIDE2)
90
+ - `$` characters separate different sections of the HELM string
91
+
92
+ ## Using Custom Monomer Data
93
+
94
+ By default, helmkit uses the monomer data in `helmkit/data/monomers.sdf`. To use a custom SDF file:
95
+
96
+ ```python
97
+ from helmkit import Molecule, load_monomer_library
98
+
99
+ # Load your custom monomer data
100
+ custom_sdf_path = "/path/to/your/custom_monomers.sdf"
101
+ custom_monomers = load_monomer_library(custom_sdf_path)
102
+
103
+ # Create molecule with custom monomer data
104
+ molecule = Molecule("PEPTIDE1{A.R.G}$$$$", monomer_df=custom_monomers)
105
+ ```
106
+
107
+ ## SDF File Structure Requirements
108
+
109
+ The SDF file containing monomer data must have the following properties for each molecule:
110
+
111
+ ### Required Properties:
112
+ - `symbol`: A unique identifier for the monomer (e.g., "A" for alanine)
113
+ - `m_RgroupIdx`: Comma-separated list of R-group atom indices (e.g., "1,2,None,None")
114
+
115
+ ### Optional Properties:
116
+ - `m_Rgroups`: Comma-separated list of R-group types (e.g., "H,OH,None,None")
117
+ - `m_type`: Monomer type (e.g., "aa" for amino acid)
118
+ - `m_subtype`: Monomer subtype
119
+ - `m_abbr`: Monomer abbreviation
120
+
121
+ ### Example SDF Entry:
122
+
123
+ ```
124
+ Your molecule atom data here...
125
+ ...
126
+
127
+ > <symbol>
128
+ A
129
+
130
+ > <m_Rgroups>
131
+ H,OH,None,None
132
+
133
+ > <m_RgroupIdx>
134
+ 1,2,None,None
135
+
136
+ > <m_type>
137
+ aa
138
+
139
+ > <m_subtype>
140
+ natural
141
+
142
+ > <m_abbr>
143
+ Ala
144
+
145
+ $$$$
146
+ ```
147
+
148
+ ## Parallel Processing of Peptides
149
+
150
+ For workflows involving a large number of peptides, `helmkit` provides a function to process them in parallel, significantly improving performance.
151
+
152
+ ```python
153
+ from helmkit import load_monomer_library
154
+ from helmkit import load_peptides_in_parallel
155
+
156
+ # Load your custom monomer data (optional)
157
+ custom_sdf_path = "/path/to/your/custom_monomers.sdf"
158
+ monomer_db = load_monomer_library(custom_sdf_path)
159
+
160
+ # A list of HELM strings
161
+ helm_strings = ["PEPTIDE1{A.R.G}$$$$", "PEPTIDE1{S.G.T}$$$$"]
162
+
163
+ # Process peptides in parallel
164
+ molecules = load_peptides_in_parallel(helm_strings, monomer_db)
165
+ ```
166
+
167
+ ## Development Setup
168
+
169
+ To set up a development environment, first clone the repository.
170
+ Then, from the root of the repository, use `uv` to sync the environment:
171
+
172
+ ```bash
173
+ uv sync -U
174
+ ```
175
+
176
+ ## Running Tests
177
+
178
+ To run the test suite, execute `pytest` from the root of the repository:
179
+
180
+ ```bash
181
+ pytest
182
+ ```
@@ -0,0 +1,173 @@
1
+ # helmkit
2
+
3
+ A Python library for converting HELM (Hierarchical Editing Language for Macromolecules) notation to RDKit molecules.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Basic Usage](#basic-usage)
8
+ - [Installation](#installation)
9
+ - [Quick Example](#quick-example)
10
+ - [Understanding HELM Notation](#understanding-helm-notation)
11
+ - [Using Custom Monomer Data](#using-custom-monomer-data)
12
+ - [SDF File Structure Requirements](#sdf-file-structure-requirements)
13
+ - [Parallel Processing of Peptides](#parallel-processing-of-peptides)
14
+ - [Development Setup](#development-setup)
15
+ - [Running Tests](#running-tests)
16
+
17
+ ## Basic Usage
18
+
19
+ ```python
20
+ from helmkit import Molecule
21
+
22
+ # Create a molecule from a HELM string
23
+ helm_string = "PEPTIDE1{A.R.G}$$$$"
24
+ molecule = Molecule(helm_string)
25
+
26
+ # Access the RDKit molecule object
27
+ rdkit_mol = molecule.mol
28
+ ```
29
+
30
+ ## Installation
31
+
32
+ To install `helmkit`, you can use either [`uv`](https://github.com/astral-sh/uv) or `pip`.
33
+
34
+ ### With [`uv`](https://github.com/astral-sh/uv)
35
+
36
+ ```bash
37
+ uv pip install helmkit
38
+ ```
39
+
40
+ or if you have added it as a dependency to your `pyproject.toml`:
41
+
42
+ ```bash
43
+ uv add helmkit
44
+ ```
45
+
46
+ ### Without `uv`
47
+
48
+ ```bash
49
+ pip install helmkit
50
+ ```
51
+
52
+ ## Quick Example
53
+
54
+ ```python
55
+ from helmkit import Molecule
56
+ from rdkit.Chem import AllChem, Draw
57
+
58
+ # Create a simple tripeptide (Ala-Arg-Gly)
59
+ molecule = Molecule("PEPTIDE1{A.R.G}$$$$")
60
+
61
+ # Generate 2D coordinates for visualization
62
+ AllChem.Compute2DCoords(molecule.mol)
63
+
64
+ # Save the image
65
+ img = Draw.MolToImage(molecule.mol)
66
+ img.save("tripeptide.png")
67
+ ```
68
+
69
+ ## Understanding HELM Notation
70
+
71
+ HELM (Hierarchical Editing Language for Macromolecules) is a notation for representing complex biomolecules. A basic HELM string has the following format:
72
+
73
+ ```
74
+ PEPTIDE1{A.R.G}|PEPTIDE2{S.G.C}$PEPTIDE1,PEPTIDE2,1:R1-3:R3$$$V2.0
75
+ ```
76
+
77
+ Where:
78
+ - `PEPTIDE1{A.R.G}` defines the first chain (a peptide with amino acids A, R, G)
79
+ - `PEPTIDE2{S.G.C}` defines the second chain
80
+ - `PEPTIDE1,PEPTIDE2,1:R1-3:R3` defines a connection between the chains (R1 of residue 1 in PEPTIDE1 connects to R3 of residue 3 in PEPTIDE2)
81
+ - `$` characters separate different sections of the HELM string
82
+
83
+ ## Using Custom Monomer Data
84
+
85
+ By default, helmkit uses the monomer data in `helmkit/data/monomers.sdf`. To use a custom SDF file:
86
+
87
+ ```python
88
+ from helmkit import Molecule, load_monomer_library
89
+
90
+ # Load your custom monomer data
91
+ custom_sdf_path = "/path/to/your/custom_monomers.sdf"
92
+ custom_monomers = load_monomer_library(custom_sdf_path)
93
+
94
+ # Create molecule with custom monomer data
95
+ molecule = Molecule("PEPTIDE1{A.R.G}$$$$", monomer_df=custom_monomers)
96
+ ```
97
+
98
+ ## SDF File Structure Requirements
99
+
100
+ The SDF file containing monomer data must have the following properties for each molecule:
101
+
102
+ ### Required Properties:
103
+ - `symbol`: A unique identifier for the monomer (e.g., "A" for alanine)
104
+ - `m_RgroupIdx`: Comma-separated list of R-group atom indices (e.g., "1,2,None,None")
105
+
106
+ ### Optional Properties:
107
+ - `m_Rgroups`: Comma-separated list of R-group types (e.g., "H,OH,None,None")
108
+ - `m_type`: Monomer type (e.g., "aa" for amino acid)
109
+ - `m_subtype`: Monomer subtype
110
+ - `m_abbr`: Monomer abbreviation
111
+
112
+ ### Example SDF Entry:
113
+
114
+ ```
115
+ Your molecule atom data here...
116
+ ...
117
+
118
+ > <symbol>
119
+ A
120
+
121
+ > <m_Rgroups>
122
+ H,OH,None,None
123
+
124
+ > <m_RgroupIdx>
125
+ 1,2,None,None
126
+
127
+ > <m_type>
128
+ aa
129
+
130
+ > <m_subtype>
131
+ natural
132
+
133
+ > <m_abbr>
134
+ Ala
135
+
136
+ $$$$
137
+ ```
138
+
139
+ ## Parallel Processing of Peptides
140
+
141
+ For workflows involving a large number of peptides, `helmkit` provides a function to process them in parallel, significantly improving performance.
142
+
143
+ ```python
144
+ from helmkit import load_monomer_library
145
+ from helmkit import load_peptides_in_parallel
146
+
147
+ # Load your custom monomer data (optional)
148
+ custom_sdf_path = "/path/to/your/custom_monomers.sdf"
149
+ monomer_db = load_monomer_library(custom_sdf_path)
150
+
151
+ # A list of HELM strings
152
+ helm_strings = ["PEPTIDE1{A.R.G}$$$$", "PEPTIDE1{S.G.T}$$$$"]
153
+
154
+ # Process peptides in parallel
155
+ molecules = load_peptides_in_parallel(helm_strings, monomer_db)
156
+ ```
157
+
158
+ ## Development Setup
159
+
160
+ To set up a development environment, first clone the repository.
161
+ Then, from the root of the repository, use `uv` to sync the environment:
162
+
163
+ ```bash
164
+ uv sync -U
165
+ ```
166
+
167
+ ## Running Tests
168
+
169
+ To run the test suite, execute `pytest` from the root of the repository:
170
+
171
+ ```bash
172
+ pytest
173
+ ```
@@ -0,0 +1,38 @@
1
+ [project]
2
+ name = "helmkit"
3
+ version = "0.5.1"
4
+ description = "Parse HELM strings into RDKit molecules"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ dependencies = [
8
+ "rdkit>=2025.3.3",
9
+ ]
10
+
11
+ [build-system]
12
+ requires = ["hatchling"]
13
+ build-backend = "hatchling.build"
14
+
15
+ [dependency-groups]
16
+ dev = [
17
+ "dead>=2.1.0",
18
+ "polars>=1.31.0",
19
+ "pre-commit>=4.2.0",
20
+ "pypept",
21
+ "pytest>=8.4.1",
22
+ "pyupgrade>=3.20.0",
23
+ "reorder-python-imports>=3.15.0",
24
+ "tqdm>=4.67.1",
25
+ ]
26
+
27
+ [tool.uv.sources]
28
+ pypept = { git = "https://github.com/Boehringer-Ingelheim/pyPept.git" }
29
+
30
+ [tool.hatch.build]
31
+ exclude = [
32
+ ".github",
33
+ ".gitignore",
34
+ ".pre-commit-config.yaml",
35
+ "benchmarks",
36
+ "dev",
37
+ "tests",
38
+ ]
@@ -0,0 +1,11 @@
1
+ from .molecule import load_monomer_library
2
+ from .molecule import load_peptides_in_parallel
3
+ from .molecule import Molecule
4
+ from .molecule import SequenceConstants
5
+
6
+ __all__ = [
7
+ "load_monomer_library",
8
+ "load_peptides_in_parallel",
9
+ "Molecule",
10
+ "SequenceConstants",
11
+ ]