uupmap 0.0.3__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,65 @@
1
+ # Editor / OS
2
+ .DS_Store
3
+ Thumbs.db
4
+ *.swp
5
+ *.swo
6
+ .idea/
7
+ .vscode/
8
+
9
+ # Claude Code project-local settings
10
+ .claude/
11
+
12
+ # Python
13
+ __pycache__/
14
+ *.py[cod]
15
+ *$py.class
16
+ *.egg-info/
17
+ .eggs/
18
+ build/
19
+ dist/
20
+ .venv/
21
+ venv/
22
+ env/
23
+ .pytest_cache/
24
+ .mypy_cache/
25
+ .ruff_cache/
26
+ .coverage
27
+ htmlcov/
28
+ .tox/
29
+
30
+ # Notebooks
31
+ .ipynb_checkpoints/
32
+
33
+ # UniWeave build artifacts and intermediates
34
+ data/
35
+ work/
36
+ reps/
37
+ *.duckdb
38
+ *.duckdb.wal
39
+ *.parquet
40
+ *.fasta
41
+ *.fasta.gz
42
+ *.tsv
43
+ *.tsv.gz
44
+ # Exempt curated build-time inputs committed to the repo.
45
+ !config/known_pairs.tsv
46
+ # Exempt the landing-page data source (tracked; not a build-artifact dir).
47
+ !site/data/
48
+ *.csv.gz
49
+ fs_hits*
50
+ mm_hits*
51
+
52
+ # Logs
53
+ *.log
54
+ logs/
55
+
56
+ # Secrets — never commit (HF / Zenodo / GitHub tokens, keys)
57
+ .env
58
+ .env.*
59
+ !.env.example
60
+ *.token
61
+ *.pem
62
+ *.key
63
+ id_ed25519*
64
+ id_rsa*
65
+ secrets/
uupmap-0.0.3/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 The UniWeave Authors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing
201
+ permissions and limitations under the License.
uupmap-0.0.3/NOTICE ADDED
@@ -0,0 +1,69 @@
1
+ UniWeave
2
+ Copyright 2026 The UniWeave Authors
3
+
4
+ This product imports and depends on the following third-party software,
5
+ each governed by its own licence. Their attributions are reproduced here
6
+ in accordance with section 4(d) of the Apache License, Version 2.0.
7
+
8
+ ----------------------------------------------------------------------
9
+
10
+ pdbe_sifts
11
+ https://github.com/PDBeurope/SIFTS
12
+ Licensed under the Apache License, Version 2.0.
13
+ UniWeave uses pdbe_sifts at runtime for MMseqs2 driving
14
+ (`pdbe_sifts.sequence_match.mmseqs_search.MmSearch`), hit ingestion
15
+ (`pdbe_sifts.sequence_match.sequence_match_parser.SequenceMatchParser`),
16
+ and per-pair residue alignment via lalign36
17
+ (`pdbe_sifts.segments_generation.alignment.do_alignment_lalign36`).
18
+
19
+ MMseqs2
20
+ https://github.com/soedinglab/MMseqs2
21
+ Licensed under the MIT License.
22
+ Used as an external binary (invoked via `pymmseqs`) for all-vs-all
23
+ sequence prefiltering.
24
+
25
+ FASTA36 (`lalign36`)
26
+ https://github.com/wrpearson/fasta36
27
+ Licensed under the Apache License, Version 2.0.
28
+ Used as an external binary for per-pair local alignment, invoked
29
+ indirectly via `pdbe_sifts.segments_generation.alignment`.
30
+
31
+ FoldSeek
32
+ https://github.com/steineggerlab/foldseek
33
+ Licensed under the GPL-3.0 License.
34
+ Used as an external binary for all-vs-all structural comparison of
35
+ AlphaFold DB / ESM models. FoldSeek is not redistributed as part of
36
+ UniWeave; users install it separately. UniWeave's source code is not
37
+ a derivative work of FoldSeek.
38
+
39
+ AlphaFold Protein Structure Database
40
+ https://alphafold.ebi.ac.uk/
41
+ Data licensed under Creative Commons Attribution 4.0 (CC-BY-4.0).
42
+ Structural models consumed at build time; not redistributed by UniWeave.
43
+
44
+ ProstT5 / ProtT5-XL-U50 (Rostlab)
45
+ https://huggingface.co/Rostlab/ProstT5
46
+ Model weights licensed under the MIT License. ProstT5 finetunes the
47
+ ProtT5-XL-U50 protein language model.
48
+ ProstT5 is the default AFDB-miss fallback engine
49
+ (`structural_input.fallback: prostt5`, config/default.yaml). The weights
50
+ are fetched and driven through FoldSeek's ProstT5 integration
51
+ (`foldseek databases ProstT5`, then `foldseek createdb --prostt5-model`)
52
+ to predict 3Di states for UniProts AFDB does not cover; not redistributed
53
+ by UniWeave. See decisions.md §D12.
54
+
55
+ SWISS-MODEL Repository
56
+ https://swissmodel.expasy.org/repository/uniprot/
57
+ Data licensed under Creative Commons Attribution 4.0 (CC-BY-4.0).
58
+ Homology and PDB-derived models consumed at build time as an optional
59
+ AFDB-miss fallback (`structural_input.fallback: swiss_model`, stage 02c);
60
+ superseded as the default by ProstT5 on 2026-05-27 but retained as a
61
+ selectable path. Not redistributed by UniWeave. See decisions.md §D10.
62
+
63
+ ESM Atlas
64
+ https://esmatlas.com/
65
+ Data licensed under the ESM Atlas terms.
66
+ Structural models consumed at build time as an optional AFDB-miss
67
+ fallback (`structural_input.fallback: esm_atlas`, stage 02b); superseded
68
+ by ProstT5 but retained as a selectable path. Not redistributed by
69
+ UniWeave.
uupmap-0.0.3/PKG-INFO ADDED
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.5
2
+ Name: uupmap
3
+ Version: 0.0.3
4
+ Summary: Reader for UniWeave, a residue-level UniProt-to-UniProt mapping resource
5
+ Project-URL: Dataset, https://huggingface.co/datasets/ioChris/uniweave
6
+ Author: The UniWeave Authors
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ License-File: NOTICE
10
+ Keywords: alphafold,bioinformatics,protein structure,residue mapping,uniprot
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: polars>=1.0
22
+ Description-Content-Type: text/markdown
23
+
24
+ # uupmap
25
+
26
+ `uupmap` reads [UniWeave](https://huggingface.co/datasets/ioChris/uniweave), a residue-level
27
+ UniProt-to-UniProt mapping resource. Every edge links two UniProt accessions by sequence
28
+ (MMseqs2) and/or structural (FoldSeek TM-align, ProstT5 3Di) similarity and carries the residue
29
+ correspondence between them, so a residue index in one protein can be carried over to its
30
+ counterpart in another.
31
+
32
+ This package is the reader only: it opens the published Parquet files and answers queries. It
33
+ depends on [Polars](https://pola.rs) and nothing else.
34
+
35
+ ## Install
36
+
37
+ ```bash
38
+ pip install uupmap
39
+ ```
40
+
41
+ ## Get the data
42
+
43
+ The artifacts are on Hugging Face (CC-BY-4.0). Each weekly release is tagged with its
44
+ `data_version`, so a release can be pinned with `revision=`:
45
+
46
+ ```python
47
+ from pathlib import Path
48
+ from huggingface_hub import snapshot_download # pip install huggingface_hub
49
+
50
+ d = Path(snapshot_download("ioChris/uniweave", repo_type="dataset"))
51
+ ```
52
+
53
+ The release is about 0.4 GB: `edges.parquet`, `uniprots.parquet`, `sifts.parquet`,
54
+ `model_frames.parquet`, `stats.json` and `dataset_manifest.json`.
55
+
56
+ ## Query
57
+
58
+ ```python
59
+ from uupmap import UUPMap
60
+
61
+ m = UUPMap(d / "edges.parquet", d / "uniprots.parquet",
62
+ model_frames_path=d / "model_frames.parquet")
63
+
64
+ # UniProt neighbours of a protein. Thresholds default to 1.0, so pass the ones you want.
65
+ for n in m.neighbors("P69905", seq_id_min=0.3, tm_min=0.5):
66
+ print(n.unp_b, n.seq_identity, n.tm_score)
67
+
68
+ # Carry residue 87 of P69905 over to its neighbours.
69
+ for hit in m.expand_indices([("P69905", 87)], seq_id_min=0.3, tm_min=0.5):
70
+ print(hit.unp_b, hit.idx_b, hit.cigar_source)
71
+
72
+ # Scores and channels behind one pair.
73
+ print(m.provenance("P69905", "P68871"))
74
+ ```
75
+
76
+ `neighbors` and `expand_indices` accept `min_cov`, `min_plddt`, `require_both` (sequence and
77
+ structure must both pass) and `di_bits_per_res_min` (admits ProstT5 3Di edges, off by default).
78
+
79
+ ### AlphaFold-DB residue numbering
80
+
81
+ Residue maps are in current UniProt numbering. An AlphaFold-DB model can be numbered against an
82
+ older version of its UniProt entry; `model_frames.parquet` records the correspondence, and
83
+ `m.unp_to_model(acc, positions)` / `m.model_to_unp(acc, residues)` translate lists of numbers
84
+ between the two for tools that open the model files themselves (`m.model_frame(acc)` is `None`
85
+ for an accession with no AFDB model checked). A frame describes one model file: before mapping
86
+ through a model you downloaded yourself, check that `uupmap.residue_frame.crc64(sequence)` of its
87
+ modelled sequence equals the frame's `model_crc64`.
88
+
89
+ ## Version contract
90
+
91
+ Each release states which readers can read it. From the releases that carry them,
92
+ `dataset_manifest.json` has `uupmap_version` (the reader that built it), `artifact_format` and
93
+ `min_uupmap_version` in its `software` block. The installed package exposes the matching
94
+ constants:
95
+
96
+ ```python
97
+ import json, uupmap
98
+
99
+ software = json.loads((d / "dataset_manifest.json").read_text())["software"]
100
+ print(uupmap.__version__, uupmap.ARTIFACT_FORMAT, uupmap.MIN_READER_VERSION)
101
+ print(software.get("min_uupmap_version"), software.get("artifact_format"))
102
+ ```
103
+
104
+ Below 0.0.2, a coverage floor silently dropped the structure-only edges, most of the graph.
105
+ Use 0.0.2 or later.
106
+
107
+ ## Licence
108
+
109
+ The code is Apache-2.0 (see `LICENSE` and `NOTICE`). The UniWeave data is CC-BY-4.0. A preprint
110
+ describing UniWeave is in preparation.
uupmap-0.0.3/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # uupmap
2
+
3
+ `uupmap` reads [UniWeave](https://huggingface.co/datasets/ioChris/uniweave), a residue-level
4
+ UniProt-to-UniProt mapping resource. Every edge links two UniProt accessions by sequence
5
+ (MMseqs2) and/or structural (FoldSeek TM-align, ProstT5 3Di) similarity and carries the residue
6
+ correspondence between them, so a residue index in one protein can be carried over to its
7
+ counterpart in another.
8
+
9
+ This package is the reader only: it opens the published Parquet files and answers queries. It
10
+ depends on [Polars](https://pola.rs) and nothing else.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pip install uupmap
16
+ ```
17
+
18
+ ## Get the data
19
+
20
+ The artifacts are on Hugging Face (CC-BY-4.0). Each weekly release is tagged with its
21
+ `data_version`, so a release can be pinned with `revision=`:
22
+
23
+ ```python
24
+ from pathlib import Path
25
+ from huggingface_hub import snapshot_download # pip install huggingface_hub
26
+
27
+ d = Path(snapshot_download("ioChris/uniweave", repo_type="dataset"))
28
+ ```
29
+
30
+ The release is about 0.4 GB: `edges.parquet`, `uniprots.parquet`, `sifts.parquet`,
31
+ `model_frames.parquet`, `stats.json` and `dataset_manifest.json`.
32
+
33
+ ## Query
34
+
35
+ ```python
36
+ from uupmap import UUPMap
37
+
38
+ m = UUPMap(d / "edges.parquet", d / "uniprots.parquet",
39
+ model_frames_path=d / "model_frames.parquet")
40
+
41
+ # UniProt neighbours of a protein. Thresholds default to 1.0, so pass the ones you want.
42
+ for n in m.neighbors("P69905", seq_id_min=0.3, tm_min=0.5):
43
+ print(n.unp_b, n.seq_identity, n.tm_score)
44
+
45
+ # Carry residue 87 of P69905 over to its neighbours.
46
+ for hit in m.expand_indices([("P69905", 87)], seq_id_min=0.3, tm_min=0.5):
47
+ print(hit.unp_b, hit.idx_b, hit.cigar_source)
48
+
49
+ # Scores and channels behind one pair.
50
+ print(m.provenance("P69905", "P68871"))
51
+ ```
52
+
53
+ `neighbors` and `expand_indices` accept `min_cov`, `min_plddt`, `require_both` (sequence and
54
+ structure must both pass) and `di_bits_per_res_min` (admits ProstT5 3Di edges, off by default).
55
+
56
+ ### AlphaFold-DB residue numbering
57
+
58
+ Residue maps are in current UniProt numbering. An AlphaFold-DB model can be numbered against an
59
+ older version of its UniProt entry; `model_frames.parquet` records the correspondence, and
60
+ `m.unp_to_model(acc, positions)` / `m.model_to_unp(acc, residues)` translate lists of numbers
61
+ between the two for tools that open the model files themselves (`m.model_frame(acc)` is `None`
62
+ for an accession with no AFDB model checked). A frame describes one model file: before mapping
63
+ through a model you downloaded yourself, check that `uupmap.residue_frame.crc64(sequence)` of its
64
+ modelled sequence equals the frame's `model_crc64`.
65
+
66
+ ## Version contract
67
+
68
+ Each release states which readers can read it. From the releases that carry them,
69
+ `dataset_manifest.json` has `uupmap_version` (the reader that built it), `artifact_format` and
70
+ `min_uupmap_version` in its `software` block. The installed package exposes the matching
71
+ constants:
72
+
73
+ ```python
74
+ import json, uupmap
75
+
76
+ software = json.loads((d / "dataset_manifest.json").read_text())["software"]
77
+ print(uupmap.__version__, uupmap.ARTIFACT_FORMAT, uupmap.MIN_READER_VERSION)
78
+ print(software.get("min_uupmap_version"), software.get("artifact_format"))
79
+ ```
80
+
81
+ Below 0.0.2, a coverage floor silently dropped the structure-only edges, most of the graph.
82
+ Use 0.0.2 or later.
83
+
84
+ ## Licence
85
+
86
+ The code is Apache-2.0 (see `LICENSE` and `NOTICE`). The UniWeave data is CC-BY-4.0. A preprint
87
+ describing UniWeave is in preparation.
@@ -0,0 +1,46 @@
1
+ # The reader-only `uupmap` distribution published to PyPI.
2
+ #
3
+ # Not built from here directly: `packaging/uupmap/stage.py` copies this file,
4
+ # README.md, LICENSE, NOTICE and the reader modules into a staging directory,
5
+ # and `python -m build <staging dir>` builds the wheel and sdist from there.
6
+ # The repository's own pyproject.toml (the full engine, with the build CLI and
7
+ # its pipeline dependencies) is unaffected.
8
+
9
+ [build-system]
10
+ requires = ["hatchling>=1.27"]
11
+ build-backend = "hatchling.build"
12
+
13
+ [project]
14
+ name = "uupmap"
15
+ dynamic = ["version"]
16
+ description = "Reader for UniWeave, a residue-level UniProt-to-UniProt mapping resource"
17
+ readme = "README.md"
18
+ requires-python = ">=3.10"
19
+ license = "Apache-2.0"
20
+ license-files = ["LICENSE", "NOTICE"]
21
+ authors = [{ name = "The UniWeave Authors" }]
22
+ keywords = ["bioinformatics", "uniprot", "alphafold", "residue mapping", "protein structure"]
23
+ classifiers = [
24
+ "Development Status :: 3 - Alpha",
25
+ "Intended Audience :: Science/Research",
26
+ "Operating System :: OS Independent",
27
+ "Programming Language :: Python :: 3 :: Only",
28
+ "Programming Language :: Python :: 3.10",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
31
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
32
+ "Typing :: Typed",
33
+ ]
34
+ dependencies = ["polars>=1.0"]
35
+
36
+ [project.urls]
37
+ Dataset = "https://huggingface.co/datasets/ioChris/uniweave"
38
+
39
+ [tool.hatch.version]
40
+ path = "src/uupmap/__init__.py"
41
+
42
+ [tool.hatch.build.targets.wheel]
43
+ packages = ["src/uupmap"]
44
+
45
+ [tool.hatch.build.targets.sdist]
46
+ include = ["src/uupmap", "README.md", "LICENSE", "NOTICE", "pyproject.toml"]
@@ -0,0 +1,90 @@
1
+ """UniWeave runtime adapter library.
2
+
3
+ UniWeave produces a UniProt-to-UniProt residue-level mapping resource;
4
+ this package is the thin Python adapter that downstream tools (AHoJ
5
+ and others) import to consume it.
6
+
7
+ Public surface:
8
+
9
+ - :class:`UUPMap` — the runtime handle on a UniWeave artifact.
10
+ - :class:`MappedIndex`,
11
+ :class:`Neighbor`,
12
+ :class:`EdgeSource`,
13
+ :class:`RepSource` — data shapes for adapter return values.
14
+ - :class:`ModelFrame` — how an AlphaFold-DB model's residue numbers map
15
+ onto the current UniProt entry (one ``model_frames.parquet`` row).
16
+ - :data:`CigarSourcePolicy` — type alias for the residue-map source enum.
17
+ - :func:`parse_unp_token` — ``'<UNP>_<idx>'`` token convenience parser.
18
+ - :data:`ARTIFACT_FORMAT`,
19
+ :data:`MIN_READER_VERSION` — the artifact contract this code writes and
20
+ the oldest reader that can read it (see the comments below).
21
+
22
+ The artifact files, their columns and the release notes are described on
23
+ the dataset card: https://huggingface.co/datasets/ioChris/uniweave
24
+ """
25
+
26
+ from uupmap.mapping import CigarSourcePolicy, UUPMap, parse_unp_token
27
+ from uupmap.residue_frame import ModelFrame
28
+ from uupmap.schema import EdgeSource, MappedIndex, Neighbor, RepSource
29
+
30
+ __all__ = [
31
+ "ARTIFACT_FORMAT",
32
+ "MIN_READER_VERSION",
33
+ "CigarSourcePolicy",
34
+ "EdgeSource",
35
+ "MappedIndex",
36
+ "ModelFrame",
37
+ "Neighbor",
38
+ "RepSource",
39
+ "UUPMap",
40
+ "parse_unp_token",
41
+ ]
42
+
43
+ # Three constants describe the reader/artifact contract. Every build writes
44
+ # all three into stats.json (uupmap_version, artifact_format,
45
+ # min_uupmap_version), and the published dataset_manifest.json carries them in
46
+ # its software block, so a consumer can check its installed uupmap against
47
+ # the artifact before reading it (decision D24). They are constants of the
48
+ # code that built the artifact, so stats.json stays a pure function of that
49
+ # code and the artifacts. They change only in a commit that changes the
50
+ # contract.
51
+ #
52
+ # __version__ — bump on any change to the consumption-side query contract, so
53
+ # a consumer can tell which semantics it is running against. The reader-only
54
+ # `uupmap` distribution on PyPI is published from this version, and a version
55
+ # is never re-published, so every contract change needs a bump.
56
+ # 0.0.2 — D18: min_cov is evidence-conditional; edges with no coverage in
57
+ # either channel (plain TM-align structure-only, ~80 % of the graph)
58
+ # are no longer dropped by a coverage floor.
59
+ # 0.0.3 — D19/D20: artifacts packed by this engine store tm_cigar/di_cigar in
60
+ # current-UniProt numbering (previously AFDB model numbering), and
61
+ # ship model_frames.parquet; UUPMap(model_frames_path=...) adds
62
+ # model_frame / unp_to_model / model_to_unp for consumers that open
63
+ # AFDB model files themselves.
64
+ __version__ = "0.0.3"
65
+
66
+ # ARTIFACT_FORMAT — bump when the packed artifact contract changes in a way a
67
+ # reader has to know about: a column a reader selects is added, removed,
68
+ # renamed or retyped; a column's values change meaning; or a new file becomes
69
+ # part of what a reader uses. Do not bump for row order (D21), for data
70
+ # corrections that keep every column's meaning (D22, D23), or for reader-only
71
+ # changes (D18, which raised MIN_READER_VERSION instead). Formats that predate
72
+ # this constant:
73
+ # 1 — the May 2026 contract: edges.parquet with the seq_* and tm_* channels
74
+ # only (e.g. v2026.06). Readers that know the di_* channel fail on it
75
+ # (uupmap 0.0.3: Polars ColumnNotFound on di_qcov).
76
+ # 2 — D12 (2026-05-27): edges.parquet gains the di_* 3Di/AA channel with
77
+ # di_alignment_type (D14 later added a second di_alignment_type value
78
+ # within the same columns).
79
+ # 3 — D19/D20 (2026-09-16): tm_cigar/di_cigar are in current-UniProt
80
+ # numbering (previously AFDB model numbering), and model_frames.parquet
81
+ # is published.
82
+ ARTIFACT_FORMAT = 3
83
+
84
+ # MIN_READER_VERSION — the oldest __version__ that reads an artifact written
85
+ # by this code correctly. Raise it when a format bump makes older readers fail
86
+ # or misread, or when a reader bug makes them wrong on every artifact. "0.0.2"
87
+ # since D18: older readers silently drop the ~80 % of edges that carry no
88
+ # coverage channel. Format 3 does not raise it: 0.0.2 already takes the
89
+ # CIGARs as current-UniProt numbering, and model_frames.parquet is opt-in.
90
+ MIN_READER_VERSION = "0.0.2"