pyobo 0.10.12__py3-none-any.whl → 0.11.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.
- pyobo/__init__.py +0 -2
- pyobo/__main__.py +0 -2
- pyobo/api/__init__.py +0 -2
- pyobo/api/alts.py +6 -7
- pyobo/api/hierarchy.py +14 -15
- pyobo/api/metadata.py +3 -4
- pyobo/api/names.py +31 -32
- pyobo/api/properties.py +6 -7
- pyobo/api/relations.py +12 -11
- pyobo/api/species.py +5 -6
- pyobo/api/typedefs.py +1 -3
- pyobo/api/utils.py +61 -5
- pyobo/api/xrefs.py +4 -5
- pyobo/aws.py +3 -5
- pyobo/cli/__init__.py +0 -2
- pyobo/cli/aws.py +0 -2
- pyobo/cli/cli.py +0 -4
- pyobo/cli/database.py +1 -3
- pyobo/cli/lookup.py +0 -2
- pyobo/cli/utils.py +0 -2
- pyobo/constants.py +0 -33
- pyobo/getters.py +19 -26
- pyobo/gilda_utils.py +9 -10
- pyobo/identifier_utils.py +10 -10
- pyobo/mocks.py +5 -6
- pyobo/normalizer.py +24 -24
- pyobo/obographs.py +3 -3
- pyobo/plugins.py +3 -4
- pyobo/py.typed +0 -0
- pyobo/reader.py +19 -21
- pyobo/registries/__init__.py +0 -2
- pyobo/registries/metaregistry.py +6 -8
- pyobo/resource_utils.py +1 -3
- pyobo/resources/__init__.py +0 -2
- pyobo/resources/ncbitaxon.py +2 -3
- pyobo/resources/ro.py +2 -4
- pyobo/sources/README.md +15 -0
- pyobo/sources/__init__.py +0 -2
- pyobo/sources/agrovoc.py +3 -3
- pyobo/sources/antibodyregistry.py +2 -3
- pyobo/sources/biogrid.py +4 -4
- pyobo/sources/ccle.py +3 -4
- pyobo/sources/cgnc.py +1 -3
- pyobo/sources/chebi.py +2 -4
- pyobo/sources/chembl.py +1 -3
- pyobo/sources/civic_gene.py +2 -3
- pyobo/sources/complexportal.py +3 -5
- pyobo/sources/conso.py +2 -4
- pyobo/sources/cpt.py +1 -3
- pyobo/sources/credit.py +1 -1
- pyobo/sources/cvx.py +1 -3
- pyobo/sources/depmap.py +3 -4
- pyobo/sources/dictybase_gene.py +1 -3
- pyobo/sources/drugbank.py +6 -7
- pyobo/sources/drugbank_salt.py +3 -4
- pyobo/sources/drugcentral.py +5 -7
- pyobo/sources/expasy.py +11 -12
- pyobo/sources/famplex.py +3 -5
- pyobo/sources/flybase.py +2 -4
- pyobo/sources/geonames.py +1 -1
- pyobo/sources/gmt_utils.py +5 -6
- pyobo/sources/go.py +4 -6
- pyobo/sources/gwascentral_phenotype.py +1 -3
- pyobo/sources/gwascentral_study.py +2 -3
- pyobo/sources/hgnc.py +6 -7
- pyobo/sources/hgncgenefamily.py +2 -4
- pyobo/sources/icd10.py +3 -4
- pyobo/sources/icd11.py +3 -4
- pyobo/sources/icd_utils.py +6 -7
- pyobo/sources/interpro.py +3 -5
- pyobo/sources/itis.py +1 -3
- pyobo/sources/kegg/__init__.py +0 -2
- pyobo/sources/kegg/api.py +3 -4
- pyobo/sources/kegg/genes.py +3 -4
- pyobo/sources/kegg/genome.py +1 -3
- pyobo/sources/kegg/pathway.py +5 -6
- pyobo/sources/mesh.py +19 -21
- pyobo/sources/mgi.py +1 -3
- pyobo/sources/mirbase.py +4 -6
- pyobo/sources/mirbase_constants.py +0 -2
- pyobo/sources/mirbase_family.py +1 -3
- pyobo/sources/mirbase_mature.py +1 -3
- pyobo/sources/msigdb.py +4 -5
- pyobo/sources/ncbigene.py +3 -5
- pyobo/sources/npass.py +1 -3
- pyobo/sources/omim_ps.py +1 -3
- pyobo/sources/pathbank.py +3 -5
- pyobo/sources/pfam.py +1 -3
- pyobo/sources/pfam_clan.py +1 -3
- pyobo/sources/pid.py +3 -5
- pyobo/sources/pombase.py +1 -3
- pyobo/sources/pubchem.py +2 -3
- pyobo/sources/reactome.py +2 -4
- pyobo/sources/rgd.py +2 -3
- pyobo/sources/rhea.py +7 -8
- pyobo/sources/ror.py +3 -2
- pyobo/sources/selventa/__init__.py +0 -2
- pyobo/sources/selventa/schem.py +1 -3
- pyobo/sources/selventa/scomp.py +1 -3
- pyobo/sources/selventa/sdis.py +1 -3
- pyobo/sources/selventa/sfam.py +1 -3
- pyobo/sources/sgd.py +1 -3
- pyobo/sources/slm.py +1 -3
- pyobo/sources/umls/__init__.py +0 -2
- pyobo/sources/umls/__main__.py +0 -2
- pyobo/sources/umls/get_synonym_types.py +1 -1
- pyobo/sources/umls/umls.py +2 -4
- pyobo/sources/uniprot/__init__.py +0 -2
- pyobo/sources/uniprot/uniprot.py +4 -4
- pyobo/sources/uniprot/uniprot_ptm.py +6 -5
- pyobo/sources/utils.py +3 -5
- pyobo/sources/wikipathways.py +1 -3
- pyobo/sources/zfin.py +2 -3
- pyobo/ssg/__init__.py +3 -2
- pyobo/struct/__init__.py +0 -2
- pyobo/struct/reference.py +13 -15
- pyobo/struct/struct.py +102 -96
- pyobo/struct/typedef.py +9 -10
- pyobo/struct/utils.py +0 -2
- pyobo/utils/__init__.py +0 -2
- pyobo/utils/cache.py +14 -6
- pyobo/utils/io.py +9 -10
- pyobo/utils/iter.py +5 -6
- pyobo/utils/misc.py +1 -3
- pyobo/utils/ndex_utils.py +6 -7
- pyobo/utils/path.py +4 -5
- pyobo/version.py +3 -5
- pyobo/xrefdb/__init__.py +0 -2
- pyobo/xrefdb/canonicalizer.py +27 -18
- pyobo/xrefdb/priority.py +0 -2
- pyobo/xrefdb/sources/__init__.py +3 -4
- pyobo/xrefdb/sources/biomappings.py +0 -2
- pyobo/xrefdb/sources/cbms2019.py +0 -2
- pyobo/xrefdb/sources/chembl.py +0 -2
- pyobo/xrefdb/sources/compath.py +1 -3
- pyobo/xrefdb/sources/famplex.py +3 -5
- pyobo/xrefdb/sources/gilda.py +0 -2
- pyobo/xrefdb/sources/intact.py +5 -5
- pyobo/xrefdb/sources/ncit.py +1 -3
- pyobo/xrefdb/sources/pubchem.py +2 -5
- pyobo/xrefdb/sources/wikidata.py +2 -4
- pyobo/xrefdb/xrefs_pipeline.py +15 -16
- {pyobo-0.10.12.dist-info → pyobo-0.11.0.dist-info}/LICENSE +1 -1
- pyobo-0.11.0.dist-info/METADATA +723 -0
- pyobo-0.11.0.dist-info/RECORD +171 -0
- {pyobo-0.10.12.dist-info → pyobo-0.11.0.dist-info}/WHEEL +1 -1
- pyobo-0.11.0.dist-info/entry_points.txt +2 -0
- pyobo-0.10.12.dist-info/METADATA +0 -499
- pyobo-0.10.12.dist-info/RECORD +0 -169
- pyobo-0.10.12.dist-info/entry_points.txt +0 -15
- {pyobo-0.10.12.dist-info → pyobo-0.11.0.dist-info}/top_level.txt +0 -0
pyobo/struct/reference.py
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
1
|
"""Data structures for OBO."""
|
|
4
2
|
|
|
5
|
-
from typing import Optional
|
|
3
|
+
from typing import Optional
|
|
6
4
|
|
|
7
5
|
import bioregistry
|
|
8
6
|
import curies
|
|
9
7
|
from curies.api import ExpansionError
|
|
10
|
-
from pydantic import Field,
|
|
8
|
+
from pydantic import Field, field_validator, model_validator
|
|
11
9
|
|
|
12
10
|
from .utils import obo_escape
|
|
13
11
|
from ..identifier_utils import normalize_curie
|
|
@@ -23,7 +21,7 @@ class Reference(curies.Reference):
|
|
|
23
21
|
|
|
24
22
|
name: Optional[str] = Field(default=None, description="the name of the reference")
|
|
25
23
|
|
|
26
|
-
@
|
|
24
|
+
@field_validator("prefix")
|
|
27
25
|
def validate_prefix(cls, v): # noqa
|
|
28
26
|
"""Validate the prefix for this reference."""
|
|
29
27
|
norm_prefix = bioregistry.normalize_prefix(v)
|
|
@@ -41,7 +39,7 @@ class Reference(curies.Reference):
|
|
|
41
39
|
"""Get the preferred curie for this reference."""
|
|
42
40
|
return f"{self.preferred_prefix}:{self.identifier}"
|
|
43
41
|
|
|
44
|
-
@
|
|
42
|
+
@model_validator(mode="before")
|
|
45
43
|
def validate_identifier(cls, values): # noqa
|
|
46
44
|
"""Validate the identifier."""
|
|
47
45
|
prefix, identifier = values.get("prefix"), values.get("identifier")
|
|
@@ -124,7 +122,7 @@ class Reference(curies.Reference):
|
|
|
124
122
|
def _escaped_identifier(self):
|
|
125
123
|
return obo_escape(self.identifier)
|
|
126
124
|
|
|
127
|
-
def __str__(self):
|
|
125
|
+
def __str__(self):
|
|
128
126
|
identifier_lower = self.identifier.lower()
|
|
129
127
|
if identifier_lower.startswith(f"{self.prefix.lower()}:"):
|
|
130
128
|
rv = identifier_lower
|
|
@@ -134,7 +132,7 @@ class Reference(curies.Reference):
|
|
|
134
132
|
rv = f"{rv} ! {self.name}"
|
|
135
133
|
return rv
|
|
136
134
|
|
|
137
|
-
def __hash__(self):
|
|
135
|
+
def __hash__(self):
|
|
138
136
|
return hash((self.__class__, self.prefix, self.identifier))
|
|
139
137
|
|
|
140
138
|
|
|
@@ -145,32 +143,32 @@ class Referenced:
|
|
|
145
143
|
|
|
146
144
|
@property
|
|
147
145
|
def prefix(self):
|
|
148
|
-
"""The prefix of the typedef."""
|
|
146
|
+
"""The prefix of the typedef."""
|
|
149
147
|
return self.reference.prefix
|
|
150
148
|
|
|
151
149
|
@property
|
|
152
150
|
def name(self):
|
|
153
|
-
"""The name of the typedef."""
|
|
151
|
+
"""The name of the typedef."""
|
|
154
152
|
return self.reference.name
|
|
155
153
|
|
|
156
154
|
@property
|
|
157
155
|
def identifier(self) -> str:
|
|
158
|
-
"""The local unique identifier for this typedef."""
|
|
156
|
+
"""The local unique identifier for this typedef."""
|
|
159
157
|
return self.reference.identifier
|
|
160
158
|
|
|
161
159
|
@property
|
|
162
160
|
def curie(self) -> str:
|
|
163
|
-
"""The CURIE for this typedef."""
|
|
161
|
+
"""The CURIE for this typedef."""
|
|
164
162
|
return self.reference.curie
|
|
165
163
|
|
|
166
164
|
@property
|
|
167
165
|
def preferred_curie(self) -> str:
|
|
168
|
-
"""The preferred CURIE for this typedef."""
|
|
166
|
+
"""The preferred CURIE for this typedef."""
|
|
169
167
|
return self.reference.preferred_curie
|
|
170
168
|
|
|
171
169
|
@property
|
|
172
|
-
def pair(self) ->
|
|
173
|
-
"""The pair of namespace/identifier."""
|
|
170
|
+
def pair(self) -> tuple[str, str]:
|
|
171
|
+
"""The pair of namespace/identifier."""
|
|
174
172
|
return self.reference.pair
|
|
175
173
|
|
|
176
174
|
@property
|