Skip to content

eds_scikit.biology.utils.process_concepts

ConceptsSet

ConceptsSet(name: str)

Class defining the concepts-sets with 2 attributes:

  • name: the name of the concepts-set
  • concept_codes : the list of concepts codes included in the concepts-set
Source code in eds_scikit/biology/utils/process_concepts.py
25
26
27
28
29
30
31
32
33
def __init__(self, name: str):
    self.name = name
    self.units = Units()

    fetched_codes = fetch_concept_codes_from_name(name)
    if fetched_codes:
        self.concept_codes = {"GLIMS_ANABIO": fetch_concept_codes_from_name(name)}
    else:
        self.concept_codes = {}

fetch_all_concepts_set

fetch_all_concepts_set(concepts_sets_table_name: str = 'default_concepts_sets') -> List[ConceptsSet]

Returns a list of all the concepts-sets of the chosen tables. By default, the table is here.

PARAMETER DESCRIPTION
concepts_sets_table_name

Name of the table to extract concepts-sets from

TYPE: str, optional DEFAULT: 'default_concepts_sets'

RETURNS DESCRIPTION
List[ConceptsSet]

The list of all concepts-sets in the selected table

Source code in eds_scikit/biology/utils/process_concepts.py
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
def fetch_all_concepts_set(
    concepts_sets_table_name: str = "default_concepts_sets",
) -> List[ConceptsSet]:
    """Returns a list of all the concepts-sets of the chosen tables. By default, the table is [here][concepts-sets].

    Parameters
    ----------
    concepts_sets_table_name : str, optional
        Name of the table to extract concepts-sets from

    Returns
    -------
    List[ConceptsSet]
        The list of all concepts-sets in the selected table
    """
    concepts_sets = []
    default_concepts_sets = getattr(datasets, concepts_sets_table_name)
    for concepts_set_name in default_concepts_sets.concepts_set_name:
        concepts_sets.append(ConceptsSet(concepts_set_name))
    logger.info("Fetch all concepts-sets from table {}", concepts_sets_table_name)
    return concepts_sets
Back to top