helmkit 0.1.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/.gitignore +10 -0
- helmkit-0.1.0/.python-version +1 -0
- helmkit-0.1.0/LICENSE +21 -0
- helmkit-0.1.0/PKG-INFO +112 -0
- helmkit-0.1.0/README.md +103 -0
- helmkit-0.1.0/pyproject.toml +21 -0
- helmkit-0.1.0/src/helmkit/__init__.py +5 -0
- helmkit-0.1.0/src/helmkit/data/monomers.sdf +19811 -0
- helmkit-0.1.0/src/helmkit/molecule.py +456 -0
- helmkit-0.1.0/src/helmkit/py.typed +0 -0
- helmkit-0.1.0/tests/cycpeptmpdb.py +43 -0
- helmkit-0.1.0/tests/data/generate_sdf.py +65 -0
- helmkit-0.1.0/tests/data/monomers.csv +386 -0
- helmkit-0.1.0/tests/data/monomers.sdf +22642 -0
- helmkit-0.1.0/tests/data/peptides.csv +7299 -0
- helmkit-0.1.0/tests/random_peptides.py +23 -0
- helmkit-0.1.0/uv.lock +275 -0
helmkit-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
helmkit-0.1.0/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.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: helmkit
|
|
3
|
+
Version: 0.1.0
|
|
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
|
+
## Basic Usage
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
from helmkit import Molecule
|
|
18
|
+
|
|
19
|
+
# Create a molecule from a HELM string
|
|
20
|
+
helm_string = "PEPTIDE1{A.R.G}$$$"
|
|
21
|
+
molecule = Molecule(helm_string)
|
|
22
|
+
|
|
23
|
+
# Access the RDKit molecule object
|
|
24
|
+
rdkit_mol = molecule.mol
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Example
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from helmkit import Molecule
|
|
31
|
+
from rdkit.Chem import AllChem, Draw
|
|
32
|
+
|
|
33
|
+
# Create a simple tripeptide (Ala-Arg-Gly)
|
|
34
|
+
molecule = Molecule("PEPTIDE1{A.R.G}$$$")
|
|
35
|
+
|
|
36
|
+
# Generate 2D coordinates for visualization
|
|
37
|
+
AllChem.Compute2DCoords(molecule.mol)
|
|
38
|
+
|
|
39
|
+
# Save the image
|
|
40
|
+
img = Draw.MolToImage(molecule.mol)
|
|
41
|
+
img.save("tripeptide.png")
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Understanding HELM Notation
|
|
45
|
+
|
|
46
|
+
HELM (Hierarchical Editing Language for Macromolecules) is a notation for representing complex biomolecules. A basic HELM string has the following format:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
PEPTIDE1{A.R.G}$PEPTIDE2{S.G.T}$PEPTIDE1,PEPTIDE2,1:R1-4:R3$$
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Where:
|
|
53
|
+
- `PEPTIDE1{A.R.G}` defines the first chain (a peptide with amino acids A, R, G)
|
|
54
|
+
- `PEPTIDE2{S.G.T}` defines the second chain
|
|
55
|
+
- `PEPTIDE1,PEPTIDE2,1:R1-4:R3` defines a connection between the chains (R1 of residue 1 in PEPTIDE1 connects to R3 of residue 4 in PEPTIDE2)
|
|
56
|
+
- `$` characters separate different sections of the HELM string
|
|
57
|
+
|
|
58
|
+
## Using Custom Monomer Data
|
|
59
|
+
|
|
60
|
+
By default, helmkit uses the monomer data in `helmkit/data/monomers.sdf`. To use a custom SDF file:
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from helmkit import Molecule, load_monomer_library
|
|
64
|
+
|
|
65
|
+
# Load your custom monomer data
|
|
66
|
+
custom_sdf_path = "/path/to/your/custom_monomers.sdf"
|
|
67
|
+
custom_monomers = load_monomer_library(custom_sdf_path)
|
|
68
|
+
|
|
69
|
+
# Create molecule with custom monomer data
|
|
70
|
+
molecule = Molecule("PEPTIDE1{A.R.G}$$$", monomer_df=custom_monomers)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## SDF File Structure Requirements
|
|
74
|
+
|
|
75
|
+
The SDF file containing monomer data must have the following properties for each molecule:
|
|
76
|
+
|
|
77
|
+
### Required Properties:
|
|
78
|
+
- `symbol`: A unique identifier for the monomer (e.g., "A" for alanine)
|
|
79
|
+
- `m_RgroupIdx`: Comma-separated list of R-group atom indices (e.g., "1,2,None,None")
|
|
80
|
+
|
|
81
|
+
### Optional Properties:
|
|
82
|
+
- `m_Rgroups`: Comma-separated list of R-group types (e.g., "H,OH,None,None")
|
|
83
|
+
- `m_type`: Monomer type (e.g., "aa" for amino acid)
|
|
84
|
+
- `m_subtype`: Monomer subtype
|
|
85
|
+
- `m_abbr`: Monomer abbreviation
|
|
86
|
+
|
|
87
|
+
### Example SDF Entry:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Your molecule atom data here...
|
|
91
|
+
...
|
|
92
|
+
|
|
93
|
+
> <symbol>
|
|
94
|
+
A
|
|
95
|
+
|
|
96
|
+
> <m_Rgroups>
|
|
97
|
+
H,OH,None,None
|
|
98
|
+
|
|
99
|
+
> <m_RgroupIdx>
|
|
100
|
+
1,2,None,None
|
|
101
|
+
|
|
102
|
+
> <m_type>
|
|
103
|
+
aa
|
|
104
|
+
|
|
105
|
+
> <m_subtype>
|
|
106
|
+
natural
|
|
107
|
+
|
|
108
|
+
> <m_abbr>
|
|
109
|
+
Ala
|
|
110
|
+
|
|
111
|
+
$$$$
|
|
112
|
+
```
|
helmkit-0.1.0/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# helmkit
|
|
2
|
+
|
|
3
|
+
A Python library for converting HELM (Hierarchical Editing Language for Macromolecules) notation to RDKit molecules.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from helmkit import Molecule
|
|
9
|
+
|
|
10
|
+
# Create a molecule from a HELM string
|
|
11
|
+
helm_string = "PEPTIDE1{A.R.G}$$$"
|
|
12
|
+
molecule = Molecule(helm_string)
|
|
13
|
+
|
|
14
|
+
# Access the RDKit molecule object
|
|
15
|
+
rdkit_mol = molecule.mol
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Example
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from helmkit import Molecule
|
|
22
|
+
from rdkit.Chem import AllChem, Draw
|
|
23
|
+
|
|
24
|
+
# Create a simple tripeptide (Ala-Arg-Gly)
|
|
25
|
+
molecule = Molecule("PEPTIDE1{A.R.G}$$$")
|
|
26
|
+
|
|
27
|
+
# Generate 2D coordinates for visualization
|
|
28
|
+
AllChem.Compute2DCoords(molecule.mol)
|
|
29
|
+
|
|
30
|
+
# Save the image
|
|
31
|
+
img = Draw.MolToImage(molecule.mol)
|
|
32
|
+
img.save("tripeptide.png")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Understanding HELM Notation
|
|
36
|
+
|
|
37
|
+
HELM (Hierarchical Editing Language for Macromolecules) is a notation for representing complex biomolecules. A basic HELM string has the following format:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
PEPTIDE1{A.R.G}$PEPTIDE2{S.G.T}$PEPTIDE1,PEPTIDE2,1:R1-4:R3$$
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Where:
|
|
44
|
+
- `PEPTIDE1{A.R.G}` defines the first chain (a peptide with amino acids A, R, G)
|
|
45
|
+
- `PEPTIDE2{S.G.T}` defines the second chain
|
|
46
|
+
- `PEPTIDE1,PEPTIDE2,1:R1-4:R3` defines a connection between the chains (R1 of residue 1 in PEPTIDE1 connects to R3 of residue 4 in PEPTIDE2)
|
|
47
|
+
- `$` characters separate different sections of the HELM string
|
|
48
|
+
|
|
49
|
+
## Using Custom Monomer Data
|
|
50
|
+
|
|
51
|
+
By default, helmkit uses the monomer data in `helmkit/data/monomers.sdf`. To use a custom SDF file:
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from helmkit import Molecule, load_monomer_library
|
|
55
|
+
|
|
56
|
+
# Load your custom monomer data
|
|
57
|
+
custom_sdf_path = "/path/to/your/custom_monomers.sdf"
|
|
58
|
+
custom_monomers = load_monomer_library(custom_sdf_path)
|
|
59
|
+
|
|
60
|
+
# Create molecule with custom monomer data
|
|
61
|
+
molecule = Molecule("PEPTIDE1{A.R.G}$$$", monomer_df=custom_monomers)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## SDF File Structure Requirements
|
|
65
|
+
|
|
66
|
+
The SDF file containing monomer data must have the following properties for each molecule:
|
|
67
|
+
|
|
68
|
+
### Required Properties:
|
|
69
|
+
- `symbol`: A unique identifier for the monomer (e.g., "A" for alanine)
|
|
70
|
+
- `m_RgroupIdx`: Comma-separated list of R-group atom indices (e.g., "1,2,None,None")
|
|
71
|
+
|
|
72
|
+
### Optional Properties:
|
|
73
|
+
- `m_Rgroups`: Comma-separated list of R-group types (e.g., "H,OH,None,None")
|
|
74
|
+
- `m_type`: Monomer type (e.g., "aa" for amino acid)
|
|
75
|
+
- `m_subtype`: Monomer subtype
|
|
76
|
+
- `m_abbr`: Monomer abbreviation
|
|
77
|
+
|
|
78
|
+
### Example SDF Entry:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Your molecule atom data here...
|
|
82
|
+
...
|
|
83
|
+
|
|
84
|
+
> <symbol>
|
|
85
|
+
A
|
|
86
|
+
|
|
87
|
+
> <m_Rgroups>
|
|
88
|
+
H,OH,None,None
|
|
89
|
+
|
|
90
|
+
> <m_RgroupIdx>
|
|
91
|
+
1,2,None,None
|
|
92
|
+
|
|
93
|
+
> <m_type>
|
|
94
|
+
aa
|
|
95
|
+
|
|
96
|
+
> <m_subtype>
|
|
97
|
+
natural
|
|
98
|
+
|
|
99
|
+
> <m_abbr>
|
|
100
|
+
Ala
|
|
101
|
+
|
|
102
|
+
$$$$
|
|
103
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "helmkit"
|
|
3
|
+
version = "0.1.0"
|
|
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
|
+
"polars>=1.31.0",
|
|
18
|
+
"pyupgrade>=3.20.0",
|
|
19
|
+
"reorder-python-imports>=3.15.0",
|
|
20
|
+
"tqdm>=4.67.1",
|
|
21
|
+
]
|