Skip to content

Commit

Permalink
feat: update ontology_info.json for 5.1 (#207)
Browse files Browse the repository at this point in the history
## Reason for Change

- #80

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
Bento007 and github-actions authored May 14, 2024
1 parent 1ba810e commit d5c8ae3
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/python/ontology-assets-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22dd42053d936b87d05c9786328723226e36c84e
6c11b719f1b469696aac64b16ccde2428c0dfaa6
10 changes: 5 additions & 5 deletions api/python/src/cellxgene_ontology_guide/ontology_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def get_term_label(self, term_id: str) -> str:
>>> from cellxgene_ontology_guide.ontology_parser import OntologyParser
>>> ontology_parser = OntologyParser()
>>> ontology_parser.get_term_label("CL:0000005")
'fibroblast neural crest derived'
'neural crest derived fibroblast'
:param term_id: str ontology term to fetch label for
:return: str human-readable label for the term
Expand All @@ -520,7 +520,7 @@ def map_term_labels(self, term_ids: Iterable[str]) -> Dict[str, str]:
>>> from cellxgene_ontology_guide.ontology_parser import OntologyParser
>>> ontology_parser = OntologyParser()
>>> ontology_parser.map_term_labels(["CL:0000005", "CL:0000003"])
{'CL:0000005': 'fibroblast neural crest derived', 'CL:0000003': 'obsolete native cell'}
{'CL:0000005': 'neural crest derived fibroblast', 'CL:0000003': 'obsolete native cell'}
:param term_ids: list of str ontology terms to fetch label for
:return: Dict[str, str] mapping term IDs to their respective human-readable labels
Expand All @@ -536,7 +536,7 @@ def get_term_description(self, term_id: str) -> Optional[str]:
>>> from cellxgene_ontology_guide.ontology_parser import OntologyParser
>>> ontology_parser = OntologyParser()
>>> ontology_parser.get_term_description("CL:0000005")
'Any fibroblast that is deriived from the neural crest.'
'Any fibroblast that is derived from the neural crest.'
:param term_id: str ontology term to fetch description for
:return: str description for the term
Expand All @@ -556,7 +556,7 @@ def map_term_descriptions(self, term_ids: List[str]) -> Dict[str, Optional[str]]
>>> from cellxgene_ontology_guide.ontology_parser import OntologyParser
>>> ontology_parser = OntologyParser()
>>> ontology_parser.map_term_descriptions(["CL:0000005", "CL:0000006"])
{'CL:0000005': 'Any fibroblast that is deriived from the neural crest.', 'CL:0000006': None}
{'CL:0000005': 'Any fibroblast that is derived from the neural crest.', 'CL:0000006': None}
:param term_ids: list of str ontology terms to fetch descriptions for
:return: Dict[str, str] mapping term IDs to their respective descriptions
Expand Down Expand Up @@ -592,7 +592,7 @@ def map_term_synonyms(self, term_ids: List[str]) -> Dict[str, List[str]]:
>>> from cellxgene_ontology_guide.ontology_parser import OntologyParser
>>> ontology_parser = OntologyParser()
>>> ontology_parser.map_term_synonyms(["CL:0000005", "CL:0000019"])
{'CL:0000005': [], 'CL:0000019': ['sperm cell', 'spermatozoid', 'spermatozoon']}
{'CL:0000005': ['fibroblast neural crest derived'], 'CL:0000019': ['sperm cell', 'spermatozoid', 'spermatozoon']}
:param term_ids: list of str ontology terms to fetch synonyms for
:return: Dict[str, List[str]] mapping term IDs to their respective synonym lists
Expand Down
Binary file added ontology-assets/CL-ontology-v2024-04-05.json.gz
Binary file not shown.
Binary file added ontology-assets/EFO-ontology-v3.65.0.json.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
52 changes: 51 additions & 1 deletion ontology-assets/ontology_info.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,53 @@
{
"5.1.0": {
"ontologies": {
"CL": {
"version": "v2024-04-05",
"source": "https://github.com/obophenotype/cell-ontology/releases/download",
"filename": "cl.owl"
},
"EFO": {
"version": "v3.65.0",
"source": "https://github.com/EBISPOT/efo/releases/download",
"filename": "efo.owl"
},
"HANCESTRO": {
"version": "3.0",
"source": "https://github.com/EBISPOT/hancestro/raw",
"filename": "hancestro.owl"
},
"HsapDv": {
"version": "11",
"source": "http://aber-owl.net/media/ontologies/HSAPDV",
"filename": "hsapdv.owl"
},
"MONDO": {
"version": "v2024-05-08",
"source": "https://github.com/monarch-initiative/mondo/releases/download",
"filename": "mondo.owl"
},
"MmusDv": {
"version": "9",
"source": "http://aber-owl.net/media/ontologies/MMUSDV",
"filename": "mmusdv.owl"
},
"NCBITaxon": {
"version": "v2023-06-20",
"source": "https://github.com/obophenotype/ncbitaxon/releases/download",
"filename": "ncbitaxon.owl.gz"
},
"UBERON": {
"version": "v2024-03-22",
"source": "https://github.com/obophenotype/uberon/releases/download",
"filename": "uberon.owl"
},
"PATO": {
"version": "v2023-05-18",
"source": "https://github.com/pato-ontology/pato/raw",
"filename": "pato.owl"
}
}
},
"5.0.0": {
"ontologies": {
"CL": {
Expand Down Expand Up @@ -46,6 +95,7 @@
"source": "https://github.com/pato-ontology/pato/raw",
"filename": "pato.owl"
}
}
},
"deprecated_on": "2024-05-10"
}
}
5 changes: 2 additions & 3 deletions tools/ontology-builder/src/all_ontology_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ def _extract_ontology_term_metadata(onto: owlready2.entity.ThingClass) -> Dict[s
if getattr(onto_term, "IAO_0000115", None):
term_dict[term_id]["description"] = onto_term.IAO_0000115[0]
# optional synonym list, if available
if getattr(onto_term, "hasExactSynonym", None):
term_dict[term_id]["synonyms"] = onto_term.hasExactSynonym

if hasExactSynonym := getattr(onto_term, "hasExactSynonym", None):
term_dict[term_id]["synonyms"] = [str(x) for x in hasExactSynonym]
# Add the "deprecated" status and associated metadata if True
term_dict[term_id]["deprecated"] = False
if onto_term.deprecated and onto_term.deprecated.first():
Expand Down

0 comments on commit d5c8ae3

Please sign in to comment.