pyobo 0.10.5__py3-none-any.whl → 0.10.7__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.
@@ -1,242 +1,243 @@
1
- key name
2
- AA Attribute type abbreviation
3
- AB Abbreviation in any source vocabulary
4
- ACR Acronym
5
- AC Activities
6
- AD Adjective
7
- AM Short form of modifier
8
- AS Attribute type synonym
9
- AT Attribute type
10
- AUN Authority name
11
- BD Fully-specified drug brand name that can be prescribed
12
- BN Fully-specified drug brand name that can not be prescribed
13
- BPCK Branded Drug Delivery Device
14
- BR Binding realm
15
- CA2 ISO 3166-1 standard country code in alpha-2 (two-letter) format
16
- CA3 ISO 3166-1 standard country code in alpha-3 (three-letter) format
17
- CCN Chemical code name
18
- CCS FIPS 10-4 country code
19
- CC Trimmed ICPC component process
20
- CDA Clinical drug name in abbreviated format
21
- CDC Clinical drug name in concatenated format (NDDF), Clinical drug name (NDFRT)
22
- CDD Clinical drug name in delimited format
23
- CDO Concept domain
24
- CD Clinical Drug
25
- CE Entry term for a Supplementary Concept
26
- CHN Chemical structure name
27
- CL Class
28
- CMN Common name
29
- CN LOINC official component name
30
- CO Component name (these are hierarchical terms, as opposed to the LOINC component names which are analytes)
31
- CPR Concept property
32
- CP ICPC component process (in original form)
33
- CR Concept relationship
34
- CSN Chemical Structure Name
35
- CSY Code system
36
- CS Short component process in ICPC, i.e. include some abbreviations
37
- CU Common usage
38
- CV Content view
39
- CX Component, with abbreviations expanded.
40
- DC10 Diagnostic criteria for ICD10 code
41
- DC9 Diagnostic criteria for ICD9 code
42
- DEV Descriptor entry version
43
- DE Descriptor
44
- DFG Dose Form Group
45
- DF Dose Form
46
- DI Disease name
47
- DN Display Name
48
- DO Domain
49
- DP Drug Product
50
- DSV Descriptor sort version
51
- DS Short form of descriptor
52
- DT Definitional term, present in the Metathesaurus because of its connection to a Dorland's definition or to a definition created especially for the Metathesaurus
53
- EP Print entry term
54
- EQ Equivalent name
55
- ES Short form of entry term
56
- ETAL Entry Term Alias
57
- ETCF Entry term, consumer friendly description
58
- ETCLIN Entry term, clinician description
59
- ET Entry term
60
- EX Expanded form of entry term
61
- FBD Foreign brand name
62
- FI Finding name
63
- FN Full form of descriptor
64
- FSY Foreign Synonym
65
- GLP Global period
66
- GN Generic drug name
67
- GO Goal
68
- GPCK Generic Drug Delivery Device
69
- GT Glossary term
70
- HC Hierarchical class
71
- HD Hierarchical descriptor
72
- HGJKN1 Japanese High Level Group Term (kana1)
73
- HGJKN Japanese High Level Group Term (kana)
74
- HG High Level Group Term
75
- HS Short or alternate version of hierarchical term
76
- HTJKN1 Japanese Hierarchical term (kana1)
77
- HTJKN Japanese Hierarchical term (kana)
78
- HTN HL7 Table Name
79
- HT Hierarchical term
80
- HX Expanded version of short hierarchical term
81
- ID Nursing indicator
82
- IN Name for an ingredient
83
- IS Obsolete Synonym
84
- IT Index term
85
- IVC Intervention categories
86
- IV Intervention
87
- LA LOINC answer
88
- LC Long common name
89
- LG LOINC group
90
- LLTJKN1 Japanese Lower Level Term (kana1)
91
- LLTJKN Japanese Lower Level Term (kana)
92
- LLT Lower Level Term
93
- LN LOINC official fully specified name
94
- LO Obsolete official fully specified name
95
- LPDN LOINC parts display name
96
- LPN LOINC parts name
97
- LS Expanded system/sample type (The expanded version was created for the Metathesaurus and includes the full name of some abbreviations.)
98
- LVDN Linguistic variant display name
99
- LV Lexical variant
100
- MD CCS multi-level diagnosis categories
101
- MH Main heading
102
- MIN name for a multi-ingredient
103
- MP Preferred names of modifiers
104
- MS Multum names of branded and generic supplies or supplements
105
- MTH_ACR MTH acronym
106
- MTH_CN MTH Component, with abbreviations expanded.
107
- MTH_ET Metathesaurus entry term
108
- MTH_FN MTH Full form of descriptor
109
- MTH_HG MTH High Level Group Term
110
- MTH_HT MTH Hierarchical term
111
- MTH_HX MTH Hierarchical term expanded
112
- MTH_IS Metathesaurus-supplied form of obsolete synonym
113
- MTH_LLT MTH Lower Level Term
114
- MTH_LN MTH Official fully specified name with expanded abbreviations
115
- MTH_LO MTH Expanded LOINC obsolete fully specified name
116
- MTH_OAF Metathesaurus-supplied form of obsolete active fully specified name
117
- MTH_OAP Metathesaurus-supplied form of obsolete active preferred term
118
- MTH_OAS Metathesaurus-supplied form of obsolete active synonym
119
- MTH_OET Metathesaurus obsolete entry term
120
- MTH_OF Metathesaurus-supplied form of obsolete fully specified name
121
- MTH_OL MTH Non-current Lower Level Term
122
- MTH_OPN Metathesaurus obsolete preferred term, natural language form
123
- MTH_OP Metathesaurus obsolete preferred term
124
- MTH_OS MTH System-organ class
125
- MTH_PTGB Metathesaurus-supplied form of British preferred term
126
- MTH_PTN Metathesaurus preferred term, natural language form
127
- MTH_PT Metathesaurus preferred term
128
- MTH_RXN_BD RxNorm Created BD
129
- MTH_RXN_CDC RxNorm Created CDC
130
- MTH_RXN_CD RxNorm Created CD
131
- MTH_RXN_DP RxNorm Created DP
132
- MTH_SI MTH Sign or symptom of
133
- MTH_SMQ Metathesaurus version of Standardised MedDRA Query
134
- MTH_SYGB Metathesaurus-supplied form of British synonym
135
- MTH_SY MTH Designated synonym
136
- MV Multi-level procedure category
137
- N1 Chemical Abstracts Service Type 1 name of a chemical
138
- NA Name aliases
139
- NM Name of Supplementary Concept
140
- NPT HL7 non-preferred for language term
141
- NP Non-preferred term
142
- NS Short form of non-preferred term
143
- NX Expanded form of non-preferred term
144
- OAF Obsolete active fully specified name
145
- OAM Obsolete Modifier Abbreviation
146
- OAP Obsolete active preferred term
147
- OAS Obsolete active synonym
148
- OA Obsolete abbreviation
149
- OC Nursing outcomes
150
- OET Obsolete entry term
151
- OF Obsolete fully specified name
152
- OLC Obsolete Long common name
153
- OLG Obsolete LOINC group name
154
- OLJKN1 Japanese Non-current Lower Level Term (kana1)
155
- OLJKN Japanese Non-current Lower Level Term (kana)
156
- OL Non-current Lower Level Term
157
- OM Obsolete modifiers in HCPCS
158
- ONP Obsolete non-preferred for language term
159
- OOSN Obsolete official short name
160
- OPN Obsolete preferred term, natural language form
161
- OP Obsolete preferred name
162
- OR Orders
163
- OSJKN1 Japanese System-organ class in the WHO Adverse Reaction Terminology (kana1)
164
- OSJKN Japanese System-organ class in the WHO Adverse Reaction Terminology (kana)
165
- OSN Official short name
166
- OS System-organ class
167
- PCE Preferred entry term for Supplementary Concept
168
- PC "Preferred ""trimmed term"" in ICPC"
169
- PEP Preferred entry term
170
- PHENO_ET Phenotype entry term
171
- PHENO Phenotype
172
- PIN Name from a precise ingredient
173
- PM Machine permutation
174
- PN Metathesaurus preferred name
175
- POS Place of service
176
- PQ Qualifier for a problem
177
- PR Name of a problem
178
- PSC Protocol selection criteria
179
- PSN Prescribable Names
180
- PS Short forms that needed full specification
181
- PTAV Preferred Allelic Variant
182
- PTCS Preferred Clinical Synopsis
183
- PTGB British preferred term
184
- PTJKN1 Japanese Designated preferred name (kana1)
185
- PTJKN Japanese Designated preferred name (kana)
186
- PTN Preferred term, natural language form
187
- PT Designated preferred name
188
- PXQ Preferred qualifier term
189
- PX Expanded preferred terms (pair with PS)
190
- QAB Qualifier abbreviation
191
- QEV Qualifier entry version
192
- QSV Qualifier sort version
193
- RAB Root abbreviation
194
- RHT Root hierarchical term
195
- RPT Root preferred term
196
- RSY Root synonym
197
- RS Extracted related names in SNOMED2
198
- RT Term that is related to, but often considered non-synonymous with, the preferred term
199
- RXN_IN Rxnorm Preferred Ingredient
200
- RXN_PT Rxnorm Preferred
201
- SBDC Semantic Branded Drug Component
202
- SBDF Semantic branded drug and form
203
- SBDG Semantic branded drug group
204
- SBD Semantic branded drug
205
- SB Named subset of a source
206
- SCALE Scale
207
- SCDC Semantic Drug Component
208
- SCDF Semantic clinical drug and form
209
- SCDG Semantic clinical drug group
210
- SCD Semantic Clinical Drug
211
- SCN Scientific name
212
- SC Special Category term
213
- SD CCS single-level diagnosis categories
214
- SI Name of a sign or symptom of a problem
215
- SMQ Standardised MedDRA Query
216
- SP CCS single-level procedure categories
217
- SSN Source short name, used in the UMLS Knowledge Source Server
218
- SS "Synonymous ""short"" forms"
219
- ST Step
220
- SU Active Substance
221
- SX Mixed-case component synonym with expanded abbreviations
222
- SYGB British synonym
223
- SYN Designated alias
224
- SY Designated synonym
225
- TA Task
226
- TC Term class
227
- TG Name of the target of an intervention
228
- TMSY Tall Man synonym
229
- TQ Topical qualifier
230
- TX CCPSS synthesized problems for TC termgroup
231
- UAUN Unique authority name
232
- UCN Unique common name
233
- UE Unique equivalent name
234
- USN Unique scientific name
235
- USY Unique synonym
236
- VAB Versioned abbreviation
237
- VPT Versioned preferred term
238
- VSY Versioned synonym
239
- VS Value Set
240
- XD Expanded descriptor in AOD
241
- XM Cross mapping set
242
- XQ Alternate name for a qualifier
1
+ key name
2
+ AA Attribute type abbreviation
3
+ AB Abbreviation in any source vocabulary
4
+ AC Activities
5
+ ACR Acronym
6
+ AD Adjective
7
+ AM Short form of modifier
8
+ AS Attribute type synonym
9
+ AT Attribute type
10
+ BD Fully-specified drug brand name that can be prescribed
11
+ BN Fully-specified drug brand name that can not be prescribed
12
+ BPCK Branded Drug Delivery Device
13
+ BR Binding realm
14
+ CA2 ISO 3166-1 standard country code in alpha-2 (two-letter) format
15
+ CA3 ISO 3166-1 standard country code in alpha-3 (three-letter) format
16
+ CC Trimmed ICPC component process
17
+ CCN Chemical code name
18
+ CCS FIPS 10-4 country code
19
+ CD Clinical Drug
20
+ CDA Clinical drug name in abbreviated format
21
+ CDC Clinical drug name in concatenated format (NDDF)
22
+ CDD Clinical drug name in delimited format
23
+ CDO Concept domain
24
+ CE Entry term for a Supplementary Concept
25
+ CHN Chemical structure name
26
+ CL Class
27
+ CMN Common name
28
+ CN LOINC official component name
29
+ CO Component name (these are hierarchical terms, as opposed to the LOINC component names which are analytes)
30
+ CP ICPC component process (in original form)
31
+ CPR Concept property
32
+ CR Concept relationship
33
+ CS Short component process in ICPC, i.e. include some abbreviations
34
+ CSN Chemical Structure Name
35
+ CSY Code system
36
+ CU Common usage
37
+ CV Content view
38
+ CX Component, with abbreviations expanded.
39
+ DC10 Diagnostic criteria for ICD10 code
40
+ DC9 Diagnostic criteria for ICD9 code
41
+ DE Descriptor
42
+ DEV Descriptor entry version
43
+ DF Dose Form
44
+ DFG Dose Form Group
45
+ DI Disease name
46
+ DN Display Name
47
+ DO Domain
48
+ DP Drug Product
49
+ DS Short form of descriptor
50
+ DSV Descriptor sort version
51
+ DT Definitional term, present in the Metathesaurus because of its connection to a Dorland's definition or to a definition created especially for the Metathesaurus
52
+ EP Print entry term
53
+ EQ Equivalent name
54
+ ES Short form of entry term
55
+ ET Entry term
56
+ ETAL Entry Term Alias
57
+ ETCF Entry term, consumer friendly description
58
+ ETCLIN Entry term, clinician description
59
+ EX Expanded form of entry term
60
+ FBD Foreign brand name
61
+ FI Finding name
62
+ FN Full form of descriptor
63
+ FSY Foreign Synonym
64
+ GLP Global period
65
+ GN Generic drug name
66
+ GO Goal
67
+ GPCK Generic Drug Delivery Device
68
+ GT Glossary term
69
+ HC Hierarchical class
70
+ HD Hierarchical descriptor
71
+ HG High Level Group Term
72
+ HGJKN Japanese High Level Group Term (kana)
73
+ HGJKN1 Japanese High Level Group Term (kana1)
74
+ HS Short or alternate version of hierarchical term
75
+ HT Hierarchical term
76
+ HTJKN Japanese Hierarchical term (kana)
77
+ HTJKN1 Japanese Hierarchical term (kana1)
78
+ HTN HL7 Table Name
79
+ HX Expanded version of short hierarchical term
80
+ ID Nursing indicator
81
+ IN Name for an ingredient
82
+ IS Obsolete Synonym
83
+ IT Index term
84
+ IV Intervention
85
+ IVC Intervention categories
86
+ LA LOINC answer
87
+ LC Long common name
88
+ LG LOINC group
89
+ LLT Lower Level Term
90
+ LLTJKN Japanese Lower Level Term (kana)
91
+ LLTJKN1 Japanese Lower Level Term (kana1)
92
+ LN LOINC official fully specified name
93
+ LO Obsolete official fully specified name
94
+ LPDN LOINC parts display name
95
+ LPN LOINC parts name
96
+ LS Expanded system/sample type (The expanded version was created for the Metathesaurus and includes the full name of some abbreviations.)
97
+ LV Lexical variant
98
+ LVDN Linguistic variant display name
99
+ MD CCS multi-level diagnosis categories
100
+ MH Main heading
101
+ MIN name for a multi-ingredient
102
+ MP Preferred names of modifiers
103
+ MS Multum names of branded and generic supplies or supplements
104
+ MTH_ACR MTH acronym
105
+ MTH_CN MTH Component, with abbreviations expanded.
106
+ MTH_ET Metathesaurus entry term
107
+ MTH_FN MTH Full form of descriptor
108
+ MTH_HG MTH High Level Group Term
109
+ MTH_HT MTH Hierarchical term
110
+ MTH_HX MTH Hierarchical term expanded
111
+ MTH_IS Metathesaurus-supplied form of obsolete synonym
112
+ MTH_LLT MTH Lower Level Term
113
+ MTH_LN MTH Official fully specified name with expanded abbreviations
114
+ MTH_LO MTH Expanded LOINC obsolete fully specified name
115
+ MTH_OAF Metathesaurus-supplied form of obsolete active fully specified name
116
+ MTH_OAP Metathesaurus-supplied form of obsolete active preferred term
117
+ MTH_OAS Metathesaurus-supplied form of obsolete active synonym
118
+ MTH_OET Metathesaurus obsolete entry term
119
+ MTH_OF Metathesaurus-supplied form of obsolete fully specified name
120
+ MTH_OL MTH Non-current Lower Level Term
121
+ MTH_OP Metathesaurus obsolete preferred term
122
+ MTH_OPN Metathesaurus obsolete preferred term, natural language form
123
+ MTH_OS MTH System-organ class
124
+ MTH_PT Metathesaurus preferred term
125
+ MTH_PTGB Metathesaurus-supplied form of British preferred term
126
+ MTH_PTN Metathesaurus preferred term, natural language form
127
+ MTH_RXN_BD RxNorm Created BD
128
+ MTH_RXN_CD RxNorm Created CD
129
+ MTH_RXN_CDC RxNorm Created CDC
130
+ MTH_RXN_DP RxNorm Created DP
131
+ MTH_SI MTH Sign or symptom of
132
+ MTH_SMQ Metathesaurus version of Standardised MedDRA Query
133
+ MTH_SY MTH Designated synonym
134
+ MTH_SYGB Metathesaurus-supplied form of British synonym
135
+ MV Multi-level procedure category
136
+ N1 Chemical Abstracts Service Type 1 name of a chemical
137
+ NA Name aliases
138
+ NM Name of Supplementary Concept
139
+ NP Non-preferred term
140
+ NPT HL7 non-preferred for language term
141
+ NS Short form of non-preferred term
142
+ NX Expanded form of non-preferred term
143
+ OA Obsolete abbreviation
144
+ OAF Obsolete active fully specified name
145
+ OAM Obsolete Modifier Abbreviation
146
+ OAP Obsolete active preferred term
147
+ OAS Obsolete active synonym
148
+ OC Nursing outcomes
149
+ OET Obsolete entry term
150
+ OF Obsolete fully specified name
151
+ OL Non-current Lower Level Term
152
+ OLC Obsolete Long common name
153
+ OLG Obsolete LOINC group name
154
+ OLJKN Japanese Non-current Lower Level Term (kana)
155
+ OLJKN1 Japanese Non-current Lower Level Term (kana1)
156
+ OM Obsolete modifiers in HCPCS
157
+ ONP Obsolete non-preferred for language term
158
+ OOSN Obsolete official short name
159
+ OP Obsolete preferred name
160
+ OPN Obsolete preferred term, natural language form
161
+ OR Orders
162
+ OS System-organ class
163
+ OSJKN Japanese System-organ class in the WHO Adverse Reaction Terminology (kana)
164
+ OSJKN1 Japanese System-organ class in the WHO Adverse Reaction Terminology (kana1)
165
+ OSN Official short name
166
+ PC "Preferred ""trimmed term"" in ICPC"
167
+ PCE Preferred entry term for Supplementary Concept
168
+ PEP Preferred entry term
169
+ PHENO Phenotype
170
+ PHENO_ET Phenotype entry term
171
+ PIN Name from a precise ingredient
172
+ PM Machine permutation
173
+ PN Metathesaurus preferred name
174
+ POS Place of service
175
+ PQ Qualifier for a problem
176
+ PR Name of a problem
177
+ PS Short forms that needed full specification
178
+ PSC Protocol selection criteria
179
+ PSN Prescribable Names
180
+ PT Designated preferred name
181
+ PTAV Preferred Allelic Variant
182
+ PTCS Preferred Clinical Synopsis
183
+ PTGB British preferred term
184
+ PTJKN Japanese Designated preferred name (kana)
185
+ PTJKN1 Japanese Designated preferred name (kana1)
186
+ PTN Preferred term, natural language form
187
+ PX Expanded preferred terms (pair with PS)
188
+ PXQ Preferred qualifier term
189
+ QAB Qualifier abbreviation
190
+ QEV Qualifier entry version
191
+ QSV Qualifier sort version
192
+ RAB Root abbreviation
193
+ RHT Root hierarchical term
194
+ RPT Root preferred term
195
+ RS Extracted related names in SNOMED2
196
+ RSY Root synonym
197
+ RT Term that is related to, but often considered non-synonymous with, the preferred term
198
+ RXN_IN Rxnorm Preferred Ingredient
199
+ RXN_PT Rxnorm Preferred
200
+ SB Named subset of a source
201
+ SBD Semantic branded drug
202
+ SBDC Semantic Branded Drug Component
203
+ SBDF Semantic branded drug and form
204
+ SBDFP Semantic branded drug and form with precise ingredient as basis of strength
205
+ SBDG Semantic branded drug group
206
+ SC Special Category term
207
+ SCALE Scale
208
+ SCD Semantic Clinical Drug
209
+ SCDC Semantic Drug Component
210
+ SCDF Semantic clinical drug and form
211
+ SCDFP Semantic clinical drug and form with precise ingredient as basis of strength
212
+ SCDG Semantic clinical drug group
213
+ SCDGP Semantic clinical drug group with precise ingredient as basis of strength
214
+ SCN Scientific name
215
+ SD CCS diagnosis categories
216
+ SI Name of a sign or symptom of a problem
217
+ SMQ Standardised MedDRA Query
218
+ SP CCS procedure categories
219
+ SS "Synonymous ""short"" forms"
220
+ SSN Source short name, used in the UMLS Knowledge Source Server
221
+ ST Step
222
+ SU Active Substance
223
+ SX Mixed-case component synonym with expanded abbreviations
224
+ SY Designated synonym
225
+ SYGB British synonym
226
+ SYN Designated alias
227
+ TA Task
228
+ TC Term class
229
+ TG Name of the target of an intervention
230
+ TMSY Tall Man synonym
231
+ TQ Topical qualifier
232
+ TX CCPSS synthesized problems for TC termgroup
233
+ UCN Unique common name
234
+ UE Unique equivalent name
235
+ USN Unique scientific name
236
+ USY Unique synonym
237
+ VAB Versioned abbreviation
238
+ VPT Versioned preferred term
239
+ VS Value Set
240
+ VSY Versioned synonym
241
+ XD Expanded descriptor in AOD
242
+ XM Cross mapping set
243
+ XQ Alternate name for a qualifier
@@ -7,7 +7,6 @@ Run with ``python -m pyobo.sources.umls``
7
7
 
