pyobo 0.12.0__py3-none-any.whl → 0.12.1__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/.DS_Store +0 -0
- pyobo/api/properties.py +8 -12
- pyobo/api/xrefs.py +1 -2
- pyobo/cli/database.py +30 -2
- pyobo/cli/database_utils.py +5 -11
- pyobo/getters.py +18 -78
- pyobo/gilda_utils.py +3 -80
- pyobo/identifier_utils/__init__.py +2 -10
- pyobo/identifier_utils/api.py +21 -12
- pyobo/identifier_utils/preprocessing.json +74 -13
- pyobo/identifier_utils/preprocessing.py +5 -39
- pyobo/obographs.py +5 -1
- pyobo/reader.py +13 -17
- pyobo/sources/cgnc.py +9 -1
- pyobo/sources/flybase.py +5 -5
- pyobo/sources/omim_ps.py +4 -4
- pyobo/sources/pharmgkb/pharmgkb_gene.py +1 -1
- pyobo/struct/functional/ontology.py +3 -1
- pyobo/struct/reference.py +4 -4
- pyobo/struct/struct.py +112 -55
- pyobo/utils/cache.py +3 -4
- pyobo/utils/io.py +38 -14
- pyobo/utils/path.py +16 -19
- pyobo/version.py +1 -1
- {pyobo-0.12.0.dist-info → pyobo-0.12.1.dist-info}/METADATA +71 -110
- {pyobo-0.12.0.dist-info → pyobo-0.12.1.dist-info}/RECORD +29 -30
- {pyobo-0.12.0.dist-info → pyobo-0.12.1.dist-info}/WHEEL +1 -1
- pyobo/identifier_utils/model.py +0 -130
- {pyobo-0.12.0.dist-info → pyobo-0.12.1.dist-info}/entry_points.txt +0 -0
- {pyobo-0.12.0.dist-info → pyobo-0.12.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyobo
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.1
|
|
4
4
|
Summary: A python package for handling and generating OBO
|
|
5
5
|
Keywords: snekpack,cookiecutter,ontologies,biomedical ontologies,life sciences,natural sciences,bioinformatics,cheminformatics,Open Biomedical Ontologies,OBO
|
|
6
6
|
Author: Charles Tapley Hoyt
|
|
@@ -37,7 +37,7 @@ Requires-Dist: humanize
|
|
|
37
37
|
Requires-Dist: tabulate
|
|
38
38
|
Requires-Dist: cachier
|
|
39
39
|
Requires-Dist: pystow>=0.7.0
|
|
40
|
-
Requires-Dist: bioversions>=0.
|
|
40
|
+
Requires-Dist: bioversions>=0.8.0
|
|
41
41
|
Requires-Dist: bioregistry>=0.12.7
|
|
42
42
|
Requires-Dist: bioontologies>=0.7.1
|
|
43
43
|
Requires-Dist: ssslm>=0.0.13
|
|
@@ -45,7 +45,7 @@ Requires-Dist: zenodo-client>=0.3.6
|
|
|
45
45
|
Requires-Dist: class-resolver>=0.6.0
|
|
46
46
|
Requires-Dist: psycopg2-binary
|
|
47
47
|
Requires-Dist: pydantic>=2.0
|
|
48
|
-
Requires-Dist: curies>=0.10.
|
|
48
|
+
Requires-Dist: curies>=0.10.13
|
|
49
49
|
Requires-Dist: python-dateutil
|
|
50
50
|
Requires-Dist: networkx>=3.4
|
|
51
51
|
Requires-Dist: drugbank-downloader
|
|
@@ -55,14 +55,8 @@ Requires-Dist: clinicaltrials-downloader>=0.0.2
|
|
|
55
55
|
Requires-Dist: nih-reporter-downloader>=0.0.1
|
|
56
56
|
Requires-Dist: typing-extensions
|
|
57
57
|
Requires-Dist: rdflib
|
|
58
|
-
Requires-Dist: sphinx>=8 ; extra == 'docs'
|
|
59
|
-
Requires-Dist: sphinx-rtd-theme>=3.0 ; extra == 'docs'
|
|
60
|
-
Requires-Dist: sphinx-click ; extra == 'docs'
|
|
61
|
-
Requires-Dist: sphinx-automodapi ; extra == 'docs'
|
|
62
58
|
Requires-Dist: ssslm[gilda] ; extra == 'gilda'
|
|
63
59
|
Requires-Dist: ssslm[gilda-slim] ; extra == 'gilda-slim'
|
|
64
|
-
Requires-Dist: pytest ; extra == 'tests'
|
|
65
|
-
Requires-Dist: coverage[toml] ; extra == 'tests'
|
|
66
60
|
Maintainer: Charles Tapley Hoyt
|
|
67
61
|
Maintainer-email: Charles Tapley Hoyt <cthoyt@gmail.com>
|
|
68
62
|
Requires-Python: >=3.10
|
|
@@ -71,10 +65,8 @@ Project-URL: Documentation, https://pyobo.readthedocs.io
|
|
|
71
65
|
Project-URL: Funding, https://github.com/sponsors/cthoyt
|
|
72
66
|
Project-URL: Homepage, https://github.com/biopragmatics/pyobo
|
|
73
67
|
Project-URL: Repository, https://github.com/biopragmatics/pyobo.git
|
|
74
|
-
Provides-Extra: docs
|
|
75
68
|
Provides-Extra: gilda
|
|
76
69
|
Provides-Extra: gilda-slim
|
|
77
|
-
Provides-Extra: tests
|
|
78
70
|
Description-Content-Type: text/markdown
|
|
79
71
|
|
|
80
72
|
<!--
|
|
@@ -120,14 +112,7 @@ identifiers. It also means all identifiers are strings, no exceptions.
|
|
|
120
112
|
|
|
121
113
|
Note! The first time you run these, they have to download and cache all
|
|
122
114
|
resources. We're not in the business of redistributing data, so all scripts
|
|
123
|
-
should be completely reproducible.
|
|
124
|
-
hosting/downloading pre-compiled versions in `pyobo.aws` if you don't have time
|
|
125
|
-
for that.
|
|
126
|
-
|
|
127
|
-
Note! PyOBO can perform grounding in a limited number of cases, but it is _not_
|
|
128
|
-
a general solution for named entity recognition (NER) or grounding. It's
|
|
129
|
-
suggested to check `Gilda <https://github.com/indralab/gilda>`\_ for a
|
|
130
|
-
no-nonsense solution.
|
|
115
|
+
should be completely reproducible.
|
|
131
116
|
|
|
132
117
|
### Mapping Identifiers and CURIEs
|
|
133
118
|
|
|
@@ -136,19 +121,11 @@ Get mapping of ChEBI identifiers to names:
|
|
|
136
121
|
```python
|
|
137
122
|
import pyobo
|
|
138
123
|
|
|
139
|
-
chebi_id_to_name = pyobo.get_id_name_mapping(
|
|
124
|
+
chebi_id_to_name = pyobo.get_id_name_mapping("chebi")
|
|
125
|
+
assert "fluazifop-P-butyl" == chebi_id_to_name["132964"]
|
|
140
126
|
|
|
141
|
-
|
|
142
|
-
assert
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Or, you don't have time for two lines:
|
|
146
|
-
|
|
147
|
-
```python
|
|
148
|
-
import pyobo
|
|
149
|
-
|
|
150
|
-
name = pyobo.get_name('chebi', '132964')
|
|
151
|
-
assert name == 'fluazifop-P-butyl'
|
|
127
|
+
# or more directly
|
|
128
|
+
assert "fluazifop-P-butyl" == pyobo.get_name("chebi", "132964")
|
|
152
129
|
```
|
|
153
130
|
|
|
154
131
|
Get reverse mapping of ChEBI names to identifiers:
|
|
@@ -156,10 +133,8 @@ Get reverse mapping of ChEBI names to identifiers:
|
|
|
156
133
|
```python
|
|
157
134
|
import pyobo
|
|
158
135
|
|
|
159
|
-
chebi_name_to_id = pyobo.get_name_id_mapping(
|
|
160
|
-
|
|
161
|
-
identifier = chebi_name_to_id['fluazifop-P-butyl']
|
|
162
|
-
assert identifier == '132964'
|
|
136
|
+
chebi_name_to_id = pyobo.get_name_id_mapping("chebi")
|
|
137
|
+
assert "132964" == chebi_name_to_id["fluazifop-P-butyl"]
|
|
163
138
|
```
|
|
164
139
|
|
|
165
140
|
Maybe you live in CURIE world and just want to normalize something like
|
|
@@ -168,8 +143,7 @@ Maybe you live in CURIE world and just want to normalize something like
|
|
|
168
143
|
```python
|
|
169
144
|
import pyobo
|
|
170
145
|
|
|
171
|
-
|
|
172
|
-
assert name == 'fluazifop-P-butyl'
|
|
146
|
+
assert "fluazifop-P-butyl" == pyobo.get_name_by_curie("CHEBI:132964")
|
|
173
147
|
```
|
|
174
148
|
|
|
175
149
|
Sometimes you accidentally got an old CURIE. It can be mapped to the more recent
|
|
@@ -181,11 +155,11 @@ from pyobo import Reference
|
|
|
181
155
|
|
|
182
156
|
# Look up DNA-binding transcription factor activity (go:0003700)
|
|
183
157
|
# based on an old id
|
|
184
|
-
primary_curie = pyobo.get_primary_curie(
|
|
185
|
-
assert primary_curie ==
|
|
158
|
+
primary_curie = pyobo.get_primary_curie("go:0001071")
|
|
159
|
+
assert primary_curie == "go:0003700"
|
|
186
160
|
|
|
187
161
|
# If it's already the primary, it just gets returned
|
|
188
|
-
assert Reference.from_curie(
|
|
162
|
+
assert Reference.from_curie("go:0003700") == pyobo.get_primary_curie("go:0003700")
|
|
189
163
|
```
|
|
190
164
|
|
|
191
165
|
### Mapping Species
|
|
@@ -196,11 +170,10 @@ WikiPathway identifiers to species (as NCBI taxonomy identifiers):
|
|
|
196
170
|
```python
|
|
197
171
|
import pyobo
|
|
198
172
|
|
|
199
|
-
wikipathways_id_to_species = pyobo.get_id_species_mapping(
|
|
173
|
+
wikipathways_id_to_species = pyobo.get_id_species_mapping("wikipathways")
|
|
200
174
|
|
|
201
175
|
# Apoptosis (Homo sapiens)
|
|
202
|
-
|
|
203
|
-
assert taxonomy_id == '9606'
|
|
176
|
+
assert "9606" == wikipathways_id_to_species["WP254"]
|
|
204
177
|
```
|
|
205
178
|
|
|
206
179
|
Or, you don't have time for two lines:
|
|
@@ -209,8 +182,8 @@ Or, you don't have time for two lines:
|
|
|
209
182
|
import pyobo
|
|
210
183
|
|
|
211
184
|
# Apoptosis (Homo sapiens)
|
|
212
|
-
taxonomy_id = pyobo.get_species(
|
|
213
|
-
assert taxonomy_id ==
|
|
185
|
+
taxonomy_id = pyobo.get_species("wikipathways", "WP254")
|
|
186
|
+
assert taxonomy_id == "9606"
|
|
214
187
|
```
|
|
215
188
|
|
|
216
189
|
### Grounding
|
|
@@ -222,13 +195,13 @@ it up and its preferred label.
|
|
|
222
195
|
```python
|
|
223
196
|
import pyobo
|
|
224
197
|
|
|
225
|
-
reference = pyobo.ground(
|
|
226
|
-
assert reference.prefix ==
|
|
227
|
-
assert reference.identifier ==
|
|
228
|
-
assert reference.name ==
|
|
198
|
+
reference = pyobo.ground("chebi", "Fusilade II")
|
|
199
|
+
assert reference.prefix == "chebi"
|
|
200
|
+
assert reference.identifier == "132964"
|
|
201
|
+
assert reference.name == "fluazifop-P-butyl"
|
|
229
202
|
|
|
230
203
|
# When failure happens...
|
|
231
|
-
reference = pyobo.ground(
|
|
204
|
+
reference = pyobo.ground("chebi", "Definitely not a real name")
|
|
232
205
|
assert reference is None
|
|
233
206
|
```
|
|
234
207
|
|
|
@@ -240,10 +213,10 @@ false positives in case of conflicts):
|
|
|
240
213
|
import pyobo
|
|
241
214
|
|
|
242
215
|
# looking for phenotypes/pathways
|
|
243
|
-
reference = pyobo.ground([
|
|
244
|
-
assert reference.prefix ==
|
|
245
|
-
assert reference.identifier ==
|
|
246
|
-
assert reference.name ==
|
|
216
|
+
reference = pyobo.ground(["efo", "go"], "ERAD")
|
|
217
|
+
assert reference.prefix == "go"
|
|
218
|
+
assert reference.identifier == "0030433"
|
|
219
|
+
assert reference.name == "ubiquitin-dependent ERAD pathway"
|
|
247
220
|
```
|
|
248
221
|
|
|
249
222
|
### Cross-referencing
|
|
@@ -253,10 +226,10 @@ Get xrefs from ChEBI to PubChem:
|
|
|
253
226
|
```python
|
|
254
227
|
import pyobo
|
|
255
228
|
|
|
256
|
-
chebi_id_to_pubchem_compound_id = pyobo.get_filtered_xrefs(
|
|
229
|
+
chebi_id_to_pubchem_compound_id = pyobo.get_filtered_xrefs("chebi", "pubchem.compound")
|
|
257
230
|
|
|
258
|
-
pubchem_compound_id = chebi_id_to_pubchem_compound_id[
|
|
259
|
-
assert pubchem_compound_id ==
|
|
231
|
+
pubchem_compound_id = chebi_id_to_pubchem_compound_id["132964"]
|
|
232
|
+
assert pubchem_compound_id == "3033674"
|
|
260
233
|
```
|
|
261
234
|
|
|
262
235
|
If you don't have time for two lines:
|
|
@@ -264,8 +237,8 @@ If you don't have time for two lines:
|
|
|
264
237
|
```python
|
|
265
238
|
import pyobo
|
|
266
239
|
|
|
267
|
-
pubchem_compound_id = pyobo.get_xref(
|
|
268
|
-
assert pubchem_compound_id ==
|
|
240
|
+
pubchem_compound_id = pyobo.get_xref("chebi", "132964", "pubchem.compound")
|
|
241
|
+
assert pubchem_compound_id == "3033674"
|
|
269
242
|
```
|
|
270
243
|
|
|
271
244
|
Get xrefs from Entrez to HGNC, but they're only available through HGNC, so you
|
|
@@ -274,13 +247,13 @@ need to flip them:
|
|
|
274
247
|
```python
|
|
275
248
|
import pyobo
|
|
276
249
|
|
|
277
|
-
hgnc_id_to_ncbigene_id = pyobo.get_filtered_xrefs(
|
|
250
|
+
hgnc_id_to_ncbigene_id = pyobo.get_filtered_xrefs("hgnc", "ncbigene")
|
|
278
251
|
ncbigene_id_to_hgnc_id = {
|
|
279
252
|
ncbigene_id: hgnc_id
|
|
280
253
|
for hgnc_id, ncbigene_id in hgnc_id_to_ncbigene_id.items()
|
|
281
254
|
}
|
|
282
|
-
mapt_hgnc = ncbigene_id_to_hgnc_id[
|
|
283
|
-
assert mapt_hgnc ==
|
|
255
|
+
mapt_hgnc = ncbigene_id_to_hgnc_id["4137"]
|
|
256
|
+
assert mapt_hgnc == "6893"
|
|
284
257
|
```
|
|
285
258
|
|
|
286
259
|
Since this is a common pattern, there's a keyword argument `flip` that does this
|
|
@@ -289,9 +262,9 @@ for you:
|
|
|
289
262
|
```python
|
|
290
263
|
import pyobo
|
|
291
264
|
|
|
292
|
-
ncbigene_id_to_hgnc_id = pyobo.get_filtered_xrefs(
|
|
293
|
-
mapt_hgnc_id = ncbigene_id_to_hgnc_id[
|
|
294
|
-
assert mapt_hgnc_id ==
|
|
265
|
+
ncbigene_id_to_hgnc_id = pyobo.get_filtered_xrefs("hgnc", "ncbigene", flip=True)
|
|
266
|
+
mapt_hgnc_id = ncbigene_id_to_hgnc_id["4137"]
|
|
267
|
+
assert mapt_hgnc_id == "6893"
|
|
295
268
|
```
|
|
296
269
|
|
|
297
270
|
If you don't have time for two lines (I admit this one is a bit confusing) and
|
|
@@ -300,8 +273,8 @@ need to flip it:
|
|
|
300
273
|
```python
|
|
301
274
|
import pyobo
|
|
302
275
|
|
|
303
|
-
hgnc_id = pyobo.get_xref(
|
|
304
|
-
assert hgnc_id ==
|
|
276
|
+
hgnc_id = pyobo.get_xref("hgnc", "4137", "ncbigene", flip=True)
|
|
277
|
+
assert hgnc_id == "6893"
|
|
305
278
|
```
|
|
306
279
|
|
|
307
280
|
### Properties
|
|
@@ -313,11 +286,11 @@ basis.
|
|
|
313
286
|
import pyobo
|
|
314
287
|
|
|
315
288
|
# I don't make the rules. I wouldn't have chosen this as the key for this property. It could be any string
|
|
316
|
-
chebi_smiles_property =
|
|
317
|
-
chebi_id_to_smiles = pyobo.get_filtered_properties_mapping(
|
|
289
|
+
chebi_smiles_property = "http://purl.obolibrary.org/obo/chebi/smiles"
|
|
290
|
+
chebi_id_to_smiles = pyobo.get_filtered_properties_mapping("chebi", chebi_smiles_property)
|
|
318
291
|
|
|
319
|
-
smiles = chebi_id_to_smiles[
|
|
320
|
-
assert smiles ==
|
|
292
|
+
smiles = chebi_id_to_smiles["132964"]
|
|
293
|
+
assert smiles == "C1(=CC=C(N=C1)OC2=CC=C(C=C2)O[C@@H](C(OCCCC)=O)C)C(F)(F)F"
|
|
321
294
|
```
|
|
322
295
|
|
|
323
296
|
If you don't have time for two lines:
|
|
@@ -325,8 +298,8 @@ If you don't have time for two lines:
|
|
|
325
298
|
```python
|
|
326
299
|
import pyobo
|
|
327
300
|
|
|
328
|
-
smiles = pyobo.get_property(
|
|
329
|
-
assert smiles ==
|
|
301
|
+
smiles = pyobo.get_property("chebi", "132964", "http://purl.obolibrary.org/obo/chebi/smiles")
|
|
302
|
+
assert smiles == "C1(=CC=C(N=C1)OC2=CC=C(C=C2)O[C@@H](C(OCCCC)=O)C)C(F)(F)F"
|
|
330
303
|
```
|
|
331
304
|
|
|
332
305
|
### Hierarchy
|
|
@@ -338,12 +311,12 @@ import pyobo
|
|
|
338
311
|
from pyobo import Reference
|
|
339
312
|
|
|
340
313
|
# check that go:0008219 ! cell death is an ancestor of go:0006915 ! apoptotic process
|
|
341
|
-
assert Reference.from_curie(
|
|
314
|
+
assert Reference.from_curie("go:0008219") in pyobo.get_ancestors("go", "0006915")
|
|
342
315
|
|
|
343
316
|
# check that go:0070246 ! natural killer cell apoptotic process is a
|
|
344
317
|
# descendant of go:0006915 ! apoptotic process
|
|
345
|
-
apopototic_process_descendants = pyobo.get_descendants(
|
|
346
|
-
assert Reference.from_curie(
|
|
318
|
+
apopototic_process_descendants = pyobo.get_descendants("go", "0006915")
|
|
319
|
+
assert Reference.from_curie("go:0070246") in apopototic_process_descendants
|
|
347
320
|
```
|
|
348
321
|
|
|
349
322
|
Get the sub-hierarchy below a given node:
|
|
@@ -353,11 +326,11 @@ import pyobo
|
|
|
353
326
|
from pyobo import Reference
|
|
354
327
|
|
|
355
328
|
# get the descendant graph of go:0006915 ! apoptotic process
|
|
356
|
-
apopototic_process_subhierarchy = pyobo.get_subhierarchy(
|
|
329
|
+
apopototic_process_subhierarchy = pyobo.get_subhierarchy("go", "0006915")
|
|
357
330
|
|
|
358
331
|
# check that go:0070246 ! natural killer cell apoptotic process is a
|
|
359
332
|
# descendant of go:0006915 ! apoptotic process through the subhierarchy
|
|
360
|
-
assert Reference.from_curie(
|
|
333
|
+
assert Reference.from_curie("go:0070246") in apopototic_process_subhierarchy
|
|
361
334
|
```
|
|
362
335
|
|
|
363
336
|
Get a hierarchy with properties preloaded in the node data dictionaries:
|
|
@@ -366,12 +339,12 @@ Get a hierarchy with properties preloaded in the node data dictionaries:
|
|
|
366
339
|
import pyobo
|
|
367
340
|
from pyobo import Reference
|
|
368
341
|
|
|
369
|
-
prop =
|
|
370
|
-
chebi_hierarchy = pyobo.get_hierarchy(
|
|
342
|
+
prop = "http://purl.obolibrary.org/obo/chebi/smiles"
|
|
343
|
+
chebi_hierarchy = pyobo.get_hierarchy("chebi", properties=[prop])
|
|
371
344
|
|
|
372
|
-
assert Reference.from_curie(
|
|
373
|
-
assert prop in chebi_hierarchy.nodes[
|
|
374
|
-
assert chebi_hierarchy.nodes[
|
|
345
|
+
assert Reference.from_curie("chebi:132964") in chebi_hierarchy
|
|
346
|
+
assert prop in chebi_hierarchy.nodes["chebi:132964"]
|
|
347
|
+
assert chebi_hierarchy.nodes["chebi:132964"][prop] == "C1(=CC=C(N=C1)OC2=CC=C(C=C2)O[C@@H](C(OCCCC)=O)C)C(F)(F)F"
|
|
375
348
|
```
|
|
376
349
|
|
|
377
350
|
### Relations
|
|
@@ -381,9 +354,9 @@ way)
|
|
|
381
354
|
|
|
382
355
|
```python
|
|
383
356
|
>>> import pyobo
|
|
384
|
-
>>> human_mapt_hgnc_id =
|
|
385
|
-
>>> mouse_mapt_mgi_id =
|
|
386
|
-
>>> hgnc_mgi_orthology_mapping = pyobo.get_relation_mapping(
|
|
357
|
+
>>> human_mapt_hgnc_id = "6893"
|
|
358
|
+
>>> mouse_mapt_mgi_id = "97180"
|
|
359
|
+
>>> hgnc_mgi_orthology_mapping = pyobo.get_relation_mapping("hgnc", "ro:HOM0000017", "mgi")
|
|
387
360
|
>>> assert mouse_mapt_mgi_id == hgnc_mgi_orthology_mapping[human_mapt_hgnc_id]
|
|
388
361
|
```
|
|
389
362
|
|
|
@@ -392,9 +365,9 @@ If you want to do it in one line, use:
|
|
|
392
365
|
```python
|
|
393
366
|
|
|
394
367
|
>>> import pyobo
|
|
395
|
-
>>> human_mapt_hgnc_id =
|
|
396
|
-
>>> mouse_mapt_mgi_id =
|
|
397
|
-
>>> assert mouse_mapt_mgi_id == pyobo.get_relation(
|
|
368
|
+
>>> human_mapt_hgnc_id = "6893"
|
|
369
|
+
>>> mouse_mapt_mgi_id = "97180"
|
|
370
|
+
>>> assert mouse_mapt_mgi_id == pyobo.get_relation("hgnc", "ro:HOM0000017", "mgi", human_mapt_hgnc_id)
|
|
398
371
|
```
|
|
399
372
|
|
|
400
373
|
### Writings Tests that Use PyOBO
|
|
@@ -410,8 +383,8 @@ import pyobo
|
|
|
410
383
|
from pyobo.mocks import get_mock_id_name_mapping
|
|
411
384
|
|
|
412
385
|
mock_id_name_mapping = get_mock_id_name_mapping({
|
|
413
|
-
|
|
414
|
-
|
|
386
|
+
"chebi": {
|
|
387
|
+
"132964": "fluazifop-P-butyl",
|
|
415
388
|
},
|
|
416
389
|
})
|
|
417
390
|
|
|
@@ -419,33 +392,21 @@ class MyTestCase(unittest.TestCase):
|
|
|
419
392
|
def my_test(self):
|
|
420
393
|
with mock_id_name_mapping:
|
|
421
394
|
# use functions directly, or use your functions that wrap them
|
|
422
|
-
pyobo.get_name(
|
|
395
|
+
pyobo.get_name("chebi", "1234")
|
|
423
396
|
```
|
|
424
397
|
|
|
425
|
-
##
|
|
398
|
+
## Preprocessing CURIEs, URIs, and unqualified identifiers
|
|
426
399
|
|
|
427
400
|
In order to normalize references and identify resources, PyOBO uses the
|
|
428
401
|
[Bioregistry](https://github.com/bioregistry/bioregistry). It used to be a part
|
|
429
402
|
of PyOBO, but has since been externalized for more general reuse.
|
|
430
403
|
|
|
431
404
|
At
|
|
432
|
-
[src/pyobo/
|
|
433
|
-
is the curated
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
Other entries in the metaregistry:
|
|
439
|
-
|
|
440
|
-
- The `"remappings"->"full"` entry is a dictionary from strings that might
|
|
441
|
-
follow `xref:` in a given OBO file that need to be completely replaced, due to
|
|
442
|
-
incorrect formatting
|
|
443
|
-
- The `"remappings"->"prefix"` entry contains a dictionary of prefixes for xrefs
|
|
444
|
-
that need to be remapped. Several rules, for example, remove superfluous
|
|
445
|
-
spaces that occur inside CURIEs or and others address instances of the GOGO
|
|
446
|
-
issue.
|
|
447
|
-
- The `"blacklists"` entry contains rules for throwing out malformed xrefs based
|
|
448
|
-
on full string, just prefix, or just suffix.
|
|
405
|
+
[src/pyobo/identifier_utils/preprocessing.json](https://github.com/pyobo/pyobo/blob/master/src/pyobo/src/pyobo/identifier_utils/preprocessing.json)
|
|
406
|
+
is the curated set of pre-processing rules. These are used in combination with
|
|
407
|
+
the `curies` package to do pre-processing steps on CURIEs, URIs, and unqualified
|
|
408
|
+
identifiers beyond what is possible with the Bioregistry. See
|
|
409
|
+
https://curies.readthedocs.io/en/latest/preprocessing.html.
|
|
449
410
|
|
|
450
411
|
## Troubleshooting
|
|
451
412
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
pyobo/plugins.py,sha256=c04afe369c99ed9eae12bd2e18334e7972ce199a2419b166a377becf63cd2893,1232
|
|
2
|
-
pyobo/getters.py,sha256=
|
|
3
|
-
pyobo/gilda_utils.py,sha256=
|
|
4
|
-
pyobo/.DS_Store,sha256=
|
|
5
|
-
pyobo/version.py,sha256=
|
|
2
|
+
pyobo/getters.py,sha256=68c8982ac868863e73d1428bcdb82dfdfd0d9397e25d9dc2e0eca05d9b9d566a,17366
|
|
3
|
+
pyobo/gilda_utils.py,sha256=b9384002b00b48dcc98be86b47d954bed41c8b9548c380aaab62fa9ad929d0aa,1990
|
|
4
|
+
pyobo/.DS_Store,sha256=00b8c741cd5b001c03c1a582f55bfbcda0ad16f0e55019d64f93241b74991980,8196
|
|
5
|
+
pyobo/version.py,sha256=dab7f9a58f271077f9eb69671bc8ff659ad64f36f418250a964fa030d634373d,926
|
|
6
6
|
pyobo/ner/__init__.py,sha256=0199b704f1235184d521069034823c3d9960ff6756205c299649b87a4bbd4041,153
|
|
7
7
|
pyobo/ner/api.py,sha256=b34309833eac8f5dea881d531323bf682f35d377e09d807066ba1183282964dc,2167
|
|
8
8
|
pyobo/ner/normalizer.py,sha256=4e90d93801877f72f2fab8069db986e79cc749533a068a8b07a9d7c9e37cb9c2,954
|
|
9
|
-
pyobo/obographs.py,sha256=
|
|
9
|
+
pyobo/obographs.py,sha256=f4d9904d939afd04b29b42aa40acbaf6ec9d4a8f2eb3e1dc714b051b1025c41e,4239
|
|
10
10
|
pyobo/resource_utils.py,sha256=6e5a1229b1df30bcf4841f009213247cb386ab0e85c8ef02114e8b360d0f54c9,4406
|
|
11
11
|
pyobo/resources/goc.py,sha256=6b7e352d9a7e00e08c92588a65d283be09ab5dac9fc4e9780e14b130b64ce5ba,2550
|
|
12
12
|
pyobo/resources/goc.tsv,sha256=5bb98b945fbc9e0876e2a921f328a72f8b44f5686037e341fc8432b1a1d0d616,9081
|
|
@@ -22,46 +22,45 @@ pyobo/__init__.py,sha256=0d90185e6e3aa041ccc27c68226c45e456e39369328e3db17706d65
|
|
|
22
22
|
pyobo/utils/iter.py,sha256=ad845b6da1491f131a134c94fab419a026a0608aed7afd3db98d26c4591fe736,1524
|
|
23
23
|
pyobo/utils/misc.py,sha256=99d1f6e88b48d3f0cdbd7fff8a908556bf949278fcf0ef639e5cc8a421d0f4db,2684
|
|
24
24
|
pyobo/utils/ndex_utils.py,sha256=128902592d345ab93fe32f2575e42e53269a0bac8dcc18370da81497e2767336,2326
|
|
25
|
-
pyobo/utils/io.py,sha256=
|
|
26
|
-
pyobo/utils/cache.py,sha256=
|
|
25
|
+
pyobo/utils/io.py,sha256=fa0cb5a8633a6c9fb95eb2f74e08fbf69acc4fc229b89c18dd233921b80378a9,5100
|
|
26
|
+
pyobo/utils/cache.py,sha256=136ccd03b82afd534699a36bad129e5f3e73aba5c3184fb93d5a24af30d99227,3098
|
|
27
27
|
pyobo/utils/__init__.py,sha256=08035263cbc6abfeaff2b5a159121d9e4f96a392c0d91f568e0d67a9b5aa2cec,17
|
|
28
|
-
pyobo/utils/path.py,sha256=
|
|
29
|
-
pyobo/cli/database.py,sha256=
|
|
28
|
+
pyobo/utils/path.py,sha256=cc37f10de8e0ef90a6063cc2b1c5d1b0993e41649536f04bfddc892d61a3bc4f,3398
|
|
29
|
+
pyobo/cli/database.py,sha256=e880ac2c78bd437d73c99cea5c44938129852571bca35e2ab0cc7de195851ce6,11963
|
|
30
30
|
pyobo/cli/lookup.py,sha256=1b11bbe771979c345ff8df494562919900b95e237c7c437997595ee42de31c76,9163
|
|
31
31
|
pyobo/cli/__init__.py,sha256=a5388bbb38e3a62d0febdc958d0da413a9c152666e6059ea74934364b0e482f9,71
|
|
32
|
-
pyobo/cli/database_utils.py,sha256=
|
|
32
|
+
pyobo/cli/database_utils.py,sha256=8d0eea4a0fa8664f90f910b5db536451ba9778d8342bc7d5f7a8a05da2b7adae,5540
|
|
33
33
|
pyobo/cli/cli.py,sha256=ca057c8505fa7f40730ac0aa0a77e033e30ede9074a145f0b70d7b5f622aa2bd,2939
|
|
34
34
|
pyobo/cli/utils.py,sha256=9e6b57b311b44d61088e321efa387f6aacebd3d6d337bf8d1c589fb871b3304d,1738
|
|
35
35
|
pyobo/struct/__init__.py,sha256=fb813dfa7de27f195c07cd5311de78403b03dfbf0a183995c8fb448033ace311,1444
|
|
36
36
|
pyobo/struct/typedef.py,sha256=fd94429e28efcdf7bbeba4b1729fa66af5f64c34e49437d82e4b3e5a457d064d,12099
|
|
37
37
|
pyobo/struct/struct_utils.py,sha256=7b8bfd7a322f34cf1436b83c8eab983944651ba467923045bf61ecc245800d2c,39164
|
|
38
38
|
pyobo/struct/utils.py,sha256=ce4a4e138d894087e4374adce6a34434ad375482a691fff9eed1e88cc24aef56,906
|
|
39
|
-
pyobo/struct/reference.py,sha256=
|
|
39
|
+
pyobo/struct/reference.py,sha256=4fc7d3b665cd18c8dfbbb2b8b49de4bc30a8e101d14ff26bf5f88e9c562bc2d3,11735
|
|
40
40
|
pyobo/struct/vocabulary.py,sha256=56e0f6770cf7da2d6f1221e3fc8261f1c07dc8358a1f3dfb487894a25b1ed133,4335
|
|
41
41
|
pyobo/struct/functional/dsl.py,sha256=780b4e5616b8dc823cee610945a95ffa109aa43287992dd4dd51511c461f96fb,101183
|
|
42
42
|
pyobo/struct/functional/__init__.py,sha256=d536edb7fe86a1aad19607df3dea62b49dd0b4bb2b30f31b8431a842700a499e,32
|
|
43
43
|
pyobo/struct/functional/obo_to_functional.py,sha256=785c46fdb00dc45f3903f67ad24ae4fcb6d187ce48208373fc9d42833a85f6b8,13273
|
|
44
44
|
pyobo/struct/functional/utils.py,sha256=73e5c6d9227b0a162dcfb294dcad05f93ea870c8d87af7a2d16c6591f9249ad1,3487
|
|
45
45
|
pyobo/struct/functional/macros.py,sha256=cc654f131fa685d4afc87d8c7b5e8565da1b789dd5d73045a77b3e033a8ced52,13785
|
|
46
|
-
pyobo/struct/functional/ontology.py,sha256=
|
|
47
|
-
pyobo/struct/struct.py,sha256=
|
|
46
|
+
pyobo/struct/functional/ontology.py,sha256=bc610a206c5f502cc658cbf7dcaa9caeb112a596ab1cb07fcbd571c8a6da2894,9331
|
|
47
|
+
pyobo/struct/struct.py,sha256=29b77204d903a948aff74f93aa043e5421cc932c22a893e70dbfd3f27b911fb7,89480
|
|
48
48
|
pyobo/ssg/index.html,sha256=da62c16a198f7ad2468599c5d7e4da4d7b81e02a18a25a59da741a579746e676,4346
|
|
49
49
|
pyobo/ssg/typedef.html,sha256=2ab76acc1eb18edebcf5b1b7dc3dba00bfb5d49aef36e124a3134d23e106f938,2038
|
|
50
50
|
pyobo/ssg/base.html,sha256=fef95d5026be80bd984cd63a1a002ec4d4f74e06840f9f39bc5feaed3aeb8d8b,2844
|
|
51
51
|
pyobo/ssg/__init__.py,sha256=8500042e3156fe3acd5fd5546b0ed52038d842150389c512b3e99267302f152a,5224
|
|
52
52
|
pyobo/ssg/term.html,sha256=b522c82774980d37ad2bd8361280cacaee1a1dc855a351145e4fda62119e38aa,3869
|
|
53
|
-
pyobo/reader.py,sha256=
|
|
53
|
+
pyobo/reader.py,sha256=6fc2522a89772b718eaa6278e2abc7d5ca536378b537992b34bfe12bcfd10d72,52246
|
|
54
54
|
pyobo/identifier_utils/relations/data_rdfs.json,sha256=6e3a7166d7b78385afac626c987b8024dfdc83f7dac6a21af6d08bedab8776a4,86
|
|
55
55
|
pyobo/identifier_utils/relations/__init__.py,sha256=2961f492b8530a678a9e010887b5530c3de1cc2df8f294e210a18dbb748d01db,159
|
|
56
56
|
pyobo/identifier_utils/relations/data.json,sha256=88b6ce5fb632faa389b512b68f1b73acdd54b552a1aaa8043430eb5e0020a0bc,113169
|
|
57
57
|
pyobo/identifier_utils/relations/api.py,sha256=c625bca0f09379ba7ef544d05aaf4b998ee9798945a90f3b98b6d763ef9d36df,5764
|
|
58
58
|
pyobo/identifier_utils/relations/data_rdf.json,sha256=4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945,2
|
|
59
59
|
pyobo/identifier_utils/relations/data_owl.json,sha256=a70fe8850a0b32f0ca5f9358085a340297a3464d7ba61e83333fe69d6ae4c826,1066
|
|
60
|
-
pyobo/identifier_utils/__init__.py,sha256=
|
|
61
|
-
pyobo/identifier_utils/
|
|
62
|
-
pyobo/identifier_utils/
|
|
63
|
-
pyobo/identifier_utils/preprocessing.
|
|
64
|
-
pyobo/identifier_utils/preprocessing.json,sha256=9298fbec6148b4987edce3e931190f8a1f5fdd727aa239b8fcf59fbed9f1212f,32710
|
|
60
|
+
pyobo/identifier_utils/__init__.py,sha256=865d3a02c3a6d38ff13d4e30685a60368c4a7823397f93e609c2ad356c5d46a3,749
|
|
61
|
+
pyobo/identifier_utils/api.py,sha256=310bf6e0ac55882b9bbf179b1628bfc70797ae419a962ea6e1e3cdf48e8e5c26,9212
|
|
62
|
+
pyobo/identifier_utils/preprocessing.py,sha256=67c9109c1a4ba1f5f45368516563a044e38d4095799b520519a57044230d5fd7,618
|
|
63
|
+
pyobo/identifier_utils/preprocessing.json,sha256=e84f2ed9bb4f2a92c83845daf739f4052d7a615bfc6c13dcc54845a306916627,34821
|
|
65
64
|
pyobo/py.typed,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
|
|
66
65
|
pyobo/sources/signor/download.py,sha256=ae40c954403a95dd33e221b5e2d30e70072e4658d043d48024068b75ac5a833f,1053
|
|
67
66
|
pyobo/sources/signor/__init__.py,sha256=6de6ff151aaca2a2d5317b437916405dff5783d50120704ed39b8f53df0d6a32,139
|
|
@@ -101,7 +100,7 @@ pyobo/sources/drugbank/drugbank.py,sha256=eb2fc65b2d43ac54c0c81fefb0701b13264110
|
|
|
101
100
|
pyobo/sources/rgd.py,sha256=46020f5933a846a7575ffdd8330ddde8df560d16872c9475f204da59cfdbce4e,5316
|
|
102
101
|
pyobo/sources/__init__.py,sha256=94db6754ef36ea969a347c2ae38ff9eddb44dbe177ce06d9f93e5432592bc404,4630
|
|
103
102
|
pyobo/sources/pharmgkb/pharmgkb_pathway.py,sha256=3eb66d425b46ff38f3be9f8aeb7291c3e22ac49b4eef25f74e703ff68fb270e7,2042
|
|
104
|
-
pyobo/sources/pharmgkb/pharmgkb_gene.py,sha256=
|
|
103
|
+
pyobo/sources/pharmgkb/pharmgkb_gene.py,sha256=04c3c39bc0d900491e8d7d827cd0c17c898f2ea17d4a645544822373647413e1,4049
|
|
105
104
|
pyobo/sources/pharmgkb/__init__.py,sha256=25df339dedc6617df9ba4a80ef2b5b620b2425ab900893cc3f4de8e5c3557a20,443
|
|
106
105
|
pyobo/sources/pharmgkb/pharmgkb_chemical.py,sha256=698096d364d5cc0c59e659dee428eb4fb5224818fa0b567a30173a9dc9ff229c,3142
|
|
107
106
|
pyobo/sources/pharmgkb/pharmgkb_variant.py,sha256=1a1f5f34895446614589cf9f4307bfe9218a316dee21018a4610b4b6fb163ad0,2873
|
|
@@ -112,7 +111,7 @@ pyobo/sources/pathbank.py,sha256=496e2611d5825f6319606d55269f322c4cf206efce99a65
|
|
|
112
111
|
pyobo/sources/gwascentral/gwascentral_phenotype.py,sha256=4af302177b18a9cdc5e6735709fefa033221353ebdf191c79d3a4ed0819fb7ca,1788
|
|
113
112
|
pyobo/sources/gwascentral/__init__.py,sha256=55d1c8801551fb7e81ee02ee851e175795179ff120359d3e8b583d36384e8d8d,231
|
|
114
113
|
pyobo/sources/gwascentral/gwascentral_study.py,sha256=bddb3b20e2374cc3ff14601aba36c17466897d46f1d086bf75ecf62992263bd9,2657
|
|
115
|
-
pyobo/sources/omim_ps.py,sha256=
|
|
114
|
+
pyobo/sources/omim_ps.py,sha256=692cb56e44090b2c600d87c0ef0a71a13b77750faa3e40886385f9dbf7a51c76,1432
|
|
116
115
|
pyobo/sources/selventa/schem.py,sha256=bea37f6bf34b7ac863fb6751b997a57ce2c943977253766085f49122af441550,1162
|
|
117
116
|
pyobo/sources/selventa/sdis.py,sha256=b3169dde3868d74ab6a12ce3c820e419605884ac2ccbf8da4bec0f24ac1c2e75,1287
|
|
118
117
|
pyobo/sources/selventa/__init__.py,sha256=7082039562fdce72f6af4699209dabd4537734cf62a3be30f877b67a0cc9c17f,254
|
|
@@ -177,12 +176,12 @@ pyobo/sources/complexportal.py,sha256=78ec7567393ccc33cfd43acadb2392bf5f22f6933a
|
|
|
177
176
|
pyobo/sources/credit.py,sha256=7643164ed0aa81333dd2415af23ec170fc94efc89b1656ea2d7f66551b6aff9a,1795
|
|
178
177
|
pyobo/sources/chebi.py,sha256=f9ffd7c812ce1e80b6b86aaef14cd0dc780095ba80866efe014bded072b44ce0,1202
|
|
179
178
|
pyobo/sources/ror.py,sha256=212fca52d31e2a002776b6cb8e17282bc8a5a7e8ce7a20f0cc64f2e51f5c2309,8882
|
|
180
|
-
pyobo/sources/flybase.py,sha256=
|
|
181
|
-
pyobo/sources/cgnc.py,sha256=
|
|
179
|
+
pyobo/sources/flybase.py,sha256=8144b7f4d17fa9cef6dd1d9201b85062a3e0e943a2c0ac0f5e15d0d49c02ebc4,5666
|
|
180
|
+
pyobo/sources/cgnc.py,sha256=5e5c2aaa325cec1f7bdf9dbe020691a3c95acd79ca7fffc9555e2575f1899754,2299
|
|
182
181
|
pyobo/api/species.py,sha256=631cc978295fb8a23ea6360ba6ee7bf7b8dd0dec93917a6340381d99cf4c2b0a,2376
|
|
183
182
|
pyobo/api/metadata.py,sha256=b2d25a897fe5ef1d11d55efb4cdc07bcfb6892e67e128a9bf473112fbd0d896b,1029
|
|
184
183
|
pyobo/api/combine.py,sha256=ed3f108fc5b5c164352a0289b0ed641511d9c6441cadf28cd6106b86a1ec1245,1106
|
|
185
|
-
pyobo/api/properties.py,sha256=
|
|
184
|
+
pyobo/api/properties.py,sha256=6d85af1ebd5b7f4c5d232323faab9d8f8a11a419eab0a86eca36052b22b2f778,6914
|
|
186
185
|
pyobo/api/relations.py,sha256=6dfda59d8ae2c3addb816d7dad2b97856916c6f2e6114f7a774bfcaff1c25747,5859
|
|
187
186
|
pyobo/api/__init__.py,sha256=259870a4519a6baa5df1180378837e67c688e8ecbe46e9a3d4a90e6435c79e1d,2955
|
|
188
187
|
pyobo/api/edges.py,sha256=4849b6809c7a2e83a48571a3d75578dae2e0e0589d15af6326a5bd1f39e57f09,1974
|
|
@@ -190,13 +189,13 @@ pyobo/api/hierarchy.py,sha256=37f27381f08a3c859adb4a1d46132fa60889a5ccce8867620d
|
|
|
190
189
|
pyobo/api/names.py,sha256=2f620187285c1fccbeac23708d624bc374ec1e9d6abce65ebf5eb4f9c63070b8,10673
|
|
191
190
|
pyobo/api/utils.py,sha256=ae8d2274e48d129a0d3520e48ba462af066afff928c9fcd231f569c4b322bcf5,5429
|
|
192
191
|
pyobo/api/typedefs.py,sha256=1d3ba2d2497f5442f18238b4bdf06bf8d046df3aeba4253cb66b9039258ae9fc,1262
|
|
193
|
-
pyobo/api/xrefs.py,sha256=
|
|
192
|
+
pyobo/api/xrefs.py,sha256=9d62cbb761b36957e780d0546ce3154a33a90ae6be23bbbedadba8c735c6aab0,5242
|
|
194
193
|
pyobo/api/alts.py,sha256=478b3162574616f2827bd73107f80f5dfdaf5971eaf6c6813109109dba89e522,3032
|
|
195
194
|
pyobo/__main__.py,sha256=70e610d8e10bc45fbd4fa9ee67dc672d2bbd6cb1e4e9e8a7aec4a8cfb11c0fd3,83
|
|
196
195
|
pyobo/reader_utils.py,sha256=5324154d08576e167d7c28b3660dbaa394e67878acf7ea9930abd0170201460a,4423
|
|
197
196
|
pyobo/mocks.py,sha256=8f9e392bd3ff0cfb0306e6070eb8724cb8e694fa0d951744b5c4652e15e56d72,2440
|
|
198
|
-
pyobo-0.12.
|
|
199
|
-
pyobo-0.12.
|
|
200
|
-
pyobo-0.12.
|
|
201
|
-
pyobo-0.12.
|
|
202
|
-
pyobo-0.12.
|
|
197
|
+
pyobo-0.12.1.dist-info/licenses/LICENSE,sha256=41c80964a1b1956e41c013670812fc5592d5b51bd7b3cd4287d949450488a498,1076
|
|
198
|
+
pyobo-0.12.1.dist-info/WHEEL,sha256=1c77bbda0b527f376a68ced20cbc1aac3efc7bc4d7c10cc4323a905ef79ae8db,78
|
|
199
|
+
pyobo-0.12.1.dist-info/entry_points.txt,sha256=00d833beec05ffdff58a90a8c49b5b04ce80e22d8c92ddfd80c3f340eea1bc6b,42
|
|
200
|
+
pyobo-0.12.1.dist-info/METADATA,sha256=891eda0af949aecf1dc5064aaba32edf807fc6ec4d43d7eebd8b0af65dc3b388,22299
|
|
201
|
+
pyobo-0.12.1.dist-info/RECORD,,
|