pyobo 0.10.11__py3-none-any.whl → 0.10.12__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/xrefdb/bengo.py DELETED
@@ -1,44 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- """Pipeline for building a large ontology graph."""
4
-
5
- import logging
6
-
7
- import bioregistry
8
- import networkx as nx
9
- from tqdm.auto import tqdm
10
-
11
- from pyobo import get_hierarchy
12
- from pyobo.getters import SKIP
13
- from pyobo.resource_utils import ensure_inspector_javert_df
14
-
15
- logger = logging.getLogger(__name__)
16
-
17
-
18
- def bens_magical_ontology(use_tqdm: bool = True) -> nx.DiGraph:
19
- """Make a super graph containing is_a, part_of, and xref relationships."""
20
- rv = nx.DiGraph()
21
-
22
- df = ensure_inspector_javert_df()
23
- for source_ns, source_id, target_ns, target_id, provenance in df.values:
24
- rv.add_edge(
25
- f"{source_ns}:{source_id}",
26
- f"{target_ns}:{target_id}",
27
- relation="xref",
28
- provenance=provenance,
29
- )
30
-
31
- logger.info("getting hierarchies")
32
- it = tqdm(sorted(bioregistry.read_registry()), desc="Entries", disable=not use_tqdm)
33
- for prefix in it:
34
- if bioregistry.is_deprecated(prefix) or prefix in SKIP:
35
- continue
36
- if use_tqdm:
37
- it.set_postfix({"prefix": prefix})
38
-
39
- hierarchy = get_hierarchy(prefix, include_has_member=True, include_part_of=True)
40
- rv.add_edges_from(hierarchy.edges(data=True))
41
-
42
- # TODO include translates_to, transcribes_to, and has_variant
43
-
44
- return rv