cellxgene_ontology_guide.curated_ontology_term_lists
1import functools 2import json 3import os 4from typing import List 5 6from cellxgene_ontology_guide._constants import DATA_ROOT 7from cellxgene_ontology_guide.entities import CuratedOntologyTermList 8 9 10@functools.cache 11def get_curated_ontology_term_list(curated_ontology_term_list: CuratedOntologyTermList) -> List[str]: 12 """ 13 Get the list of curated ontology terms for the given curated_ontology_term_list. 14 15 :param curated_ontology_term_list: Enum attribute representing the curated ontology term list 16 :return: List[str] of ontology term IDs 17 """ 18 filename = f"{curated_ontology_term_list.value}_list.json" 19 with open(os.path.join(DATA_ROOT, filename)) as f: 20 return json.load(f) # type: ignore
@functools.cache
def
get_curated_ontology_term_list( curated_ontology_term_list: cellxgene_ontology_guide.entities.CuratedOntologyTermList) -> List[str]:
11@functools.cache 12def get_curated_ontology_term_list(curated_ontology_term_list: CuratedOntologyTermList) -> List[str]: 13 """ 14 Get the list of curated ontology terms for the given curated_ontology_term_list. 15 16 :param curated_ontology_term_list: Enum attribute representing the curated ontology term list 17 :return: List[str] of ontology term IDs 18 """ 19 filename = f"{curated_ontology_term_list.value}_list.json" 20 with open(os.path.join(DATA_ROOT, filename)) as f: 21 return json.load(f) # type: ignore
Get the list of curated ontology terms for the given curated_ontology_term_list.
Parameters
- curated_ontology_term_list: Enum attribute representing the curated ontology term list
Returns
List[str] of ontology term IDs