tinyhgvs 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.
- tinyhgvs-0.1.0/Cargo.lock +194 -0
- tinyhgvs-0.1.0/Cargo.toml +12 -0
- tinyhgvs-0.1.0/PKG-INFO +73 -0
- tinyhgvs-0.1.0/README.md +45 -0
- tinyhgvs-0.1.0/crates/tinyhgvs/Cargo.toml +16 -0
- tinyhgvs-0.1.0/crates/tinyhgvs/README.md +52 -0
- tinyhgvs-0.1.0/crates/tinyhgvs/src/diagnostics.rs +415 -0
- tinyhgvs-0.1.0/crates/tinyhgvs/src/error.rs +174 -0
- tinyhgvs-0.1.0/crates/tinyhgvs/src/lib.rs +93 -0
- tinyhgvs-0.1.0/crates/tinyhgvs/src/model.rs +441 -0
- tinyhgvs-0.1.0/crates/tinyhgvs/src/parser.rs +626 -0
- tinyhgvs-0.1.0/crates/tinyhgvs/tests/test_diagnostics.rs +172 -0
- tinyhgvs-0.1.0/crates/tinyhgvs/tests/test_parser.rs +399 -0
- tinyhgvs-0.1.0/py-tinyhgvs/.python-version +1 -0
- tinyhgvs-0.1.0/py-tinyhgvs/Cargo.toml +20 -0
- tinyhgvs-0.1.0/py-tinyhgvs/README.md +45 -0
- tinyhgvs-0.1.0/py-tinyhgvs/src/lib.rs +596 -0
- tinyhgvs-0.1.0/py-tinyhgvs/tests/test_parser.py +453 -0
- tinyhgvs-0.1.0/py-tinyhgvs/uv.lock +759 -0
- tinyhgvs-0.1.0/pyproject.toml +49 -0
- tinyhgvs-0.1.0/python/tinyhgvs/__init__.py +87 -0
- tinyhgvs-0.1.0/python/tinyhgvs/api.py +60 -0
- tinyhgvs-0.1.0/python/tinyhgvs/errors.py +107 -0
- tinyhgvs-0.1.0/python/tinyhgvs/models/__init__.py +140 -0
- tinyhgvs-0.1.0/python/tinyhgvs/models/nucleotide.py +449 -0
- tinyhgvs-0.1.0/python/tinyhgvs/models/protein.py +291 -0
- tinyhgvs-0.1.0/python/tinyhgvs/models/shared.py +166 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 3
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "autocfg"
|
|
7
|
+
version = "1.4.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "cfg-if"
|
|
13
|
+
version = "1.0.0"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "heck"
|
|
19
|
+
version = "0.5.0"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "indoc"
|
|
25
|
+
version = "2.0.5"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
|
|
28
|
+
|
|
29
|
+
[[package]]
|
|
30
|
+
name = "libc"
|
|
31
|
+
version = "0.2.169"
|
|
32
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
+
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "memchr"
|
|
37
|
+
version = "2.7.4"
|
|
38
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
+
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
|
40
|
+
|
|
41
|
+
[[package]]
|
|
42
|
+
name = "memoffset"
|
|
43
|
+
version = "0.9.1"
|
|
44
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
45
|
+
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
46
|
+
dependencies = [
|
|
47
|
+
"autocfg",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[[package]]
|
|
51
|
+
name = "nom"
|
|
52
|
+
version = "8.0.0"
|
|
53
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
54
|
+
checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405"
|
|
55
|
+
dependencies = [
|
|
56
|
+
"memchr",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[[package]]
|
|
60
|
+
name = "once_cell"
|
|
61
|
+
version = "1.20.2"
|
|
62
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
63
|
+
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
|
|
64
|
+
|
|
65
|
+
[[package]]
|
|
66
|
+
name = "portable-atomic"
|
|
67
|
+
version = "1.10.0"
|
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
69
|
+
checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
|
|
70
|
+
|
|
71
|
+
[[package]]
|
|
72
|
+
name = "proc-macro2"
|
|
73
|
+
version = "1.0.92"
|
|
74
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
75
|
+
checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
|
|
76
|
+
dependencies = [
|
|
77
|
+
"unicode-ident",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
[[package]]
|
|
81
|
+
name = "py-tinyhgvs"
|
|
82
|
+
version = "0.1.0"
|
|
83
|
+
dependencies = [
|
|
84
|
+
"pyo3",
|
|
85
|
+
"tinyhgvs",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[[package]]
|
|
89
|
+
name = "pyo3"
|
|
90
|
+
version = "0.23.3"
|
|
91
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
92
|
+
checksum = "e484fd2c8b4cb67ab05a318f1fd6fa8f199fcc30819f08f07d200809dba26c15"
|
|
93
|
+
dependencies = [
|
|
94
|
+
"cfg-if",
|
|
95
|
+
"indoc",
|
|
96
|
+
"libc",
|
|
97
|
+
"memoffset",
|
|
98
|
+
"once_cell",
|
|
99
|
+
"portable-atomic",
|
|
100
|
+
"pyo3-build-config",
|
|
101
|
+
"pyo3-ffi",
|
|
102
|
+
"pyo3-macros",
|
|
103
|
+
"unindent",
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
[[package]]
|
|
107
|
+
name = "pyo3-build-config"
|
|
108
|
+
version = "0.23.3"
|
|
109
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
110
|
+
checksum = "dc0e0469a84f208e20044b98965e1561028180219e35352a2afaf2b942beff3b"
|
|
111
|
+
dependencies = [
|
|
112
|
+
"once_cell",
|
|
113
|
+
"target-lexicon",
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
[[package]]
|
|
117
|
+
name = "pyo3-ffi"
|
|
118
|
+
version = "0.23.3"
|
|
119
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
120
|
+
checksum = "eb1547a7f9966f6f1a0f0227564a9945fe36b90da5a93b3933fc3dc03fae372d"
|
|
121
|
+
dependencies = [
|
|
122
|
+
"libc",
|
|
123
|
+
"pyo3-build-config",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "pyo3-macros"
|
|
128
|
+
version = "0.23.3"
|
|
129
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
+
checksum = "fdb6da8ec6fa5cedd1626c886fc8749bdcbb09424a86461eb8cdf096b7c33257"
|
|
131
|
+
dependencies = [
|
|
132
|
+
"proc-macro2",
|
|
133
|
+
"pyo3-macros-backend",
|
|
134
|
+
"quote",
|
|
135
|
+
"syn",
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
[[package]]
|
|
139
|
+
name = "pyo3-macros-backend"
|
|
140
|
+
version = "0.23.3"
|
|
141
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
142
|
+
checksum = "38a385202ff5a92791168b1136afae5059d3ac118457bb7bc304c197c2d33e7d"
|
|
143
|
+
dependencies = [
|
|
144
|
+
"heck",
|
|
145
|
+
"proc-macro2",
|
|
146
|
+
"pyo3-build-config",
|
|
147
|
+
"quote",
|
|
148
|
+
"syn",
|
|
149
|
+
]
|
|
150
|
+
|
|
151
|
+
[[package]]
|
|
152
|
+
name = "quote"
|
|
153
|
+
version = "1.0.37"
|
|
154
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
155
|
+
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
|
|
156
|
+
dependencies = [
|
|
157
|
+
"proc-macro2",
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
[[package]]
|
|
161
|
+
name = "syn"
|
|
162
|
+
version = "2.0.91"
|
|
163
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
164
|
+
checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035"
|
|
165
|
+
dependencies = [
|
|
166
|
+
"proc-macro2",
|
|
167
|
+
"quote",
|
|
168
|
+
"unicode-ident",
|
|
169
|
+
]
|
|
170
|
+
|
|
171
|
+
[[package]]
|
|
172
|
+
name = "target-lexicon"
|
|
173
|
+
version = "0.12.16"
|
|
174
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
175
|
+
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
|
176
|
+
|
|
177
|
+
[[package]]
|
|
178
|
+
name = "tinyhgvs"
|
|
179
|
+
version = "0.1.0"
|
|
180
|
+
dependencies = [
|
|
181
|
+
"nom",
|
|
182
|
+
]
|
|
183
|
+
|
|
184
|
+
[[package]]
|
|
185
|
+
name = "unicode-ident"
|
|
186
|
+
version = "1.0.14"
|
|
187
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
188
|
+
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
|
|
189
|
+
|
|
190
|
+
[[package]]
|
|
191
|
+
name = "unindent"
|
|
192
|
+
version = "0.2.3"
|
|
193
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
194
|
+
checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[workspace]
|
|
2
|
+
resolver = "2"
|
|
3
|
+
members = ["crates/tinyhgvs", "py-tinyhgvs"]
|
|
4
|
+
|
|
5
|
+
[workspace.package]
|
|
6
|
+
version = "0.1.0"
|
|
7
|
+
edition = "2021"
|
|
8
|
+
rust-version = "1.65"
|
|
9
|
+
license = "MIT"
|
|
10
|
+
repository = "https://github.com/svm-zhang/tinyhgvs"
|
|
11
|
+
homepage = "https://github.com/svm-zhang/tinyhgvs"
|
|
12
|
+
documentation = "https://docs.rs/tinyhgvs"
|
tinyhgvs-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tinyhgvs
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: Intended Audience :: Science/Research
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: MacOS
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Rust
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
17
|
+
Summary: Hybrid Rust/Python library for parsing HGVS variants.
|
|
18
|
+
Keywords: bioinformatics,genomics,hgvs,parser,variants
|
|
19
|
+
Home-Page: https://github.com/svm-zhang/tinyhgvs
|
|
20
|
+
License-Expression: MIT
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
23
|
+
Project-URL: Documentation, https://svm-zhang.github.io/tinyhgvs
|
|
24
|
+
Project-URL: Homepage, https://github.com/svm-zhang/tinyhgvs
|
|
25
|
+
Project-URL: Issues, https://github.com/svm-zhang/tinyhgvs/issues
|
|
26
|
+
Project-URL: Repository, https://github.com/svm-zhang/tinyhgvs
|
|
27
|
+
|
|
28
|
+
# tinyhgvs
|
|
29
|
+
|
|
30
|
+
`tinyhgvs` is a lightweight HGVS parsing Python library backed by a core parser and
|
|
31
|
+
structured data and error model implemented in Rust.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
`tinyhgvs` can be installed directly from PyPI:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install tinyhgvs
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Quick start
|
|
42
|
+
|
|
43
|
+
- A splicing-site substitution crossing exon/intron boundary:
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from tinyhgvs import parse_hgvs
|
|
47
|
+
|
|
48
|
+
variant = parse_hgvs("NM_004006.2:c.357+1G>A")
|
|
49
|
+
print(variant.reference.primary.id)
|
|
50
|
+
print(variant.coordinate_system.value)
|
|
51
|
+
print(variant.description.location.start.coordinate)
|
|
52
|
+
print(variant.description.location.start.offset)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- Known but unsupported HGVS syntax raises `TINYHGVSError` with diagnostic code:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from tinyhgvs import TinyHGVSError, parse_hgvs
|
|
59
|
+
|
|
60
|
+
try:
|
|
61
|
+
parse_hgvs("NC_000001.11:g.[123G>A;345del]")
|
|
62
|
+
except TinyHGVSError as error:
|
|
63
|
+
print(error.code)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Documentation
|
|
67
|
+
|
|
68
|
+
Please refer to official documents for details about both Python and Rust APIs:
|
|
69
|
+
|
|
70
|
+
- [Python API and project docs](https://svm-zhang.github.io/tinyhgvs)
|
|
71
|
+
- [Rust API docs](https://docs.rs/tinyhgvs)
|
|
72
|
+
|
|
73
|
+
|
tinyhgvs-0.1.0/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# tinyhgvs
|
|
2
|
+
|
|
3
|
+
`tinyhgvs` is a lightweight HGVS parsing Python library backed by a core parser and
|
|
4
|
+
structured data and error model implemented in Rust.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
`tinyhgvs` can be installed directly from PyPI:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install tinyhgvs
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
- A splicing-site substitution crossing exon/intron boundary:
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from tinyhgvs import parse_hgvs
|
|
20
|
+
|
|
21
|
+
variant = parse_hgvs("NM_004006.2:c.357+1G>A")
|
|
22
|
+
print(variant.reference.primary.id)
|
|
23
|
+
print(variant.coordinate_system.value)
|
|
24
|
+
print(variant.description.location.start.coordinate)
|
|
25
|
+
print(variant.description.location.start.offset)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Known but unsupported HGVS syntax raises `TINYHGVSError` with diagnostic code:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from tinyhgvs import TinyHGVSError, parse_hgvs
|
|
32
|
+
|
|
33
|
+
try:
|
|
34
|
+
parse_hgvs("NC_000001.11:g.[123G>A;345del]")
|
|
35
|
+
except TinyHGVSError as error:
|
|
36
|
+
print(error.code)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
Please refer to official documents for details about both Python and Rust APIs:
|
|
42
|
+
|
|
43
|
+
- [Python API and project docs](https://svm-zhang.github.io/tinyhgvs)
|
|
44
|
+
- [Rust API docs](https://docs.rs/tinyhgvs)
|
|
45
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "tinyhgvs"
|
|
3
|
+
version.workspace = true
|
|
4
|
+
edition.workspace = true
|
|
5
|
+
rust-version.workspace = true
|
|
6
|
+
license.workspace = true
|
|
7
|
+
repository.workspace = true
|
|
8
|
+
homepage.workspace = true
|
|
9
|
+
documentation.workspace = true
|
|
10
|
+
description = "Lightweight Rust library for parsing HGVS variants."
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
keywords = ["bioinformatics", "genomics", "hgvs", "parser", "variants"]
|
|
13
|
+
categories = ["parser-implementations", "science"]
|
|
14
|
+
|
|
15
|
+
[dependencies]
|
|
16
|
+
nom = "8.0.0"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# tinyhgvs
|
|
2
|
+
|
|
3
|
+
`tinyhgvs` is a lightweight HGVS parsing Python library backed by a core parser and
|
|
4
|
+
structured data and error model implemented in Rust.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
`tinyhgvs` can be installed directly from PyPI:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install tinyhgvs
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
- An splicing-site substitution crossing exon/intron boundary:
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from tinyhgvs import parse_hgvs
|
|
20
|
+
|
|
21
|
+
variant = parse_hgvs("NM_004006.2:c.357+1G>A")
|
|
22
|
+
print(variant.reference.primary.id)
|
|
23
|
+
print(variant.coordinate_system.value)
|
|
24
|
+
print(variant.description.location.start.coordinate)
|
|
25
|
+
print(variant.description.location.start.offset)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Known but unsupported HGVS syntax raises `tinyhgvserror` with diagnostic code:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from tinyhgvs import TinyHGVSError, parse_hgvs
|
|
32
|
+
|
|
33
|
+
try:
|
|
34
|
+
parse_hgvs("NC_000001.11:g.[123G>A;345del]")
|
|
35
|
+
except TinyHGVSError as error:
|
|
36
|
+
print(error.code)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
Please refer to official documents for details about both Python and Rust APIs:
|
|
42
|
+
|
|
43
|
+
- [Python API and project docs](https://svm-zhang.github.io/tinyhgvs)
|
|
44
|
+
- [Rust API docs](https://docs.rs/tinyhgvs)
|
|
45
|
+
|
|
46
|
+
## Citation
|
|
47
|
+
|
|
48
|
+
If you use `tinyhgvs` in your project, please kindly cite the github repository.
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
`tinyhgvs` is licensed under MIT license.
|