8
8
  import itertools as itt
9
9
  import operator
10
- import os
11
10
  from typing import Iterable
12
11
 
13
12
  import bioregistry
@@ -16,14 +15,13 @@ from tqdm.auto import tqdm
16
15
  from umls_downloader import open_umls
17
16
 
18
17
  from pyobo import Obo, Reference, Synonym, SynonymTypeDef, Term
19
- from pyobo.utils.io import open_map_tsv
18
+
19
+ from .get_synonym_types import get_umls_synonyms
20
20
 
21
21
  __all__ = [
22
22
  "UMLSGetter",
23
23
  ]
24
24
 
25
- HERE = os.path.abspath(os.path.dirname(__file__))
26
- SYNONYM_TYPE_PATH = os.path.join(HERE, "synonym_types.tsv")
27
25
 
28
26
  RRF_COLUMNS = [
29
27
  "CUI",
@@ -48,10 +46,8 @@ RRF_COLUMNS = [
48
46
  ]
49
47
 
50
48
  PREFIX = "umls"
51
-
52
49
  SOURCE_VOCAB_URL = "https://www.nlm.nih.gov/research/umls/sourcereleasedocs/index.html"
53
-
54
- SYNONYM_ABB = open_map_tsv(SYNONYM_TYPE_PATH)
50
+ SYNONYM_ABB = get_umls_synonyms()
55
51
 
56
52
 
57
53
  class UMLSGetter(Obo):
@@ -30,7 +30,7 @@ class UniProtGetter(Obo):
30
30
 
31
31
  def iter_terms(self, force: bool = False) -> Iterable[Term]:
32
32
  """Iterate over terms in the ontology."""
33
- yield from iter_terms(force=force, version=self._version_or_raise)
33
+ yield from iter_terms(version=self._version_or_raise)
34
34
 
35
35
 
36
36
  def get_obo(force: bool = False) -> Obo:
@@ -38,9 +38,9 @@ def get_obo(force: bool = False) -> Obo:
38
38
  return UniProtGetter(force=force)
39
39
 
40
40
 
41
- def iter_terms(version: Optional[str] = None, force: bool = False) -> Iterable[Term]:
41
+ def iter_terms(version: Optional[str] = None) -> Iterable[Term]:
42
42
  """Iterate over UniProt Terms."""
43
- with open_reader(ensure(version=version, force=force)) as reader:
43
+ with open_reader(ensure(version=version)) as reader:
44
44
  _ = next(reader) # header
45
45
  for uniprot_id, name, taxonomy_id, _synonyms, ecs, pubmeds, pdbs in tqdm(
46
46
  reader, desc="Mapping UniProt", unit_scale=True
@@ -63,11 +63,11 @@ def iter_terms(version: Optional[str] = None, force: bool = False) -> Iterable[T
63
63
  yield term
64
64
 
65
65
 
66
- def ensure(version: Optional[str] = None, force: bool = False) -> Path:
66
+ def ensure(version: Optional[str] = None) -> Path:
67
67
  """Ensure the reviewed uniprot names are available."""
68
68
  if version is None:
69
69
  version = bioversions.get_version("uniprot")
70
- return RAW_MODULE.ensure(PREFIX, version, name="reviewed.tsv.gz", url=REVIEWED_URL, force=force)
70
+ return RAW_MODULE.ensure(PREFIX, version, name="reviewed.tsv.gz", url=REVIEWED_URL)
71
71
 
72
72
 
73
73
  if __name__ == "__main__":
pyobo/sources/zfin.py CHANGED
@@ -16,6 +16,7 @@ from pyobo.struct import (
16
16
  has_gene_product,
17
17
  orthologous,
18
18
  )
19
+ from pyobo.struct.typedef import exact_match
19
20
  from pyobo.utils.io import multidict, multisetdict
20
21
  from pyobo.utils.path import ensure_df
21
22
 
@@ -40,7 +41,7 @@ class ZFINGetter(Obo):
40
41
  """An ontology representation of ZFIN's zebrafish database."""
41
42
 
42
43
  bioversions_key = ontology = PREFIX
43
- typedefs = [from_species, has_gene_product, orthologous]
44
+ typedefs = [from_species, has_gene_product, orthologous, exact_match]
44
45
 
45
46
  def iter_terms(self, force: bool = False) -> Iterable[Term]:
46
47
  """Iterate over terms in ZFIN."""
pyobo/struct/reference.py CHANGED
@@ -31,6 +31,16 @@ class Reference(curies.Reference):
31
31
  raise ExpansionError(f"Unknown prefix: {v}")
32
32
  return norm_prefix
33
33
 
34
+ @property
35
+ def preferred_prefix(self) -> str:
36
+ """Get the preferred curie for this reference."""
37
+ return bioregistry.get_preferred_prefix(self.prefix) or self.prefix
38
+
39
+ @property
40
+ def preferred_curie(self) -> str:
41
+ """Get the preferred curie for this reference."""
42
+ return f"{self.preferred_prefix}:{self.identifier}"
43
+
34
44
  @root_validator(pre=True)
35
45
  def validate_identifier(cls, values): # noqa
36
46
  """Validate the identifier."""
@@ -48,7 +58,7 @@ class Reference(curies.Reference):
48
58
 
49
59
  @classmethod
50
60
  def auto(cls, prefix: str, identifier: str) -> "Reference":
51
- """Create a reference and auto-populate its name."""
61
+ """Create a reference and autopopulate its name."""
52
62
  from ..api import get_name
53
63
 
54
64
  name = get_name(prefix, identifier)
@@ -119,7 +129,7 @@ class Reference(curies.Reference):
119
129
  if identifier_lower.startswith(f"{self.prefix.lower()}:"):
120
130
  rv = identifier_lower
121
131
  else:
122
- rv = f"{self.prefix}:{self._escaped_identifier}"
132
+ rv = f"{self.preferred_prefix}:{self._escaped_identifier}"
123
133
  if self.name:
124
134
  rv = f"{rv} ! {self.name}"
125
135
  return rv
@@ -153,6 +163,11 @@ class Referenced:
153
163
  """The CURIE for this typedef.""" # noqa: D401
154
164
  return self.reference.curie
155
165
 
166
+ @property
167
+ def preferred_curie(self) -> str:
168
+ """The preferred CURIE for this typedef.""" # noqa: D401
169
+ return self.reference.preferred_curie
170
+
156
171
  @property
157
172
  def pair(self) -> Tuple[str, str]:
158
173
  """The pair of namespace/identifier.""" # noqa: D401