pysec2pri 0.2.3__tar.gz → 0.2.4__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.
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/PKG-INFO +18 -9
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/README.md +16 -7
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/pyproject.toml +3 -3
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/__init__.py +22 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/api.py +125 -72
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/version.py +1 -1
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/LICENSE +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/__main__.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/cli.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/__init__.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/chebi.yaml +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/ensembl.yaml +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/hgnc.yaml +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/hmdb_metabolites.yaml +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/hmdb_proteins.yaml +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/ncbi.yaml +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/uniprot.yaml +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/vgnc.yaml +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/wikidata.yaml +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/consolidate.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/constants.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/download.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/__init__.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/chebi.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/ensembl.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/hgnc.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/hmdb.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/ncbi.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/uniprot.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/exports.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/logging.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/__init__.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/base.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/chebi.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/ensembl.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/hgnc.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/hmdb.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/ncbi.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/uniprot.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/vgnc.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/wikidata.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/py.typed +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/__init__.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/chemical_redirects.rq +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/chemical_redirects_test.rq +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/gene_redirects.rq +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/gene_redirects_test.rq +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/protein_redirects.rq +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/protein_redirects_test.rq +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/update_ids.py +0 -0
- {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/xref.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pysec2pri
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Secondary to primary identifier mapping
|
|
5
5
|
Keywords: snekpack,cookiecutter
|
|
6
6
|
Author: Javier Millán Acosta
|
|
@@ -40,7 +40,7 @@ Requires-Dist: numpy
|
|
|
40
40
|
Requires-Dist: rdkit
|
|
41
41
|
Requires-Dist: polars-runtime-32
|
|
42
42
|
Requires-Dist: sssom-schema==1.1.0a5
|
|
43
|
-
Requires-Dist: mapkgsutils==0.1.
|
|
43
|
+
Requires-Dist: mapkgsutils==0.1.2
|
|
44
44
|
Maintainer: Javier Millán Acosta
|
|
45
45
|
Maintainer-email: Javier Millán Acosta <javier.millan.acosta@gmail.com>
|
|
46
46
|
Requires-Python: >=3.10
|
|
@@ -182,6 +182,15 @@ pysec2pri hgnc ids # outputs hgnc_{version}_sssom.tsv
|
|
|
182
182
|
pysec2pri update-ids gene_ex.tsv hgnc --at gene --mapping hgnc_{version}_sssom.tsv
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
+
In Python, `load_<datasource>` reads a written SSSOM file back into the same
|
|
186
|
+
`IdMappingSet`/`LabelMappingSet`:
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
from pysec2pri import load_hgnc, update_ids
|
|
190
|
+
hgnc_ms = load_hgnc("hgnc_115_sssom.tsv")
|
|
191
|
+
df_with_new_column = update_ids(mapping_set=hgnc_ms, ids=df, at="gene")
|
|
192
|
+
```
|
|
193
|
+
|
|
185
194
|
Ambiguous mappings (where a deprecated ID or label serves as a recommended for
|
|
186
195
|
another entity) are not resolved, but flagged for users to solve them manually.
|
|
187
196
|
If the input file has a column of known aliases or synonyms for each row, pass
|
|
@@ -324,15 +333,15 @@ crosswalk("ENSG00000141510", frm="ensembl", to="symbol") # via HGNC's own cross
|
|
|
324
333
|
### Consolidating mapping dates across releases
|
|
325
334
|
|
|
326
335
|
A single release snapshot only presents each mapping's _last-seen_ date.
|
|
327
|
-
`consolidate` builds a first-seen-date index
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
336
|
+
`consolidate` builds a first-seen-date index and writes it back out as a real
|
|
337
|
+
SSSOM mapping set whose `mapping_date` is each mapping's true first appearance.
|
|
338
|
+
The path is chosen automatically: datasources with a versioned archive are
|
|
339
|
+
walked release by release, while those without one (NCBI, VGNC) are covered in a
|
|
340
|
+
single fast pass over the current release:
|
|
332
341
|
|
|
333
342
|
```bash
|
|
334
|
-
pysec2pri chebi consolidate
|
|
335
|
-
pysec2pri
|
|
343
|
+
pysec2pri chebi consolidate # walks ~250 ChEBI releases (versioned archive); slow, run as a one-off
|
|
344
|
+
pysec2pri ncbi consolidate # single fast pass (no versioned archive)
|
|
336
345
|
```
|
|
337
346
|
|
|
338
347
|
Supported for `chebi`, `ensembl`, `hgnc`, `ncbi`, `uniprot`, and `vgnc`. Ensembl
|
|
@@ -129,6 +129,15 @@ pysec2pri hgnc ids # outputs hgnc_{version}_sssom.tsv
|
|
|
129
129
|
pysec2pri update-ids gene_ex.tsv hgnc --at gene --mapping hgnc_{version}_sssom.tsv
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
+
In Python, `load_<datasource>` reads a written SSSOM file back into the same
|
|
133
|
+
`IdMappingSet`/`LabelMappingSet`:
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
from pysec2pri import load_hgnc, update_ids
|
|
137
|
+
hgnc_ms = load_hgnc("hgnc_115_sssom.tsv")
|
|
138
|
+
df_with_new_column = update_ids(mapping_set=hgnc_ms, ids=df, at="gene")
|
|
139
|
+
```
|
|
140
|
+
|
|
132
141
|
Ambiguous mappings (where a deprecated ID or label serves as a recommended for
|
|
133
142
|
another entity) are not resolved, but flagged for users to solve them manually.
|
|
134
143
|
If the input file has a column of known aliases or synonyms for each row, pass
|
|
@@ -271,15 +280,15 @@ crosswalk("ENSG00000141510", frm="ensembl", to="symbol") # via HGNC's own cross
|
|
|
271
280
|
### Consolidating mapping dates across releases
|
|
272
281
|
|
|
273
282
|
A single release snapshot only presents each mapping's _last-seen_ date.
|
|
274
|
-
`consolidate` builds a first-seen-date index
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
283
|
+
`consolidate` builds a first-seen-date index and writes it back out as a real
|
|
284
|
+
SSSOM mapping set whose `mapping_date` is each mapping's true first appearance.
|
|
285
|
+
The path is chosen automatically: datasources with a versioned archive are
|
|
286
|
+
walked release by release, while those without one (NCBI, VGNC) are covered in a
|
|
287
|
+
single fast pass over the current release:
|
|
279
288
|
|
|
280
289
|
```bash
|
|
281
|
-
pysec2pri chebi consolidate
|
|
282
|
-
pysec2pri
|
|
290
|
+
pysec2pri chebi consolidate # walks ~250 ChEBI releases (versioned archive); slow, run as a one-off
|
|
291
|
+
pysec2pri ncbi consolidate # single fast pass (no versioned archive)
|
|
283
292
|
```
|
|
284
293
|
|
|
285
294
|
Supported for `chebi`, `ensembl`, `hgnc`, `ncbi`, `uniprot`, and `vgnc`. Ensembl
|
|
@@ -7,7 +7,7 @@ build-backend = "uv_build"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "pysec2pri"
|
|
10
|
-
version = "0.2.
|
|
10
|
+
version = "0.2.4"
|
|
11
11
|
description = "Secondary to primary identifier mapping"
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
authors = [
|
|
@@ -71,7 +71,7 @@ dependencies = [
|
|
|
71
71
|
"rdkit", # Chemistry toolkit for SDF parsing
|
|
72
72
|
"polars-runtime-32", # Polars runtime for 32-bit systems
|
|
73
73
|
"sssom-schema==1.1.0a5", # SSSOM schema for validation
|
|
74
|
-
"mapkgsutils==0.1.
|
|
74
|
+
"mapkgsutils==0.1.2",
|
|
75
75
|
]
|
|
76
76
|
|
|
77
77
|
# see https://peps.python.org/pep-0735/ and https://docs.astral.sh/uv/concepts/dependencies/#dependency-groups
|
|
@@ -255,7 +255,7 @@ known-first-party = [
|
|
|
255
255
|
docstring-code-format = true
|
|
256
256
|
|
|
257
257
|
[tool.bumpversion]
|
|
258
|
-
current_version = "0.2.
|
|
258
|
+
current_version = "0.2.4"
|
|
259
259
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(?:-(?P<release>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+(?P<build>[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?"
|
|
260
260
|
serialize = [
|
|
261
261
|
"{major}.{minor}.{patch}-{release}+{build}",
|
|
@@ -33,6 +33,17 @@ from pysec2pri.api import (
|
|
|
33
33
|
generate_wikidata,
|
|
34
34
|
generate_wikidata_labels,
|
|
35
35
|
list_versions,
|
|
36
|
+
load_chebi,
|
|
37
|
+
load_ensembl,
|
|
38
|
+
load_hgnc,
|
|
39
|
+
load_hmdb,
|
|
40
|
+
load_hmdb_proteins,
|
|
41
|
+
load_label_mapping,
|
|
42
|
+
load_mapping,
|
|
43
|
+
load_ncbi,
|
|
44
|
+
load_uniprot,
|
|
45
|
+
load_vgnc,
|
|
46
|
+
load_wikidata,
|
|
36
47
|
resolve_ids,
|
|
37
48
|
resolve_labels,
|
|
38
49
|
write_json,
|
|
@@ -101,6 +112,17 @@ __all__ = [
|
|
|
101
112
|
"generate_wikidata",
|
|
102
113
|
"generate_wikidata_labels",
|
|
103
114
|
"list_versions",
|
|
115
|
+
"load_chebi",
|
|
116
|
+
"load_ensembl",
|
|
117
|
+
"load_hgnc",
|
|
118
|
+
"load_hmdb",
|
|
119
|
+
"load_hmdb_proteins",
|
|
120
|
+
"load_label_mapping",
|
|
121
|
+
"load_mapping",
|
|
122
|
+
"load_ncbi",
|
|
123
|
+
"load_uniprot",
|
|
124
|
+
"load_vgnc",
|
|
125
|
+
"load_wikidata",
|
|
104
126
|
"load_xref_mapping",
|
|
105
127
|
"resolve_ambiguous_with_hints",
|
|
106
128
|
"resolve_ids",
|
|
@@ -86,8 +86,17 @@ __all__ = [
|
|
|
86
86
|
"generate_wikidata_labels",
|
|
87
87
|
"generate_wikidata_labels",
|
|
88
88
|
"list_versions",
|
|
89
|
+
"load_chebi",
|
|
90
|
+
"load_ensembl",
|
|
91
|
+
"load_hgnc",
|
|
92
|
+
"load_hmdb",
|
|
93
|
+
"load_hmdb_proteins",
|
|
89
94
|
"load_label_mapping",
|
|
90
95
|
"load_mapping",
|
|
96
|
+
"load_ncbi",
|
|
97
|
+
"load_uniprot",
|
|
98
|
+
"load_vgnc",
|
|
99
|
+
"load_wikidata",
|
|
91
100
|
"load_xref_mapping",
|
|
92
101
|
"resolve_ids",
|
|
93
102
|
"resolve_labels",
|
|
@@ -1503,95 +1512,139 @@ def write_diff_output(
|
|
|
1503
1512
|
|
|
1504
1513
|
|
|
1505
1514
|
def load_mapping(path: Path | str) -> IdMappingSet:
|
|
1506
|
-
"""Load an ID mapping set from
|
|
1515
|
+
"""Load an ID mapping set from an SSSOM TSV file.
|
|
1507
1516
|
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
(comment-prefixed metadata lines are skipped automatically).
|
|
1517
|
+
Produces the same :class:`~pysec2pri.parsers.base.IdMappingSet` a fresh
|
|
1518
|
+
parse would, ready to pass to :func:`resolve_ids`.
|
|
1511
1519
|
|
|
1512
1520
|
Args:
|
|
1513
|
-
path: Path to the TSV file to load.
|
|
1514
|
-
|
|
1515
|
-
Returns:
|
|
1516
|
-
An :class:`~pysec2pri.parsers.base.IdMappingSet` populated from the
|
|
1517
|
-
file, ready to pass to :func:`resolve_ids`.
|
|
1521
|
+
path: Path to the SSSOM TSV file to load.
|
|
1518
1522
|
"""
|
|
1519
|
-
|
|
1520
|
-
from sssom_schema import Mapping
|
|
1523
|
+
from mapkgsutils.exports import read_sssom
|
|
1521
1524
|
|
|
1522
|
-
path =
|
|
1523
|
-
df = pd.read_csv(path, sep="\t", dtype=str, comment="#")
|
|
1524
|
-
ms = IdMappingSet(
|
|
1525
|
-
mapping_set_id=str(path),
|
|
1526
|
-
license="https://creativecommons.org/licenses/by/4.0/",
|
|
1527
|
-
)
|
|
1528
|
-
mappings: list[Mapping] = []
|
|
1529
|
-
for _, row in df.iterrows():
|
|
1530
|
-
m = Mapping(
|
|
1531
|
-
subject_id=row.get("subject_id") or "",
|
|
1532
|
-
object_id=row.get("object_id") or "",
|
|
1533
|
-
predicate_id=row.get("predicate_id") or "",
|
|
1534
|
-
mapping_justification=row.get("mapping_justification")
|
|
1535
|
-
or "semapv:BackgroundKnowledgeBasedMatching",
|
|
1536
|
-
mapping_cardinality=row.get("mapping_cardinality") or None,
|
|
1537
|
-
)
|
|
1538
|
-
mappings.append(m)
|
|
1539
|
-
ms.mappings = mappings
|
|
1540
|
-
return ms
|
|
1525
|
+
return read_sssom(path, mapping_set_class=IdMappingSet, on="id")
|
|
1541
1526
|
|
|
1542
1527
|
|
|
1543
1528
|
def load_label_mapping(path: Path | str) -> LabelMappingSet:
|
|
1544
|
-
"""Load a label
|
|
1529
|
+
"""Load a label mapping set from an SSSOM TSV file.
|
|
1530
|
+
|
|
1531
|
+
Produces the same :class:`~pysec2pri.parsers.base.LabelMappingSet` a fresh
|
|
1532
|
+
parse would, ready to pass to :func:`resolve_labels`.
|
|
1533
|
+
|
|
1534
|
+
Args:
|
|
1535
|
+
path: Path to the SSSOM TSV file to load.
|
|
1536
|
+
"""
|
|
1537
|
+
from mapkgsutils.exports import read_sssom
|
|
1545
1538
|
|
|
1546
|
-
|
|
1539
|
+
return read_sssom(path, mapping_set_class=LabelMappingSet, on="label")
|
|
1547
1540
|
|
|
1548
|
-
- **New** (``label_sec2pri`` tabular output): ``secondary_id``,
|
|
1549
|
-
``secondary_label``, ``primary_id``, ``primary_label``,
|
|
1550
|
-
``predicate_id``, ``mapping_cardinality``.
|
|
1551
|
-
- **Legacy** (SSSOM or old tabular output): ``subject_id``,
|
|
1552
|
-
``subject_label``, ``object_id``, ``object_label``, ``predicate_id``.
|
|
1553
1541
|
|
|
1554
|
-
|
|
1542
|
+
def load_chebi(path: Path | str, *, mapping_type: str | None = None) -> BaseMappingSet:
|
|
1543
|
+
"""Load a ChEBI SSSOM file into the proper mapping set object.
|
|
1555
1544
|
|
|
1556
1545
|
Args:
|
|
1557
|
-
path: Path to the TSV file
|
|
1546
|
+
path: Path to the SSSOM TSV file.
|
|
1547
|
+
mapping_type: ``"id"``/``"label"`` to force the class, else inferred.
|
|
1548
|
+
"""
|
|
1549
|
+
from pysec2pri.parsers import ChEBIParser
|
|
1558
1550
|
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1551
|
+
return ChEBIParser().load(path, mapping_type=mapping_type)
|
|
1552
|
+
|
|
1553
|
+
|
|
1554
|
+
def load_ensembl(path: Path | str, *, mapping_type: str | None = None) -> BaseMappingSet:
|
|
1555
|
+
"""Load an Ensembl SSSOM file into the proper mapping set object.
|
|
1556
|
+
|
|
1557
|
+
Args:
|
|
1558
|
+
path: Path to the SSSOM TSV file.
|
|
1559
|
+
mapping_type: ``"id"``/``"label"`` to force the class, else inferred.
|
|
1562
1560
|
"""
|
|
1563
|
-
|
|
1564
|
-
from sssom_schema import Mapping
|
|
1561
|
+
from pysec2pri.parsers import EnsemblParser
|
|
1565
1562
|
|
|
1566
|
-
path =
|
|
1567
|
-
df = pd.read_csv(path, sep="\t", dtype=str, comment="#")
|
|
1568
|
-
ms = LabelMappingSet(
|
|
1569
|
-
mapping_set_id=str(path),
|
|
1570
|
-
license="https://creativecommons.org/licenses/by/4.0/",
|
|
1571
|
-
)
|
|
1563
|
+
return EnsemblParser().load(path, mapping_type=mapping_type)
|
|
1572
1564
|
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1565
|
+
|
|
1566
|
+
def load_hgnc(path: Path | str, *, mapping_type: str | None = None) -> BaseMappingSet:
|
|
1567
|
+
"""Load an HGNC SSSOM file into the proper mapping set object.
|
|
1568
|
+
|
|
1569
|
+
Args:
|
|
1570
|
+
path: Path to the SSSOM TSV file.
|
|
1571
|
+
mapping_type: ``"id"``/``"label"`` to force the class, else inferred.
|
|
1572
|
+
"""
|
|
1573
|
+
from pysec2pri.parsers import HGNCParser
|
|
1574
|
+
|
|
1575
|
+
return HGNCParser().load(path, mapping_type=mapping_type)
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
def load_ncbi(path: Path | str, *, mapping_type: str | None = None) -> BaseMappingSet:
|
|
1579
|
+
"""Load an NCBI SSSOM file into the proper mapping set object.
|
|
1580
|
+
|
|
1581
|
+
Args:
|
|
1582
|
+
path: Path to the SSSOM TSV file.
|
|
1583
|
+
mapping_type: ``"id"``/``"label"`` to force the class, else inferred.
|
|
1584
|
+
"""
|
|
1585
|
+
from pysec2pri.parsers import NCBIParser
|
|
1586
|
+
|
|
1587
|
+
return NCBIParser().load(path, mapping_type=mapping_type)
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
def load_uniprot(path: Path | str, *, mapping_type: str | None = None) -> BaseMappingSet:
|
|
1591
|
+
"""Load a UniProt SSSOM file into the proper mapping set object.
|
|
1592
|
+
|
|
1593
|
+
Args:
|
|
1594
|
+
path: Path to the SSSOM TSV file.
|
|
1595
|
+
mapping_type: ``"id"``/``"label"`` to force the class, else inferred.
|
|
1596
|
+
"""
|
|
1597
|
+
from pysec2pri.parsers import UniProtParser
|
|
1598
|
+
|
|
1599
|
+
return UniProtParser().load(path, mapping_type=mapping_type)
|
|
1600
|
+
|
|
1601
|
+
|
|
1602
|
+
def load_vgnc(path: Path | str, *, mapping_type: str | None = None) -> BaseMappingSet:
|
|
1603
|
+
"""Load a VGNC SSSOM file into the proper mapping set object.
|
|
1604
|
+
|
|
1605
|
+
Args:
|
|
1606
|
+
path: Path to the SSSOM TSV file.
|
|
1607
|
+
mapping_type: ``"id"``/``"label"`` to force the class, else inferred.
|
|
1608
|
+
"""
|
|
1609
|
+
from pysec2pri.parsers import VGNCParser
|
|
1610
|
+
|
|
1611
|
+
return VGNCParser().load(path, mapping_type=mapping_type)
|
|
1612
|
+
|
|
1613
|
+
|
|
1614
|
+
def load_hmdb(path: Path | str, *, mapping_type: str | None = None) -> BaseMappingSet:
|
|
1615
|
+
"""Load an HMDB metabolite SSSOM file into the proper mapping set object.
|
|
1616
|
+
|
|
1617
|
+
Args:
|
|
1618
|
+
path: Path to the SSSOM TSV file.
|
|
1619
|
+
mapping_type: ``"id"``/``"label"`` to force the class, else inferred.
|
|
1620
|
+
"""
|
|
1621
|
+
from pysec2pri.parsers import HMDBMetaboliteParser
|
|
1622
|
+
|
|
1623
|
+
return HMDBMetaboliteParser().load(path, mapping_type=mapping_type)
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
def load_hmdb_proteins(path: Path | str, *, mapping_type: str | None = None) -> BaseMappingSet:
|
|
1627
|
+
"""Load an HMDB protein SSSOM file into the proper mapping set object.
|
|
1628
|
+
|
|
1629
|
+
Args:
|
|
1630
|
+
path: Path to the SSSOM TSV file.
|
|
1631
|
+
mapping_type: ``"id"``/``"label"`` to force the class, else inferred.
|
|
1632
|
+
"""
|
|
1633
|
+
from pysec2pri.parsers import HMDBProteinParser
|
|
1634
|
+
|
|
1635
|
+
return HMDBProteinParser().load(path, mapping_type=mapping_type)
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
def load_wikidata(path: Path | str, *, mapping_type: str | None = None) -> BaseMappingSet:
|
|
1639
|
+
"""Load a Wikidata SSSOM file into the proper mapping set object.
|
|
1640
|
+
|
|
1641
|
+
Args:
|
|
1642
|
+
path: Path to the SSSOM TSV file.
|
|
1643
|
+
mapping_type: ``"id"``/``"label"`` to force the class, else inferred.
|
|
1644
|
+
"""
|
|
1645
|
+
from pysec2pri.parsers import WikidataParser
|
|
1646
|
+
|
|
1647
|
+
return WikidataParser().load(path, mapping_type=mapping_type)
|
|
1595
1648
|
|
|
1596
1649
|
|
|
1597
1650
|
def resolve_ids(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|