|
1 | | -from dataclasses import dataclass |
2 | | -from pronto import Ontology |
3 | | - |
4 | 1 | # Import the logic to deal with OBO Foundry registry (Implementation) |
5 | | -from ontology_registry import OBORegistryAdapter |
6 | | - |
7 | 2 | # Import the logic to download files (Implementation) |
8 | 3 | from downloader import PoochDownloaderAdapter |
| 4 | +from ontology_registry import OBORegistryAdapter |
9 | 5 |
|
10 | 6 | # Import the logic to load ontologies (Implementation) |
11 | | -from ontology_loader import ProntoLoaderAdapter |
12 | 7 |
|
13 | 8 |
|
14 | | -cache_dir = "../data/out" |
| 9 | +cache_dir = '../data/out' |
15 | 10 |
|
16 | 11 | ontologies_registry = OBORegistryAdapter(cache_dir=cache_dir) |
17 | 12 |
|
18 | | -downloader = PoochDownloaderAdapter(cache_dir=cache_dir, registry=ontologies_registry) |
19 | | - |
20 | | - |
21 | | -class Ontology: |
22 | | - def __init__(self): |
23 | | - pass |
24 | | - |
25 | | - |
26 | | -class Registry: |
27 | | - def __init__(self): |
28 | | - pass |
29 | | - |
30 | | - |
31 | | -class Client: |
32 | | - def __init__(self): |
33 | | - self.__registry # This one needs to be instantiated Just one time (singleton?) |
34 | | - self.__ontology # This one can be instantiated multiple times |
35 | | - |
36 | | - # methods for manipulating the registry |
37 | | - def __initialize_registry(): |
38 | | - pass |
39 | | - |
40 | | - # methods for manipulating the ontology |
41 | | - def __initialize_ontology(): |
42 | | - pass |
43 | | - |
44 | | - |
45 | | -# 1. |
46 | | -""" |
47 | | -
|
48 | | -import ontograph as op |
49 | | -
|
| 13 | +downloader = PoochDownloaderAdapter( |
| 14 | + cache_dir=cache_dir, registry=ontologies_registry |
| 15 | +) |
50 | 16 |
|
51 | | -onto_registry = op.registry() |
52 | 17 |
|
53 | | -onto_registry.list_ontologies() |
| 18 | +# import ontograph as op |
54 | 19 |
|
55 | | -onto_registry.load_registry() |
56 | 20 |
|
57 | | -onto_registry.registry() |
| 21 | +# onto_registry = op.registry() |
58 | 22 |
|
59 | | -onto_registry.list_available_ontologies() |
| 23 | +# onto_registry.list_ontologies() |
60 | 24 |
|
61 | | -onto_registry.print_registry_schema_tree() |
| 25 | +# onto_registry.load_registry() |
62 | 26 |
|
63 | | -onto_registry.get_ontology_metadata() |
| 27 | +# onto_registry.registry() |
64 | 28 |
|
65 | | -onto_registry.get_download_url() |
| 29 | +# onto_registry.list_available_ontologies() |
66 | 30 |
|
67 | | -onto_registry.get_available_formats() |
| 31 | +# onto_registry.print_registry_schema_tree() |
68 | 32 |
|
| 33 | +# onto_registry.get_ontology_metadata() |
69 | 34 |
|
| 35 | +# onto_registry.get_download_url() |
70 | 36 |
|
71 | | -# Similar to Pandas Dataframe Look & Feel |
72 | | -go = op.load(path: str, name_id: str, format: str = "obo") |
| 37 | +# onto_registry.get_available_formats() |
73 | 38 |
|
74 | | -go.get_parents(term_id: str, depth: int = -1, include_self: bool = False) |
75 | 39 |
|
76 | | -go.get_children(term_id: str, depth: int = -1, include_self: bool = False) |
| 40 | +# # Similar to Pandas Dataframe Look & Feel |
| 41 | +# go = op.load(path: str, name_id: str, format: str = "obo") |
77 | 42 |
|
78 | | -go.get_siblings(term_id) |
| 43 | +# go.get_parents(term_id: str, depth: int = -1, include_self: bool = False) |
79 | 44 |
|
80 | | -go.get_roots() |
| 45 | +# go.get_children(term_id: str, depth: int = -1, include_self: bool = False) |
81 | 46 |
|
82 | | -go.get_leaves() |
| 47 | +# go.get_siblings(term_id) |
83 | 48 |
|
84 | | -go.find_path(source_id, target_id) |
| 49 | +# go.get_roots() |
85 | 50 |
|
86 | | -go.is_descendant(child_id, parent_id) |
| 51 | +# go.get_leaves() |
87 | 52 |
|
88 | | -go.get_depth(term_id) |
| 53 | +# go.find_path(source_id, target_id) |
89 | 54 |
|
90 | | -go.list_terms(prefix="GO:", include_obsolete=False) |
| 55 | +# go.is_descendant(child_id, parent_id) |
91 | 56 |
|
92 | | -go.get_term_info(term_id) |
| 57 | +# go.get_depth(term_id) |
93 | 58 |
|
94 | | -go.search_terms(query="metabolic process", exact=False) |
| 59 | +# go.list_terms(prefix="GO:", include_obsolete=False) |
95 | 60 |
|
96 | | -go.get_relationships(term_id) |
| 61 | +# go.get_term_info(term_id) |
97 | 62 |
|
98 | | -go.get_terms_by_relation(terms="part_of") |
| 63 | +# go.search_terms(query="metabolic process", exact=False) |
99 | 64 |
|
100 | | -go.get_common_ancestors(term_ids) |
| 65 | +# go.get_relationships(term_id) |
101 | 66 |
|
102 | | -go.term_exists(term_id) |
| 67 | +# go.get_terms_by_relation(terms="part_of") |
103 | 68 |
|
| 69 | +# go.get_common_ancestors(term_ids) |
104 | 70 |
|
105 | | -""" |
| 71 | +# go.term_exists(term_id) |
0 commit comments