equilibrator-cache-data 0.1.0__py3-none-any.whl
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.
- equilibrator_cache_data/__init__.py +42 -0
- equilibrator_cache_data/accessions.idx +0 -0
- equilibrator_cache_data/mini_compounds.sqlite +4 -0
- equilibrator_cache_data-0.1.0.dist-info/METADATA +94 -0
- equilibrator_cache_data-0.1.0.dist-info/RECORD +8 -0
- equilibrator_cache_data-0.1.0.dist-info/WHEEL +5 -0
- equilibrator_cache_data-0.1.0.dist-info/licenses/LICENSE +25 -0
- equilibrator_cache_data-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Locate the compound cache databases bundled with this package."""
|
|
2
|
+
|
|
3
|
+
# The MIT License (MIT)
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2013 The Weizmann Institute of Science.
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
# furnished to do so, subject to the following conditions:
|
|
13
|
+
#
|
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
|
15
|
+
# all copies or substantial portions of the Software.
|
|
16
|
+
#
|
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
# THE SOFTWARE.
|
|
24
|
+
|
|
25
|
+
import pathlib
|
|
26
|
+
|
|
27
|
+
__all__ = ("ACCESSION_INDEX_PATH", "MINI_COMPOUND_CACHE_PATH", "is_available")
|
|
28
|
+
|
|
29
|
+
_HERE = pathlib.Path(__file__).parent
|
|
30
|
+
|
|
31
|
+
MINI_COMPOUND_CACHE_PATH = _HERE / "mini_compounds.sqlite"
|
|
32
|
+
ACCESSION_INDEX_PATH = _HERE / "accessions.idx"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def is_available() -> bool:
|
|
36
|
+
"""Return True if both data files were actually included in this install.
|
|
37
|
+
|
|
38
|
+
An install built without running ``scripts/populate_data_package.py`` yields
|
|
39
|
+
an importable but empty package, so importing it is not by itself proof that
|
|
40
|
+
the databases are there.
|
|
41
|
+
"""
|
|
42
|
+
return MINI_COMPOUND_CACHE_PATH.is_file() and ACCESSION_INDEX_PATH.is_file()
|
|
Binary file
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: equilibrator-cache-data
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Bundled mini compound cache and accession index for equilibrator-cache
|
|
5
|
+
Author-email: Elad Noor <elad.noor@weizmann.ac.il>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: repository, https://gitlab.com/equilibrator/equilibrator-cache-data/
|
|
8
|
+
Keywords: eQuilibrator,cache,data
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Science/Research
|
|
11
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# equilibrator-cache-data
|
|
21
|
+
|
|
22
|
+
The mini compound cache and accession index that
|
|
23
|
+
[equilibrator-cache](https://gitlab.com/equilibrator/equilibrator-cache/) uses to
|
|
24
|
+
answer lookups without downloading the full ~1.3 GB database.
|
|
25
|
+
|
|
26
|
+
It carries two files and no code beyond the three constants needed to locate
|
|
27
|
+
them:
|
|
28
|
+
|
|
29
|
+
| file | size | contents |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `mini_compounds.sqlite` | ~62 MB | every compound in the KEGG and BiGG namespaces (~41k of ~694k), with their thermodynamic data and all their synonyms |
|
|
32
|
+
| `accessions.idx` | ~6 MB | a Bloom filter over every accession in the full database |
|
|
33
|
+
|
|
34
|
+
Together they compress to roughly 24 MB in a wheel.
|
|
35
|
+
|
|
36
|
+
The index is what lets a miss against the mini cache be classified without a
|
|
37
|
+
large transfer: it has no false negatives, so an identifier it rejects is
|
|
38
|
+
genuinely unknown and the lookup can fail fast. Only an identifier it accepts,
|
|
39
|
+
and that the mini cache does not hold, triggers the full download.
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
Installing this package is all that is needed; `equilibrator-cache` finds it on
|
|
44
|
+
its own.
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
import equilibrator_cache_data
|
|
48
|
+
|
|
49
|
+
equilibrator_cache_data.MINI_COMPOUND_CACHE_PATH
|
|
50
|
+
equilibrator_cache_data.ACCESSION_INDEX_PATH
|
|
51
|
+
equilibrator_cache_data.is_available()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Why this is a separate project
|
|
55
|
+
|
|
56
|
+
`equilibrator-cache` releases on every tag. If the databases rode inside it,
|
|
57
|
+
every patch release would upload ~24 MB and every user would re-download it for
|
|
58
|
+
a one-line code fix. Versioning the data separately means it is fetched once and
|
|
59
|
+
reused across many code releases. Its version therefore tracks the *data*: bump
|
|
60
|
+
it only when the databases are rebuilt.
|
|
61
|
+
|
|
62
|
+
## Building
|
|
63
|
+
|
|
64
|
+
The databases are build artifacts and are not in git. Rebuild them from a local
|
|
65
|
+
copy of the full cache, which `equilibrator-cache` will have downloaded to
|
|
66
|
+
`~/.cache/equilibrator/compounds.sqlite`:
|
|
67
|
+
|
|
68
|
+
```shell
|
|
69
|
+
uv sync --group build
|
|
70
|
+
python scripts/build_mini_cache.py ~/.cache/equilibrator/compounds.sqlite
|
|
71
|
+
python -m build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The build script validates its own output: it checks that the index has no false
|
|
75
|
+
negatives against the full cache, that no rows were orphaned by the compound
|
|
76
|
+
filter, and that microspecies and synonyms both survived.
|
|
77
|
+
|
|
78
|
+
Building needs `equilibrator-cache` installed, for the accession index writer.
|
|
79
|
+
That is a development-time dependency only — the published wheel has no runtime
|
|
80
|
+
dependencies, so the two projects do not form an install-time cycle. Note that
|
|
81
|
+
the writer is not in the 0.7.1 release on PyPI, so the `build` group pins the
|
|
82
|
+
`minidb` branch until the tiered cache ships.
|
|
83
|
+
|
|
84
|
+
## Releasing
|
|
85
|
+
|
|
86
|
+
Tagging runs `build:databases`, which downloads the full cache from Zenodo,
|
|
87
|
+
rebuilds both databases, and checks that the wheel it produced is not the empty
|
|
88
|
+
package a plain checkout would give. `publish:pypi` then uploads it, and is
|
|
89
|
+
manual: a version number can never be reused once taken.
|
|
90
|
+
|
|
91
|
+
Publishing uses PyPI trusted publishing, so no API token is stored in GitLab.
|
|
92
|
+
It needs a trusted publisher registered on PyPI for namespace `equilibrator`,
|
|
93
|
+
project `equilibrator-cache-data`, pipeline file `.gitlab-ci.yml` and
|
|
94
|
+
environment `pypi`.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
equilibrator_cache_data/__init__.py,sha256=vybOsKgR5-VoC-11Toj9mIVIBtBYNab4p1kwtglui00,1841
|
|
2
|
+
equilibrator_cache_data/accessions.idx,sha256=e-bMXrawsZ8oOF0ls1g7BtFpCPPHVQyJDqY51yfNgqw,6107093
|
|
3
|
+
equilibrator_cache_data/mini_compounds.sqlite,sha256=R3D10Hh-fRIYOXRASrOvismLlk_srAtFJkU9kaUMVh8,61722624
|
|
4
|
+
equilibrator_cache_data-0.1.0.dist-info/licenses/LICENSE,sha256=BFppH6XW7fVy4bX9WFRt7Lncsgi74SWBsMcpBTk_lcI,1282
|
|
5
|
+
equilibrator_cache_data-0.1.0.dist-info/METADATA,sha256=mbW5L0U5awLx-sM48S-8fWsLYq012VQIqBbezdUPQx4,3837
|
|
6
|
+
equilibrator_cache_data-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
7
|
+
equilibrator_cache_data-0.1.0.dist-info/top_level.txt,sha256=cf_dww5TKl1gsszYWjd0-zJ9yw8g7-O3os2j0-YmzeM,24
|
|
8
|
+
equilibrator_cache_data-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013 Weizmann Institute of Science
|
|
4
|
+
Copyright (c) 2018,2019 Institute for Molecular Systems Biology,
|
|
5
|
+
ETH Zurich
|
|
6
|
+
Copyright (c) 2018,2019 Novo Nordisk Foundation Center for Biosustainability,
|
|
7
|
+
Technical University of Denmark
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
equilibrator_cache_data
|