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.
Files changed (51) hide show
  1. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/PKG-INFO +18 -9
  2. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/README.md +16 -7
  3. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/pyproject.toml +3 -3
  4. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/__init__.py +22 -0
  5. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/api.py +125 -72
  6. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/version.py +1 -1
  7. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/LICENSE +0 -0
  8. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/__main__.py +0 -0
  9. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/cli.py +0 -0
  10. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/__init__.py +0 -0
  11. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/chebi.yaml +0 -0
  12. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/ensembl.yaml +0 -0
  13. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/hgnc.yaml +0 -0
  14. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/hmdb_metabolites.yaml +0 -0
  15. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/hmdb_proteins.yaml +0 -0
  16. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/ncbi.yaml +0 -0
  17. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/uniprot.yaml +0 -0
  18. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/vgnc.yaml +0 -0
  19. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/config/wikidata.yaml +0 -0
  20. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/consolidate.py +0 -0
  21. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/constants.py +0 -0
  22. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/download.py +0 -0
  23. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/__init__.py +0 -0
  24. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/chebi.py +0 -0
  25. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/ensembl.py +0 -0
  26. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/hgnc.py +0 -0
  27. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/hmdb.py +0 -0
  28. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/ncbi.py +0 -0
  29. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/downloads/uniprot.py +0 -0
  30. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/exports.py +0 -0
  31. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/logging.py +0 -0
  32. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/__init__.py +0 -0
  33. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/base.py +0 -0
  34. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/chebi.py +0 -0
  35. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/ensembl.py +0 -0
  36. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/hgnc.py +0 -0
  37. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/hmdb.py +0 -0
  38. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/ncbi.py +0 -0
  39. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/uniprot.py +0 -0
  40. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/vgnc.py +0 -0
  41. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/parsers/wikidata.py +0 -0
  42. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/py.typed +0 -0
  43. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/__init__.py +0 -0
  44. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/chemical_redirects.rq +0 -0
  45. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/chemical_redirects_test.rq +0 -0
  46. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/gene_redirects.rq +0 -0
  47. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/gene_redirects_test.rq +0 -0
  48. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/protein_redirects.rq +0 -0
  49. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/queries/protein_redirects_test.rq +0 -0
  50. {pysec2pri-0.2.3 → pysec2pri-0.2.4}/src/pysec2pri/update_ids.py +0 -0
  51. {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
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.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 by walking a datasource's
328
- historical archive (or, where the parser already exposes a real per-row date
329
- such as HGNC's `date_symbol_changed`, a single fast pass) and writes it back out
330
- as a real SSSOM mapping set whose `mapping_date` is each mapping's true first
331
- appearance:
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 --mode release # walks ~250 ChEBI releases; slow, run as a one-off
335
- pysec2pri hgnc consolidate --mode date # fast: uses HGNC's own per-row date
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 by walking a datasource's
275
- historical archive (or, where the parser already exposes a real per-row date
276
- such as HGNC's `date_symbol_changed`, a single fast pass) and writes it back out
277
- as a real SSSOM mapping set whose `mapping_date` is each mapping's true first
278
- appearance:
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 --mode release # walks ~250 ChEBI releases; slow, run as a one-off
282
- pysec2pri hgnc consolidate --mode date # fast: uses HGNC's own per-row date
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.3"
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.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.3"
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 a pysec2pri TSV file.
1515
+ """Load an ID mapping set from an SSSOM TSV file.
1507
1516
 
1508
- Accepts the ``sec2pri`` TSV format (columns ``subject_id``, ``object_id``,
1509
- ``predicate_id``, ``mapping_cardinality``) and the full SSSOM TSV format
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
- import pandas as pd
1520
- from sssom_schema import Mapping
1523
+ from mapkgsutils.exports import read_sssom
1521
1524
 
1522
- path = Path(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/label mapping set from a pysec2pri TSV file.
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
- Accepts two column-name conventions:
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
- Full SSSOM TSV (comment-prefixed metadata lines) is also accepted.
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 to load.
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
- Returns:
1560
- A :class:`~pysec2pri.parsers.base.LabelMappingSet` populated from
1561
- the file, ready to pass to :func:`resolve_labels`.
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
- import pandas as pd
1564
- from sssom_schema import Mapping
1561
+ from pysec2pri.parsers import EnsemblParser
1565
1562
 
1566
- path = Path(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
- def _col(row: pd.Series, *names: str) -> str | None:
1574
- for name in names:
1575
- val = row.get(name)
1576
- if val and str(val).strip():
1577
- return str(val).strip()
1578
- return None
1579
-
1580
- mappings: list[Mapping] = []
1581
- for _, row in df.iterrows():
1582
- m = Mapping(
1583
- subject_id=_col(row, "secondary_id", "subject_id") or "",
1584
- subject_label=_col(row, "secondary_label", "subject_label"),
1585
- object_id=_col(row, "primary_id", "object_id") or "",
1586
- object_label=_col(row, "primary_label", "object_label"),
1587
- predicate_id=_col(row, "predicate_id") or "",
1588
- mapping_justification=_col(row, "mapping_justification")
1589
- or "semapv:BackgroundKnowledgeBasedMatching",
1590
- mapping_cardinality=_col(row, "mapping_cardinality"),
1591
- )
1592
- mappings.append(m)
1593
- ms.mappings = mappings
1594
- return ms
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(
@@ -12,7 +12,7 @@ __all__ = [
12
12
  "get_version",
13
13
  ]
14
14
 
15
- VERSION = "0.2.3"
15
+ VERSION = "0.2.4"
16
16
 
17
17
 
18
18
  def get_git_hash() -> str:
File without changes