pyobo 0.12.7__py3-none-any.whl → 0.12.9__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/__init__.py +12 -1
- pyobo/__main__.py +0 -0
- pyobo/api/__init__.py +2 -1
- pyobo/api/alts.py +0 -0
- pyobo/api/combine.py +0 -0
- pyobo/api/edges.py +0 -0
- pyobo/api/embedding.py +36 -6
- pyobo/api/hierarchy.py +6 -4
- pyobo/api/metadata.py +0 -0
- pyobo/api/names.py +0 -0
- pyobo/api/properties.py +12 -3
- pyobo/api/relations.py +9 -5
- pyobo/api/species.py +0 -0
- pyobo/api/typedefs.py +0 -0
- pyobo/api/utils.py +0 -0
- pyobo/api/xrefs.py +0 -0
- pyobo/cli/__init__.py +0 -0
- pyobo/cli/cli.py +0 -0
- pyobo/cli/database.py +0 -0
- pyobo/cli/database_utils.py +0 -0
- pyobo/cli/lookup.py +0 -0
- pyobo/cli/utils.py +0 -0
- pyobo/constants.py +0 -0
- pyobo/getters.py +0 -0
- pyobo/gilda_utils.py +0 -0
- pyobo/identifier_utils/__init__.py +0 -0
- pyobo/identifier_utils/api.py +0 -0
- pyobo/identifier_utils/relations/__init__.py +0 -0
- pyobo/identifier_utils/relations/api.py +0 -0
- pyobo/identifier_utils/relations/data.json +0 -0
- pyobo/identifier_utils/relations/data_owl.json +0 -0
- pyobo/identifier_utils/relations/data_rdf.json +0 -0
- pyobo/identifier_utils/relations/data_rdfs.json +0 -0
- pyobo/mocks.py +0 -0
- pyobo/ner/__init__.py +8 -0
- pyobo/ner/api.py +0 -0
- pyobo/ner/normalizer.py +2 -2
- pyobo/ner/scispacy_utils.py +241 -0
- pyobo/plugins.py +0 -0
- pyobo/py.typed +0 -0
- pyobo/resource_utils.py +0 -0
- pyobo/resources/__init__.py +0 -0
- pyobo/resources/ncbitaxon.py +0 -0
- pyobo/resources/ncbitaxon.tsv.gz +0 -0
- pyobo/resources/ro.py +0 -0
- pyobo/resources/ro.tsv +0 -0
- pyobo/resources/so.py +0 -0
- pyobo/resources/so.tsv +0 -0
- pyobo/sources/README.md +0 -0
- pyobo/sources/__init__.py +2 -0
- pyobo/sources/agrovoc.py +0 -0
- pyobo/sources/antibodyregistry.py +0 -0
- pyobo/sources/bigg/__init__.py +0 -0
- pyobo/sources/bigg/bigg_compartment.py +0 -0
- pyobo/sources/bigg/bigg_metabolite.py +0 -0
- pyobo/sources/bigg/bigg_model.py +0 -0
- pyobo/sources/bigg/bigg_reaction.py +0 -0
- pyobo/sources/biogrid.py +0 -0
- pyobo/sources/ccle.py +0 -0
- pyobo/sources/cgnc.py +0 -0
- pyobo/sources/chebi.py +0 -0
- pyobo/sources/chembl/__init__.py +0 -0
- pyobo/sources/chembl/chembl_cell.py +0 -0
- pyobo/sources/chembl/chembl_compound.py +0 -0
- pyobo/sources/chembl/chembl_mechanism.py +0 -0
- pyobo/sources/chembl/chembl_target.py +1 -1
- pyobo/sources/chembl/chembl_tissue.py +0 -0
- pyobo/sources/civic_gene.py +0 -0
- pyobo/sources/clinicaltrials.py +0 -0
- pyobo/sources/complexportal.py +0 -0
- pyobo/sources/conso.py +0 -0
- pyobo/sources/cpt.py +0 -0
- pyobo/sources/credit.py +0 -0
- pyobo/sources/cvx.py +0 -0
- pyobo/sources/depmap.py +0 -0
- pyobo/sources/dictybase_gene.py +0 -0
- pyobo/sources/drugbank/__init__.py +0 -0
- pyobo/sources/drugbank/drugbank.py +0 -0
- pyobo/sources/drugbank/drugbank_salt.py +0 -0
- pyobo/sources/drugcentral.py +0 -0
- pyobo/sources/expasy.py +4 -1
- pyobo/sources/famplex.py +0 -0
- pyobo/sources/flybase.py +0 -0
- pyobo/sources/gard.py +0 -0
- pyobo/sources/geonames/__init__.py +0 -0
- pyobo/sources/geonames/features.py +0 -0
- pyobo/sources/geonames/geonames.py +0 -0
- pyobo/sources/geonames/utils.py +0 -0
- pyobo/sources/gmt_utils.py +0 -0
- pyobo/sources/go.py +6 -3
- pyobo/sources/gtdb.py +1 -0
- pyobo/sources/gwascentral/__init__.py +0 -0
- pyobo/sources/gwascentral/gwascentral_phenotype.py +0 -0
- pyobo/sources/gwascentral/gwascentral_study.py +0 -0
- pyobo/sources/hgnc/__init__.py +0 -0
- pyobo/sources/hgnc/hgnc.py +0 -0
- pyobo/sources/hgnc/hgncgenefamily.py +0 -0
- pyobo/sources/iana_media_type.py +3 -1
- pyobo/sources/icd/__init__.py +0 -0
- pyobo/sources/icd/icd10.py +0 -0
- pyobo/sources/icd/icd11.py +0 -0
- pyobo/sources/icd/icd_utils.py +0 -0
- pyobo/sources/iconclass.py +55 -0
- pyobo/sources/intact.py +0 -0
- pyobo/sources/interpro.py +0 -0
- pyobo/sources/itis.py +0 -0
- pyobo/sources/kegg/__init__.py +0 -0
- pyobo/sources/kegg/api.py +0 -0
- pyobo/sources/kegg/genes.py +0 -0
- pyobo/sources/kegg/genome.py +0 -0
- pyobo/sources/kegg/pathway.py +0 -0
- pyobo/sources/mesh.py +0 -0
- pyobo/sources/mgi.py +0 -0
- pyobo/sources/mirbase/__init__.py +0 -0
- pyobo/sources/mirbase/mirbase.py +0 -0
- pyobo/sources/mirbase/mirbase_constants.py +0 -0
- pyobo/sources/mirbase/mirbase_family.py +0 -0
- pyobo/sources/mirbase/mirbase_mature.py +0 -0
- pyobo/sources/msigdb.py +0 -0
- pyobo/sources/ncbi/__init__.py +0 -0
- pyobo/sources/ncbi/ncbi_gc.py +0 -0
- pyobo/sources/ncbi/ncbigene.py +0 -0
- pyobo/sources/nih_reporter.py +0 -0
- pyobo/sources/nlm/__init__.py +0 -0
- pyobo/sources/nlm/nlm_catalog.py +0 -0
- pyobo/sources/nlm/nlm_publisher.py +0 -0
- pyobo/sources/nlm/utils.py +0 -0
- pyobo/sources/npass.py +0 -0
- pyobo/sources/omim_ps.py +0 -0
- pyobo/sources/pathbank.py +0 -0
- pyobo/sources/pfam/__init__.py +0 -0
- pyobo/sources/pfam/pfam.py +0 -0
- pyobo/sources/pfam/pfam_clan.py +0 -0
- pyobo/sources/pharmgkb/__init__.py +0 -0
- pyobo/sources/pharmgkb/pharmgkb_chemical.py +0 -0
- pyobo/sources/pharmgkb/pharmgkb_disease.py +0 -0
- pyobo/sources/pharmgkb/pharmgkb_gene.py +0 -0
- pyobo/sources/pharmgkb/pharmgkb_pathway.py +0 -0
- pyobo/sources/pharmgkb/pharmgkb_variant.py +0 -0
- pyobo/sources/pharmgkb/utils.py +0 -0
- pyobo/sources/pid.py +0 -0
- pyobo/sources/pombase.py +0 -0
- pyobo/sources/pubchem.py +0 -0
- pyobo/sources/reactome.py +0 -0
- pyobo/sources/rgd.py +0 -0
- pyobo/sources/rhea.py +0 -0
- pyobo/sources/ror.py +0 -0
- pyobo/sources/selventa/__init__.py +0 -0
- pyobo/sources/selventa/schem.py +0 -0
- pyobo/sources/selventa/scomp.py +0 -0
- pyobo/sources/selventa/sdis.py +0 -0
- pyobo/sources/selventa/sfam.py +0 -0
- pyobo/sources/sgd.py +0 -0
- pyobo/sources/signor/__init__.py +0 -0
- pyobo/sources/signor/download.py +0 -0
- pyobo/sources/signor/signor_complexes.py +0 -0
- pyobo/sources/slm.py +0 -0
- pyobo/sources/spdx.py +0 -0
- pyobo/sources/umls/__init__.py +0 -0
- pyobo/sources/umls/__main__.py +0 -0
- pyobo/sources/umls/get_synonym_types.py +0 -0
- pyobo/sources/umls/sty.py +0 -0
- pyobo/sources/umls/synonym_types.tsv +0 -0
- pyobo/sources/umls/umls.py +0 -0
- pyobo/sources/unimod.py +0 -0
- pyobo/sources/uniprot/__init__.py +0 -0
- pyobo/sources/uniprot/uniprot.py +0 -0
- pyobo/sources/uniprot/uniprot_ptm.py +0 -0
- pyobo/sources/utils.py +0 -0
- pyobo/sources/wikipathways.py +0 -0
- pyobo/sources/zfin.py +0 -0
- pyobo/ssg/__init__.py +0 -0
- pyobo/ssg/base.html +0 -0
- pyobo/ssg/index.html +0 -0
- pyobo/ssg/term.html +0 -0
- pyobo/ssg/typedef.html +0 -0
- pyobo/struct/__init__.py +0 -0
- pyobo/struct/functional/__init__.py +0 -0
- pyobo/struct/functional/dsl.py +0 -0
- pyobo/struct/functional/macros.py +12 -12
- pyobo/struct/functional/obo_to_functional.py +0 -0
- pyobo/struct/functional/ontology.py +0 -0
- pyobo/struct/functional/utils.py +0 -0
- pyobo/struct/obo/__init__.py +0 -0
- pyobo/struct/obo/reader.py +0 -0
- pyobo/struct/obo/reader_utils.py +0 -0
- pyobo/struct/obograph/__init__.py +0 -0
- pyobo/struct/obograph/export.py +0 -0
- pyobo/struct/obograph/reader.py +0 -0
- pyobo/struct/obograph/utils.py +0 -0
- pyobo/struct/reference.py +3 -1
- pyobo/struct/struct.py +22 -14
- pyobo/struct/struct_utils.py +0 -0
- pyobo/struct/typedef.py +0 -0
- pyobo/struct/utils.py +0 -0
- pyobo/struct/vocabulary.py +0 -0
- pyobo/utils/__init__.py +0 -0
- pyobo/utils/cache.py +0 -0
- pyobo/utils/io.py +0 -0
- pyobo/utils/iter.py +0 -0
- pyobo/utils/misc.py +0 -0
- pyobo/utils/ndex_utils.py +0 -0
- pyobo/utils/path.py +0 -0
- pyobo/version.py +1 -1
- {pyobo-0.12.7.dist-info → pyobo-0.12.9.dist-info}/METADATA +5 -1
- pyobo-0.12.9.dist-info/RECORD +210 -0
- {pyobo-0.12.7.dist-info → pyobo-0.12.9.dist-info}/WHEEL +1 -1
- {pyobo-0.12.7.dist-info → pyobo-0.12.9.dist-info}/licenses/LICENSE +0 -0
- pyobo-0.12.7.dist-info/RECORD +0 -208
- {pyobo-0.12.7.dist-info → pyobo-0.12.9.dist-info}/entry_points.txt +0 -0
pyobo/sources/chebi.py
CHANGED
|
File without changes
|
pyobo/sources/chembl/__init__.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -138,7 +138,7 @@ def iter_terms(version: str) -> Iterable[Term]:
|
|
|
138
138
|
def get_chembl_protein_equivalences(version: str | None = None) -> dict[str, list[str]]:
|
|
139
139
|
"""Get ChEMBL protein equivalences."""
|
|
140
140
|
if version is None:
|
|
141
|
-
version = chembl_downloader.latest()
|
|
141
|
+
version = chembl_downloader.latest(full=False)
|
|
142
142
|
url = f"ftp://ftp.ebi.ac.uk/pub/databases/chembl/ChEMBLdb/releases/chembl_{version}/chembl_uniprot_mapping.txt"
|
|
143
143
|
df = ensure_df(
|
|
144
144
|
PREFIX,
|
|
File without changes
|
pyobo/sources/civic_gene.py
CHANGED
|
File without changes
|
pyobo/sources/clinicaltrials.py
CHANGED
|
File without changes
|
pyobo/sources/complexportal.py
CHANGED
|
File without changes
|
pyobo/sources/conso.py
CHANGED
|
File without changes
|
pyobo/sources/cpt.py
CHANGED
|
File without changes
|
pyobo/sources/credit.py
CHANGED
|
File without changes
|
pyobo/sources/cvx.py
CHANGED
|
File without changes
|
pyobo/sources/depmap.py
CHANGED
|
File without changes
|
pyobo/sources/dictybase_gene.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
pyobo/sources/drugcentral.py
CHANGED
|
File without changes
|
pyobo/sources/expasy.py
CHANGED
|
@@ -160,7 +160,8 @@ def normalize_expasy_id(expasy_id: str) -> str:
|
|
|
160
160
|
"""Return a standardized ExPASy identifier string.
|
|
161
161
|
|
|
162
162
|
:param expasy_id: A possibly non-normalized ExPASy identifier
|
|
163
|
-
|
|
163
|
+
|
|
164
|
+
:returns: A normalized string.
|
|
164
165
|
"""
|
|
165
166
|
return expasy_id.replace(" ", "")
|
|
166
167
|
|
|
@@ -211,6 +212,7 @@ def get_database(lines: Iterable[str]) -> Mapping[str, dict[str, Any]]:
|
|
|
211
212
|
"""Parse the ExPASy database file and returns a list of enzyme entry dictionaries.
|
|
212
213
|
|
|
213
214
|
:param lines: An iterator over the ExPASy database file or file-like
|
|
215
|
+
|
|
214
216
|
:returns: A mapping from EC code to data
|
|
215
217
|
"""
|
|
216
218
|
rv = {}
|
|
@@ -285,6 +287,7 @@ def _parse_transfer(value: str) -> list[str]:
|
|
|
285
287
|
"""Parse transferred entry string.
|
|
286
288
|
|
|
287
289
|
:param value: A string for a transferred entry
|
|
290
|
+
|
|
288
291
|
:returns: A list of EC codes that it got transferred to
|
|
289
292
|
|
|
290
293
|
>>> _parse_transfer("Transferred entry: 1.1.1.198, 1.1.1.227 and 1.1.1.228.")
|
pyobo/sources/famplex.py
CHANGED
|
File without changes
|
pyobo/sources/flybase.py
CHANGED
|
File without changes
|
pyobo/sources/gard.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
pyobo/sources/geonames/utils.py
CHANGED
|
File without changes
|
pyobo/sources/gmt_utils.py
CHANGED
|
File without changes
|
pyobo/sources/go.py
CHANGED
|
@@ -13,7 +13,8 @@ def is_biological_process(identifier: str) -> bool:
|
|
|
13
13
|
"""Return if the given GO identifier is a biological process.
|
|
14
14
|
|
|
15
15
|
:param identifier: A local unique identifier from GO
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
:returns: If the identifier is a biological process
|
|
17
18
|
|
|
18
19
|
>>> is_biological_process("0006915")
|
|
19
20
|
True
|
|
@@ -27,7 +28,8 @@ def is_molecular_function(identifier: str) -> bool:
|
|
|
27
28
|
"""Return if the given GO identifier is a molecular function.
|
|
28
29
|
|
|
29
30
|
:param identifier: A local unique identifier from GO
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
:returns: If the identifier is a molecular function
|
|
31
33
|
|
|
32
34
|
>>> is_molecular_function("0006915")
|
|
33
35
|
False
|
|
@@ -39,7 +41,8 @@ def is_cellular_component(identifier: str) -> bool:
|
|
|
39
41
|
"""Return if the given GO identifier is a cellular component.
|
|
40
42
|
|
|
41
43
|
:param identifier: A local unique identifier from GO
|
|
42
|
-
|
|
44
|
+
|
|
45
|
+
:returns: If the identifier is a cellular component
|
|
43
46
|
|
|
44
47
|
>>> is_cellular_component("0006915")
|
|
45
48
|
False
|
pyobo/sources/gtdb.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
pyobo/sources/hgnc/__init__.py
CHANGED
|
File without changes
|
pyobo/sources/hgnc/hgnc.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/sources/iana_media_type.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""An ontology representation of IANA media types (i.e. MIME types).
|
|
2
2
|
|
|
3
|
-
.. seealso::
|
|
3
|
+
.. seealso::
|
|
4
|
+
|
|
5
|
+
https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
4
6
|
"""
|
|
5
7
|
|
|
6
8
|
from collections.abc import Iterable
|
pyobo/sources/icd/__init__.py
CHANGED
|
File without changes
|
pyobo/sources/icd/icd10.py
CHANGED
|
File without changes
|
pyobo/sources/icd/icd11.py
CHANGED
|
File without changes
|
pyobo/sources/icd/icd_utils.py
CHANGED
|
File without changes
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""Get ICONCLASS as OBO."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Iterable
|
|
4
|
+
from urllib.parse import quote
|
|
5
|
+
|
|
6
|
+
import pandas as pd
|
|
7
|
+
|
|
8
|
+
from pyobo.struct import Obo, Term
|
|
9
|
+
from pyobo.utils.path import ensure_df
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"IconclassGetter",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
PREFIX = "iconclass"
|
|
16
|
+
BASE_URL = "https://github.com/iconclass/data/raw/refs/heads/main/txt/en/txt_en_{}.txt"
|
|
17
|
+
URLS = [
|
|
18
|
+
BASE_URL.format("0_1"),
|
|
19
|
+
BASE_URL.format("2_3"),
|
|
20
|
+
BASE_URL.format("4"),
|
|
21
|
+
BASE_URL.format("5_6_7_8"),
|
|
22
|
+
BASE_URL.format("9"),
|
|
23
|
+
BASE_URL.format("keys"),
|
|
24
|
+
# shakespeare
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def get_df() -> pd.DataFrame:
|
|
29
|
+
"""Get an ICONCLASS terms dataframe."""
|
|
30
|
+
df = pd.concat(
|
|
31
|
+
ensure_df(prefix=PREFIX, url=url, sep="|", names=["luid", "name"]) for url in URLS
|
|
32
|
+
)
|
|
33
|
+
return df
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def iter_terms() -> Iterable[Term]:
|
|
37
|
+
"""Iterate over terms in ICONCLASS."""
|
|
38
|
+
for luid, name in get_df().values:
|
|
39
|
+
yv = Term.from_triple(prefix=PREFIX, identifier=quote(luid), name=name)
|
|
40
|
+
yield yv
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class IconclassGetter(Obo):
|
|
44
|
+
"""An ontology representation of ICONCLASS."""
|
|
45
|
+
|
|
46
|
+
ontology = PREFIX
|
|
47
|
+
dynamic_version = True
|
|
48
|
+
|
|
49
|
+
def iter_terms(self, force: bool = False) -> Iterable[Term]:
|
|
50
|
+
"""Iterate over terms in the ontology."""
|
|
51
|
+
return iter_terms()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
if __name__ == "__main__":
|
|
55
|
+
IconclassGetter.cli()
|
pyobo/sources/intact.py
CHANGED
|
File without changes
|
pyobo/sources/interpro.py
CHANGED
|
File without changes
|
pyobo/sources/itis.py
CHANGED
|
File without changes
|
pyobo/sources/kegg/__init__.py
CHANGED
|
File without changes
|
pyobo/sources/kegg/api.py
CHANGED
|
File without changes
|
pyobo/sources/kegg/genes.py
CHANGED
|
File without changes
|
pyobo/sources/kegg/genome.py
CHANGED
|
File without changes
|
pyobo/sources/kegg/pathway.py
CHANGED
|
File without changes
|
pyobo/sources/mesh.py
CHANGED
|
File without changes
|
pyobo/sources/mgi.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/sources/mirbase/mirbase.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
pyobo/sources/msigdb.py
CHANGED
|
File without changes
|
pyobo/sources/ncbi/__init__.py
CHANGED
|
File without changes
|
pyobo/sources/ncbi/ncbi_gc.py
CHANGED
|
File without changes
|
pyobo/sources/ncbi/ncbigene.py
CHANGED
|
File without changes
|
pyobo/sources/nih_reporter.py
CHANGED
|
File without changes
|
pyobo/sources/nlm/__init__.py
CHANGED
|
File without changes
|
pyobo/sources/nlm/nlm_catalog.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/sources/nlm/utils.py
CHANGED
|
File without changes
|
pyobo/sources/npass.py
CHANGED
|
File without changes
|
pyobo/sources/omim_ps.py
CHANGED
|
File without changes
|
pyobo/sources/pathbank.py
CHANGED
|
File without changes
|
pyobo/sources/pfam/__init__.py
CHANGED
|
File without changes
|
pyobo/sources/pfam/pfam.py
CHANGED
|
File without changes
|
pyobo/sources/pfam/pfam_clan.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
pyobo/sources/pharmgkb/utils.py
CHANGED
|
File without changes
|
pyobo/sources/pid.py
CHANGED
|
File without changes
|
pyobo/sources/pombase.py
CHANGED
|
File without changes
|
pyobo/sources/pubchem.py
CHANGED
|
File without changes
|
pyobo/sources/reactome.py
CHANGED
|
File without changes
|
pyobo/sources/rgd.py
CHANGED
|
File without changes
|
pyobo/sources/rhea.py
CHANGED
|
File without changes
|
pyobo/sources/ror.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/sources/selventa/schem.py
CHANGED
|
File without changes
|
pyobo/sources/selventa/scomp.py
CHANGED
|
File without changes
|
pyobo/sources/selventa/sdis.py
CHANGED
|
File without changes
|
pyobo/sources/selventa/sfam.py
CHANGED
|
File without changes
|
pyobo/sources/sgd.py
CHANGED
|
File without changes
|
pyobo/sources/signor/__init__.py
CHANGED
|
File without changes
|
pyobo/sources/signor/download.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/sources/slm.py
CHANGED
|
File without changes
|
pyobo/sources/spdx.py
CHANGED
|
File without changes
|
pyobo/sources/umls/__init__.py
CHANGED
|
File without changes
|
pyobo/sources/umls/__main__.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/sources/umls/sty.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/sources/umls/umls.py
CHANGED
|
File without changes
|
pyobo/sources/unimod.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/sources/uniprot/uniprot.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/sources/utils.py
CHANGED
|
File without changes
|
pyobo/sources/wikipathways.py
CHANGED
|
File without changes
|
pyobo/sources/zfin.py
CHANGED
|
File without changes
|
pyobo/ssg/__init__.py
CHANGED
|
File without changes
|
pyobo/ssg/base.html
CHANGED
|
File without changes
|
pyobo/ssg/index.html
CHANGED
|
File without changes
|
pyobo/ssg/term.html
CHANGED
|
File without changes
|
pyobo/ssg/typedef.html
CHANGED
|
File without changes
|
pyobo/struct/__init__.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/struct/functional/dsl.py
CHANGED
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Macros over functional OWL.
|
|
2
2
|
|
|
3
|
-
This module contains classes that are extensions
|
|
4
|
-
|
|
3
|
+
This module contains classes that are extensions to functional OWL that reflect common
|
|
4
|
+
usage.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import typing as t
|
|
@@ -57,8 +57,7 @@ class Macro(f.Box):
|
|
|
57
57
|
class RelationshipMacro(Macro):
|
|
58
58
|
"""A macro for an object-to-object relationship.
|
|
59
59
|
|
|
60
|
-
Assert that the RAET1E gene from HGNC (16793) is
|
|
61
|
-
only in the human taxon (9606)
|
|
60
|
+
Assert that the RAET1E gene from HGNC (16793) is only in the human taxon (9606)
|
|
62
61
|
|
|
63
62
|
>>> RelationshipMacro("hgnc:16793", "RO:0002160", "NCBITaxon:9606").to_funowl()
|
|
64
63
|
'SubClassOf(hgnc:16793 ObjectSomeValuesFrom(RO:0002160 NCBITaxon:9606))'
|
|
@@ -226,8 +225,8 @@ class SynonymMacro(Macro):
|
|
|
226
225
|
>>> SynonymMacro("hgnc:16793", "ULBP4").to_funowl()
|
|
227
226
|
'AnnotationAssertion(oboInOwl:hasRelatedSynonym hgnc:16793 "ULBP4")'
|
|
228
227
|
|
|
229
|
-
You can make the predicate more explicit either with OBO-style
|
|
230
|
-
|
|
228
|
+
You can make the predicate more explicit either with OBO-style scoping (``EXACT``,
|
|
229
|
+
``BROAD``, ``NARROW``, ``RELATED``) or a CURIE/:class:`curies.Reference`/URIRef
|
|
231
230
|
|
|
232
231
|
>>> SynonymMacro("hgnc:16793", "ULBP4", "EXACT").to_funowl()
|
|
233
232
|
'AnnotationAssertion(oboInOwl:hasExactSynonym hgnc:16793 "ULBP4")'
|
|
@@ -337,14 +336,15 @@ class HoldsOverChain(Macro):
|
|
|
337
336
|
class TransitiveOver(HoldsOverChain):
|
|
338
337
|
"""A macro for the OBO-style "transitive over" annotation.
|
|
339
338
|
|
|
340
|
-
For example, ``BFO:0000066`` (occurs in) is transitive over
|
|
341
|
-
|
|
342
|
-
and Y is a part of Z, then X occurs in Z.
|
|
339
|
+
For example, ``BFO:0000066`` (occurs in) is transitive over ``BFO:0000050`` (part
|
|
340
|
+
of). This means that if X occurs in Y, and Y is a part of Z, then X occurs in Z.
|
|
343
341
|
|
|
344
342
|
>>> TransitiveOver("BFO:0000066", "BFO:0000050").to_funowl()
|
|
345
343
|
'SubObjectPropertyOf(ObjectPropertyChain(BFO:0000066 BFO:0000050) BFO:0000066)'
|
|
346
344
|
|
|
347
|
-
.. note::
|
|
345
|
+
.. note::
|
|
346
|
+
|
|
347
|
+
This is a special case of :class:`HoldsOverChain`
|
|
348
348
|
"""
|
|
349
349
|
|
|
350
350
|
def __init__(self, predicate: f.IdentifierBoxOrHint, target: f.IdentifierBoxOrHint):
|
|
@@ -355,8 +355,8 @@ class TransitiveOver(HoldsOverChain):
|
|
|
355
355
|
class DataPropertyMaxCardinality(Macro):
|
|
356
356
|
r"""A macro over :class:`DataMaxCardinality` that adds an axiom.
|
|
357
357
|
|
|
358
|
-
For example, each person can be annotated with a maximum of one age.
|
|
359
|
-
|
|
358
|
+
For example, each person can be annotated with a maximum of one age. This can be
|
|
359
|
+
represented as:
|
|
360
360
|
|
|
361
361
|
>>> DataPropertyMaxCardinality(1, "a:hasAge").to_funowl()
|
|
362
362
|
'SubClassOf(owl:Thing DataMaxCardinality(1 a:hasAge))'
|
|
File without changes
|
|
File without changes
|
pyobo/struct/functional/utils.py
CHANGED
|
File without changes
|
pyobo/struct/obo/__init__.py
CHANGED
|
File without changes
|
pyobo/struct/obo/reader.py
CHANGED
|
File without changes
|
pyobo/struct/obo/reader_utils.py
CHANGED
|
File without changes
|
|
File without changes
|
pyobo/struct/obograph/export.py
CHANGED
|
File without changes
|
pyobo/struct/obograph/reader.py
CHANGED
|
File without changes
|
pyobo/struct/obograph/utils.py
CHANGED
|
File without changes
|
pyobo/struct/reference.py
CHANGED
|
@@ -142,9 +142,11 @@ def get_preferred_curie(
|
|
|
142
142
|
def default_reference(prefix: str, identifier: str, name: str | None = None) -> Reference:
|
|
143
143
|
"""Create a CURIE for an "unqualified" reference.
|
|
144
144
|
|
|
145
|
-
:param prefix: The prefix of the ontology in which the "unqualified" reference is
|
|
145
|
+
:param prefix: The prefix of the ontology in which the "unqualified" reference is
|
|
146
|
+
made
|
|
146
147
|
:param identifier: The "unqualified" reference. For example, if you just write
|
|
147
148
|
"located_in" somewhere there is supposed to be a CURIE
|
|
149
|
+
|
|
148
150
|
:returns: A CURIE for the "unqualified" reference based on the OBO semantic space
|
|
149
151
|
|
|
150
152
|
>>> default_reference("chebi", "conjugate_base_of")
|
pyobo/struct/struct.py
CHANGED
|
@@ -383,7 +383,8 @@ class Term(Stanza):
|
|
|
383
383
|
def get_species(self, prefix: str = NCBITAXON_PREFIX) -> Reference | None:
|
|
384
384
|
"""Get the species if it exists.
|
|
385
385
|
|
|
386
|
-
:param prefix: The prefix to use in case the term has several species
|
|
386
|
+
:param prefix: The prefix to use in case the term has several species
|
|
387
|
+
annotations.
|
|
387
388
|
"""
|
|
388
389
|
for species in self.get_relationships(v.from_species):
|
|
389
390
|
if species.prefix == prefix:
|
|
@@ -1651,7 +1652,9 @@ class Obo:
|
|
|
1651
1652
|
) -> Mapping[str, str]:
|
|
1652
1653
|
"""Get a mapping from a term's identifier to the property.
|
|
1653
1654
|
|
|
1654
|
-
.. warning::
|
|
1655
|
+
.. warning::
|
|
1656
|
+
|
|
1657
|
+
Assumes there's only one version of the property for each term.
|
|
1655
1658
|
"""
|
|
1656
1659
|
return {
|
|
1657
1660
|
term.identifier: value
|
|
@@ -1692,8 +1695,8 @@ class Obo:
|
|
|
1692
1695
|
) -> Iterable[tuple[Stanza, TypeDef, Reference]]:
|
|
1693
1696
|
"""Iterate over tuples of terms, relations, and their targets.
|
|
1694
1697
|
|
|
1695
|
-
This only outputs stuff from the `relationship:` tag, not
|
|
1696
|
-
|
|
1698
|
+
This only outputs stuff from the `relationship:` tag, not all possible triples.
|
|
1699
|
+
For that, see :func:`iterate_edges`.
|
|
1697
1700
|
"""
|
|
1698
1701
|
_warned: set[ReferenceTuple] = set()
|
|
1699
1702
|
typedefs = self._index_typedefs()
|
|
@@ -1804,9 +1807,11 @@ class Obo:
|
|
|
1804
1807
|
) -> Mapping[str, str]:
|
|
1805
1808
|
"""Get a mapping from the term's identifier to the target's identifier.
|
|
1806
1809
|
|
|
1807
|
-
.. warning::
|
|
1810
|
+
.. warning::
|
|
1811
|
+
|
|
1812
|
+
Assumes there's only one version of the property for each term.
|
|
1808
1813
|
|
|
1809
|
-
|
|
1814
|
+
Example usage: get homology between HGNC and MGI:
|
|
1810
1815
|
|
|
1811
1816
|
>>> from pyobo.sources.hgnc import HGNCGetter
|
|
1812
1817
|
>>> obo = HGNCGetter()
|
|
@@ -2031,7 +2036,8 @@ class Obo:
|
|
|
2031
2036
|
class TypeDef(Stanza):
|
|
2032
2037
|
"""A type definition in OBO.
|
|
2033
2038
|
|
|
2034
|
-
See the subsection of
|
|
2039
|
+
See the subsection of
|
|
2040
|
+
https://owlcollab.github.io/oboformat/doc/GO.format.obo-1_4.html#S.2.2.
|
|
2035
2041
|
"""
|
|
2036
2042
|
|
|
2037
2043
|
reference: Annotated[Reference, 1]
|
|
@@ -2126,14 +2132,16 @@ class TypeDef(Stanza):
|
|
|
2126
2132
|
) -> Iterable[str]:
|
|
2127
2133
|
"""Iterate over the lines to write in an OBO file.
|
|
2128
2134
|
|
|
2129
|
-
:param ontology_prefix:
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2135
|
+
:param ontology_prefix: The prefix of the ontology into which the type
|
|
2136
|
+
definition is being written. This is used for compressing builtin
|
|
2137
|
+
identifiers
|
|
2138
|
+
|
|
2139
|
+
:yield: The lines to write to an OBO file
|
|
2134
2140
|
|
|
2135
|
-
`S.3.5.5
|
|
2136
|
-
|
|
2141
|
+
`S.3.5.5
|
|
2142
|
+
<https://owlcollab.github.io/oboformat/doc/GO.format.obo-1_4.html#S.3.5.5>`_ of
|
|
2143
|
+
the OBO Flat File Specification v1.4 says tags should appear in the following
|
|
2144
|
+
order:
|
|
2137
2145
|
|
|
2138
2146
|
1. id
|
|
2139
2147
|
2. is_anonymous
|
pyobo/struct/struct_utils.py
CHANGED
|
File without changes
|
pyobo/struct/typedef.py
CHANGED
|
File without changes
|
pyobo/struct/utils.py
CHANGED
|
File without changes
|
pyobo/struct/vocabulary.py
CHANGED
|
File without changes
|
pyobo/utils/__init__.py
CHANGED
|
File without changes
|