fpembed 0.1.4__tar.gz → 0.1.6__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.
- {fpembed-0.1.4 → fpembed-0.1.6}/PKG-INFO +20 -8
- fpembed-0.1.4/src/fpembed.egg-info/PKG-INFO → fpembed-0.1.6/README.md +390 -398
- {fpembed-0.1.4 → fpembed-0.1.6}/pyproject.toml +1 -1
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed/__init__.py +1 -1
- fpembed-0.1.4/README.md → fpembed-0.1.6/src/fpembed.egg-info/PKG-INFO +410 -378
- {fpembed-0.1.4 → fpembed-0.1.6}/LICENSE +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/setup.cfg +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed/compression.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed/compression_blockwise.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed/compression_projection.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed/generator.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed/hashing.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed/py.typed +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed/smiles_utils.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed.egg-info/SOURCES.txt +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed.egg-info/dependency_links.txt +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed.egg-info/requires.txt +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/src/fpembed.egg-info/top_level.txt +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/tests/test_cache.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/tests/test_compression.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/tests/test_compression_blockwise.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/tests/test_compression_projection.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/tests/test_fingerprints.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/tests/test_generator.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/tests/test_hashing.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/tests/test_properties.py +0 -0
- {fpembed-0.1.4 → fpembed-0.1.6}/tests/test_smiles_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fpembed
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Generalized fingerprint embedding library
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -20,6 +20,10 @@ Dynamic: license-file
|
|
|
20
20
|
|
|
21
21
|
# FPembed - Generalized Molecular Fingerprint Embeddings
|
|
22
22
|
|
|
23
|
+
[](https://badge.fury.io/py/fpembed)
|
|
24
|
+
[](https://doi.org/10.5281/zenodo.21447996)
|
|
25
|
+
|
|
26
|
+
|
|
23
27
|
A lightweight Python package for generating compressed molecular fingerprint embeddings, backed by [scikit-fingerprints](https://github.com/scikit-fingerprints/scikit-fingerprints). Supports ten binary fingerprint types through a single unified class.
|
|
24
28
|
|
|
25
29
|
FPembed compresses standard molecular fingerprints using weighted binary masking, producing compact float vectors suitable for machine-learning models. The package accepts SMILES, SELFIES, and RDKit Mol objects as input.
|
|
@@ -66,12 +70,12 @@ FPembed supports six compression methods, selectable via the `method` parameter
|
|
|
66
70
|
|
|
67
71
|
| Method (`method` value) | Category | `method_params` | Dynamic Range / Distance Preservation | Complexity |
|
|
68
72
|
|-------------------------|----------|-----------------|---------------------------------------|------------|
|
|
69
|
-
| `geometric` | block-wise | `interleave` (bool) | 65,536:1 dynamic range | O(L)
|
|
70
|
-
| `linear` | block-wise | `interleave` (bool) | S:1 dynamic range | O(L)
|
|
71
|
-
| `log` | block-wise | `interleave` (bool) | ~4.1:1 dynamic range | O(L)
|
|
72
|
-
| `uniform` | block-wise | `interleave` (bool) | 1:1 (mean pooling) | O(L)
|
|
73
|
+
| `geometric` | block-wise | `interleave` (bool) | 65,536:1 dynamic range | O(L) |
|
|
74
|
+
| `linear` | block-wise | `interleave` (bool) | S:1 dynamic range | O(L) |
|
|
75
|
+
| `log` | block-wise | `interleave` (bool) | ~4.1:1 dynamic range | O(L) |
|
|
76
|
+
| `uniform` | block-wise | `interleave` (bool) | 1:1 (mean pooling) | O(L) |
|
|
73
77
|
| `hadamard` | global | `seed` (int) | orthogonal projection | O(L log L) |
|
|
74
|
-
| `random_projection` | global | `seed` (int) + `sparse` (bool) | JL distance preservation | O(L
|
|
78
|
+
| `random_projection` | global | `seed` (int) + `sparse` (bool) | JL distance preservation | O(L D) |
|
|
75
79
|
|
|
76
80
|
### The `method` Parameter
|
|
77
81
|
|
|
@@ -132,7 +136,7 @@ print(emb.shape) # (1, 128)
|
|
|
132
136
|
|
|
133
137
|
### Choosing a Method
|
|
134
138
|
|
|
135
|
-
Block-wise methods (`geometric`, `linear`, `log`, `uniform`) are fast (O(L)) and simple - use them when speed matters or compression ratios are modest. Among these, `geometric` preserves the most dynamic range while `uniform` treats all bits equally (mean pooling). Global projection methods (`hadamard`, `random_projection`) mix information across all input bits, which helps retain more information at high compression ratios. `hadamard` is efficient (O(L log L)) and requires power-of-2 fingerprint sizes; `random_projection` offers the strongest theoretical distance-preservation guarantees (Johnson-Lindenstrauss lemma) at the cost of O(L
|
|
139
|
+
Block-wise methods (`geometric`, `linear`, `log`, `uniform`) are fast (O(L)) and simple - use them when speed matters or compression ratios are modest. Among these, `geometric` preserves the most dynamic range while `uniform` treats all bits equally (mean pooling). Global projection methods (`hadamard`, `random_projection`) mix information across all input bits, which helps retain more information at high compression ratios. `hadamard` is efficient (O(L log L)) and requires power-of-2 fingerprint sizes; `random_projection` offers the strongest theoretical distance-preservation guarantees (Johnson-Lindenstrauss lemma) at the cost of O(L D) complexity.
|
|
136
140
|
|
|
137
141
|
### Performance Characteristics
|
|
138
142
|
|
|
@@ -141,7 +145,7 @@ All methods produce the same output dimensionality (D = L / compression) but dif
|
|
|
141
145
|
| Method | Speed | Precomputed Memory | Best For |
|
|
142
146
|
|--------|------------------------------------------|--------------------------------------|----------|
|
|
143
147
|
| Block-wise (all four) | Fastest - single vectorized einsum, O(L) | Negligible (C-length weight vector) | Default choice; large batches |
|
|
144
|
-
| Random projection | Fast - BLAS matmul, O(L
|
|
148
|
+
| Random projection | Fast - BLAS matmul, O(L D) | DxL matrix (~2 MB for L=2048, D=128) | Best theoretical guarantees (JL lemma) |
|
|
145
149
|
| Hadamard (SRHT) | Slowest - pure-Python FWHT, O(L log L) | L-length sign vector (~16 KB) | Small-scale experiments; future optimization |
|
|
146
150
|
|
|
147
151
|
Block-wise methods are ~2–5x faster than random projection and orders of magnitude faster than Hadamard in practice. Random projection's memory cost grows quadratically with fingerprint size.
|
|
@@ -390,6 +394,14 @@ The following datasets are included in `examples/datasets/` (obtained from their
|
|
|
390
394
|
|
|
391
395
|
This project is licensed under the terms of the MIT open source license. Please refer to the [LICENSE](LICENSE) for the full terms.
|
|
392
396
|
|
|
397
|
+
## Legal & Trademark Notice
|
|
398
|
+
|
|
399
|
+
The source code of this project is licensed under the permissive **MIT License**. You are free to use, modify, and distribute the code, even for commercial purposes, as long as the original copyright notice is retained.
|
|
400
|
+
|
|
401
|
+
However, the name **"FPembed"**, its branding, and identifiers are the intellectual property of the project author (@Sciencealone).
|
|
402
|
+
* **Commercial Branding:** The unauthorized use of the name "FPembed" to brand, market, or promote commercial software, corporate AI engines, or proprietary services within the fields of bioinformatics, chemoinformatics, and AI drug discovery is strictly prohibited.
|
|
403
|
+
* **Community Protection:** This notice is established to prevent public confusion and to protect the open-source community from misleading corporate misrepresentations. For licensing queries regarding the project name, please open an issue or contact the author directly.
|
|
404
|
+
|
|
393
405
|
## AI disclosure
|
|
394
406
|
|
|
395
407
|
AI usage during project development is declared in [aidecl.yaml](aidecl.yaml) following the [AI Declaration Format](https://ai-declaration.org/).
|