From f0ad6b6b41190fb655583268ff1e431ba272ec7d Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Fri, 1 Sep 2023 13:00:08 +0100 Subject: [PATCH 01/12] Added get_most_specific_objects and get_most_specific_subjects methods --- pandasaurus/query.py | 54 +++++++++++++++++++++++++++++ pandasaurus/utils/sparql_queries.py | 24 +++++++++++++ 2 files changed, 78 insertions(+) diff --git a/pandasaurus/query.py b/pandasaurus/query.py index 02e8c7a..b1d2881 100644 --- a/pandasaurus/query.py +++ b/pandasaurus/query.py @@ -12,6 +12,8 @@ from pandasaurus.utils.sparql_queries import ( get_contextual_enrichment_query, get_full_enrichment_query, + get_most_specific_objects_query, + get_most_specific_subjects_query, get_simple_enrichment_query, get_synonym_query, ) @@ -225,6 +227,58 @@ def synonym_lookup(self) -> pd.DataFrame: return result_df + def get_most_specific_objects(self, predicate: str, ontology: str): + """ + + Args: + predicate: Relationship that wanted to be explored + ontology: PURL of obo ontologies in Ubergraph. + + Examples: + Example Ontology PURLs: + - http://purl.obolibrary.org/obo/cl.owl \n + - http://purl.obolibrary.org/obo/uberon.owl + + Returns: + + """ + subject_list = [term.get_iri() for term in self.__term_list] + query_string = get_most_specific_objects_query(subject_list, predicate, ontology) + return ( + pd.DataFrame( + [res for res in run_sparql_query(query_string)], + columns=["s", "s_label", "p", "o", "o_label"], + ) + .sort_values("s") + .reset_index(drop=True) + ) + + def get_most_specific_subjects(self, predicate: str, ontology: str): + """ + + Args: + predicate: Relationship that wanted to be explored + ontology: PURL of obo ontologies in Ubergraph. + + Examples: + Example Ontology PURLs: + - http://purl.obolibrary.org/obo/cl.owl \n + - http://purl.obolibrary.org/obo/uberon.owl + + Returns: + + """ + object_list = [term.get_iri() for term in self.__term_list] + query_string = get_most_specific_subjects_query(object_list, predicate, ontology) + return ( + pd.DataFrame( + [res for res in run_sparql_query(query_string)], + columns=["s", "s_label", "p", "o", "o_label"], + ) + .sort_values("s") + .reset_index(drop=True) + ) + def query(self, column_name: str, query_term: str) -> pd.DataFrame: """Returns filtered dataframe via join on column to subject of enriched_df, looking up of object name or synonym via query of name_lookup. diff --git a/pandasaurus/utils/sparql_queries.py b/pandasaurus/utils/sparql_queries.py index e4934b3..496c584 100644 --- a/pandasaurus/utils/sparql_queries.py +++ b/pandasaurus/utils/sparql_queries.py @@ -56,6 +56,30 @@ def get_synonym_query(term_iri_list: List[str]) -> str: ) +def get_most_specific_objects_query(term_iri_list: List[str], predicate: str, ontology: str) -> str: + return ( + f"SELECT DISTINCT (?cell as ?s) (?cell_label as ?s_label) (?predicate as ?p) (?process as ?o) " + f"(?function_label as ?o_label) " + f"FROM FROM " + f"WHERE {{ VALUES ?cell {{ {' '.join(term_iri_list)} }} VALUES ?predicate {{ {predicate} }} " + f"?cell rdfs:isDefinedBy <{ontology}>. ?cell ?predicate ?process. ?cell rdfs:label ?cell_label. " + f"?process rdfs:label ?function_label. FILTER NOT EXISTS {{ ?cell ?predicate ?process2. " + f"?process2 rdfs:subClassOf ?process. FILTER(?process2 != ?process) }} }} # LIMIT" + ) + + +def get_most_specific_subjects_query(term_iri_list: List[str], predicate: str, ontology: str): + return ( + f"SELECT DISTINCT (?cell as ?s) (?cell_label as ?s_label) (?predicate as ?p) (?process as ?o) " + f"(?function_label as ?o_label) " + f"FROM FROM " + f"WHERE {{ VALUES ?process {{ {' '.join(term_iri_list)} }} VALUES ?predicate {{ {predicate} }} " + f"?cell rdfs:isDefinedBy <{ontology}>. ?cell ?predicate ?process. ?cell rdfs:label ?cell_label. " + f"?process rdfs:label ?function_label. FILTER NOT EXISTS {{ ?cell ?predicate ?process2. " + f"?process2 rdfs:subClassOf ?process. FILTER(?process2 != ?process) }} }} # LIMIT" + ) + + def get_obsolete_term_query(seed_list: List[str]) -> str: # TODO Add missing implementation. Might not be needed pass From cdd9d52c568ca1888073d20a4b229d1e06766837 Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Fri, 1 Sep 2023 13:00:35 +0100 Subject: [PATCH 02/12] Version has been updated to 0.3.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3b57296..1391397 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pandasaurus" -version = "0.3.3" +version = "0.3.4" description = "Supporting simple queries over ontology annotations in dataframes, using UberGraph queries." authors = ["Ismail Ugur Bayindir "] license = "http://www.apache.org/licenses/LICENSE-2.0" From 6b86b2c507f6d80d8c4c362eecb6e46ce6157fdb Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 18:52:31 +0100 Subject: [PATCH 03/12] Added get_ancestor_enrichment_query method --- pandasaurus/utils/sparql_queries.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pandasaurus/utils/sparql_queries.py b/pandasaurus/utils/sparql_queries.py index 496c584..247f7b7 100644 --- a/pandasaurus/utils/sparql_queries.py +++ b/pandasaurus/utils/sparql_queries.py @@ -46,6 +46,28 @@ def get_label_query(term_iri_list: List[str]) -> str: ) +def get_ancestor_enrichment_query(seed_list: List[str], step_count) -> str: + query = "SELECT * WHERE { GRAPH " + query += f"{{ VALUES ?s {{{' '.join(seed_list)} }} " + query += f"?s rdfs:subClassOf ?o0. " + + defined_by = ( + "GRAPH { ?o0 rdfs:isDefinedBy " ". " + ) + + # Build the nested OPTIONAL blocks for the specified number of steps + for step in range(step_count): + if step < step_count - 1: + query += f"OPTIONAL {{ ?o{step} rdfs:subClassOf ?o{step + 1}.}} " + defined_by += f"?o{step + 1} rdfs:isDefinedBy . " + + query += "} " + query += defined_by + query += "}} #LIMIT" + + return query + + def get_synonym_query(term_iri_list: List[str]) -> str: return ( f"SELECT * WHERE {{VALUES ?s {{ {' '.join(term_iri_list)} }}" From f093e3adb51e7dfa3b6f3f5a0b507965f2e60a55 Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 18:52:42 +0100 Subject: [PATCH 04/12] Added ancestor_enrichment method --- pandasaurus/query.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pandasaurus/query.py b/pandasaurus/query.py index b1d2881..e984436 100644 --- a/pandasaurus/query.py +++ b/pandasaurus/query.py @@ -10,6 +10,7 @@ from pandasaurus.utils.pandasaurus_exceptions import InvalidTerm, ObsoletedTerm from pandasaurus.utils.query_utils import chunks, run_sparql_query from pandasaurus.utils.sparql_queries import ( + get_ancestor_enrichment_query, get_contextual_enrichment_query, get_full_enrichment_query, get_most_specific_objects_query, @@ -199,6 +200,32 @@ def contextual_slim_enrichment(self, context: List[str]) -> pd.DataFrame: return self.enriched_df + def ancestor_enrichment(self, step_count: str) -> pd.DataFrame: + source_list = [term.get_iri() for term in self.__term_list] + query_string = get_ancestor_enrichment_query(source_list, step_count) + object_list = list(set(uri for res in run_sparql_query(query_string) for uri in res.values())) + s_result = [] + for chunk in chunks(object_list, 90): + s_result.extend( + [ + res + for res in run_sparql_query( + get_simple_enrichment_query(source_list, chunk, self.__enrichment_property_list) + ) + ] + ) + + self.enriched_df = ( + pd.DataFrame(s_result, columns=["s", "s_label", "p", "o", "o_label"]) + .sort_values("s") + .reset_index(drop=True) + ) + self.mirror_enrichment_for_graph_generation(object_list) + self.graph = GraphGenerator.generate_enrichment_graph(self.graph_df) + self.graph = GraphGenerator.apply_transitive_reduction(self.graph, self.enriched_df["p"].unique().tolist()) + + return self.enriched_df + def synonym_lookup(self) -> pd.DataFrame: """ From 8578038115beb4cd936fa0f2ab409fb9471bff3c Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 18:53:08 +0100 Subject: [PATCH 05/12] Added new test cases for ancestor_enrichment --- test/test_query.py | 84 +++++++++++++++++++++++++++++++ test/utils/test_sparql_queries.py | 17 +++++++ 2 files changed, 101 insertions(+) diff --git a/test/test_query.py b/test/test_query.py index 2de75aa..471e388 100644 --- a/test/test_query.py +++ b/test/test_query.py @@ -1,4 +1,7 @@ from test.data.query_data import ( + get_ancestor_enrichment_data, + get_ancestor_object_list, + get_ancestor_enrichment_result, get_blood_and_immune_test_data, get_context_list, get_context_members_result, @@ -105,6 +108,13 @@ def test_simple_enrichment(mocker): side_effect=[ iter(get_enrichment_validate_curie_list_result()), iter(get_enrichment_find_obsolete_terms_data()), + ], + ) + # TODO Second call has to be revised + mocker.patch( + "pandasaurus.query.run_sparql_query", + side_effect=[ + iter(get_simple_enrichment_result()), iter(get_simple_enrichment_result()), ], ) @@ -126,7 +136,22 @@ def test_minimal_slim_enrichment(mocker): side_effect=[ iter(get_enrichment_validate_curie_list_result()), iter(get_enrichment_find_obsolete_terms_data()), + ], + ) + mocker.patch( + "pandasaurus.slim_manager.run_sparql_query", + side_effect=[ iter(get_slim_members_result()), + ], + ) + # TODO refactor needed!!! + mocker.patch( + "pandasaurus.query.run_sparql_query", + side_effect=[ + iter(get_minimal_enrichment_result()), + iter(get_minimal_enrichment_result()), + iter(get_minimal_enrichment_result()), + iter(get_minimal_enrichment_result()), iter(get_minimal_enrichment_result()), ], ) @@ -153,7 +178,22 @@ def test_full_slim_enrichment(mocker): side_effect=[ iter(get_enrichment_validate_curie_list_result()), iter(get_enrichment_find_obsolete_terms_data()), + ], + ) + mocker.patch( + "pandasaurus.slim_manager.run_sparql_query", + side_effect=[ iter(get_slim_members_result()), + ], + ) + # TODO refactor needed!!! + mocker.patch( + "pandasaurus.query.run_sparql_query", + side_effect=[ + iter(get_full_enrichment_result()), + iter(get_full_enrichment_result()), + iter(get_full_enrichment_result()), + iter(get_full_enrichment_result()), iter(get_full_enrichment_result()), ], ) @@ -180,7 +220,23 @@ def test_contextual_slim_enrichment(mocker): side_effect=[ iter(get_enrichment_validate_curie_list_result()), iter(get_enrichment_find_obsolete_terms_data()), + ], + ) + # TODO refactor needed!!! + mocker.patch( + "pandasaurus.query.run_sparql_query", + side_effect=[ iter(get_context_members_result()), + iter(get_contextual_enrichment_result()[0:89]), + iter(get_contextual_enrichment_result()[90:113]), + iter(get_contextual_enrichment_result()), + iter(get_contextual_enrichment_result()), + iter(get_contextual_enrichment_result()), + iter(get_contextual_enrichment_result()), + iter(get_contextual_enrichment_result()), + iter(get_contextual_enrichment_result()), + iter(get_contextual_enrichment_result()), + iter(get_contextual_enrichment_result()), iter(get_contextual_enrichment_result()), ], ) @@ -199,6 +255,34 @@ def test_contextual_slim_enrichment(mocker): ) +def test_ancestor_enrichment(mocker): + expected_simple_df = pd.DataFrame( + get_ancestor_enrichment_data(), columns=["s", "s_label", "p", "o", "o_label"] + ).sort_values("s") + + mocker.patch( + "pandasaurus.curie_validator.run_sparql_query", + side_effect=[ + iter(get_enrichment_validate_curie_list_result()), + iter(get_enrichment_find_obsolete_terms_data()), + ], + ) + mocker.patch( + "pandasaurus.query.run_sparql_query", + side_effect=[ + iter(get_ancestor_object_list()), + iter(get_ancestor_enrichment_result()), + iter(get_ancestor_enrichment_result()), + ], + ) + q = Query(blood_and_immune_test_data) + df = q.ancestor_enrichment(2) + assert df["s"].isin(blood_and_immune_test_data).any() + assert df["o"].isin(blood_and_immune_test_data).any() + assert expected_simple_df["s"].reset_index(drop=True).equals(df["s"].reset_index(drop=True)) + assert expected_simple_df["o"].reset_index(drop=True).equals(df["o"].reset_index(drop=True)) + + def test_synonym_lookup(mocker): q = Query(["CL:0000084", "CL:0000813", "CL:0000815", "CL:0000900"]) diff --git a/test/utils/test_sparql_queries.py b/test/utils/test_sparql_queries.py index 86597f7..75da017 100644 --- a/test/utils/test_sparql_queries.py +++ b/test/utils/test_sparql_queries.py @@ -1,4 +1,5 @@ from pandasaurus.utils.sparql_queries import ( + get_ancestor_enrichment_query, get_contextual_enrichment_query, get_full_enrichment_query, get_label_query, @@ -75,6 +76,22 @@ def test_get_label_query(): assert query == expected_query +def test_get_ancestor_enrichment_query(): + term_iri_list = ["term1", "term2", "term3"] + expected_n4_query = ( + "SELECT * WHERE { GRAPH { VALUES ?s {term1 term2 term3 } " + "?s rdfs:subClassOf ?o0. OPTIONAL { ?o0 rdfs:subClassOf ?o1.} " + "OPTIONAL { ?o1 rdfs:subClassOf ?o2.} OPTIONAL { ?o2 rdfs:subClassOf ?o3.} } " + "GRAPH { ?o0 rdfs:isDefinedBy . " + "?o1 rdfs:isDefinedBy . " + "?o2 rdfs:isDefinedBy . " + "?o3 rdfs:isDefinedBy . }}" + ) + assert get_ancestor_enrichment_query(term_iri_list, 4) == expected_n4_query + assert "o6" in get_ancestor_enrichment_query(term_iri_list, 7) + assert "o7" not in get_ancestor_enrichment_query(term_iri_list, 7) + + def test_get_synonym_query(): term_iri_list = ["term1", "term2", "term3"] expected_query = ( From 51655d64e3e98f70fad5607f6f04d4433fcfed75 Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 18:53:22 +0100 Subject: [PATCH 06/12] Added new data for ancestor_enrichment --- test/data/query_data.py | 3576 ++++++++++++++++++++++++++------------- 1 file changed, 2370 insertions(+), 1206 deletions(-) diff --git a/test/data/query_data.py b/test/data/query_data.py index a4e0176..8bac8be 100644 --- a/test/data/query_data.py +++ b/test/data/query_data.py @@ -953,115 +953,113 @@ def get_contextual_enrichment_data(): ] -def get_enrichment_validate_curie_list_result(): - return [ - {"term": "CL:0000084", "label": "T cell"}, - {"term": "CL:0000787", "label": "memory B cell"}, - {"term": "CL:0000788", "label": "naive B cell"}, - {"term": "CL:0000798", "label": "gamma-delta T cell"}, - {"term": "CL:0000809", "label": "double-positive, alpha-beta thymocyte"}, - {"term": "CL:0000813", "label": "memory T cell"}, - {"term": "CL:0000815", "label": "regulatory T cell"}, - {"term": "CL:0000895", "label": "naive thymus-derived CD4-positive, alpha-beta T cell"}, - {"term": "CL:0000897", "label": "CD4-positive, alpha-beta memory T cell"}, - {"term": "CL:0000900", "label": "naive thymus-derived CD8-positive, alpha-beta T cell"}, - {"term": "CL:0000909", "label": "CD8-positive, alpha-beta memory T cell"}, - {"term": "CL:0000940", "label": "mucosal invariant T cell"}, - {"term": "CL:0000980", "label": "plasmablast"}, - {"term": "CL:0002489", "label": "double negative thymocyte"}, - ] - - -def get_enrichment_find_obsolete_terms_data(): - return [] - - -def get_synonym_lookup_data(): +def get_ancestor_enrichment_data(): return [ - {"ID": "CL:0000084", "label": "T cell", "name": "mature T cell", "type": "related_synonym"}, - {"ID": "CL:0000084", "label": "T cell", "name": "T lymphocyte", "type": "exact_synonym"}, - {"ID": "CL:0000084", "label": "T cell", "name": "T-cell", "type": "exact_synonym"}, - {"ID": "CL:0000084", "label": "T cell", "name": "T-lymphocyte", "type": "exact_synonym"}, - {"ID": "CL:0000084", "label": "T cell", "name": "immature T cell", "type": "related_synonym"}, - {"ID": "CL:0000813", "label": "memory T cell", "name": "memory T lymphocyte", "type": "exact_synonym"}, - {"ID": "CL:0000813", "label": "memory T cell", "name": "memory T-cell", "type": "exact_synonym"}, - {"ID": "CL:0000813", "label": "memory T cell", "name": "memory T-lymphocyte", "type": "exact_synonym"}, { - "ID": "CL:0000815", - "label": "regulatory T cell", - "name": "suppressor T-lymphocyte", - "type": "broad_synonym", + "o": "CL:0000893", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", + "o_label": "thymocyte", }, - {"ID": "CL:0000815", "label": "regulatory T cell", "name": "suppressor T-cell", "type": "broad_synonym"}, { - "ID": "CL:0000815", - "label": "regulatory T cell", - "name": "suppressor T lymphocyte", - "type": "broad_synonym", + "o": "CL:0002420", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", + "o_label": "immature T cell", }, - {"ID": "CL:0000815", "label": "regulatory T cell", "name": "suppressor T cell", "type": "broad_synonym"}, - {"ID": "CL:0000815", "label": "regulatory T cell", "name": "Treg", "type": "exact_synonym"}, { - "ID": "CL:0000815", - "label": "regulatory T cell", - "name": "regulatory T-lymphocyte", - "type": "exact_synonym", + "o": "CL:0000145", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "professional antigen presenting cell", }, - {"ID": "CL:0000815", "label": "regulatory T cell", "name": "regulatory T-cell", "type": "exact_synonym"}, { - "ID": "CL:0000815", - "label": "regulatory T cell", - "name": "regulatory T lymphocyte", - "type": "exact_synonym", + "o": "CL:0000145", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "professional antigen presenting cell", }, + {"o": "CL:0000542", "s": "CL:0000084", "p": "rdfs:subClassOf", "s_label": "T cell", "o_label": "lymphocyte"}, { - "ID": "CL:0000900", - "label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "name": "naive thymus-dervied CD8-positive, alpha-beta T-lymphocyte", - "type": "exact_synonym", + "o": "CL:0000542", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "lymphocyte", }, { - "ID": "CL:0000900", - "label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "name": "naive thymus-dervied CD8-positive, alpha-beta T lymphocyte", - "type": "exact_synonym", + "o": "CL:0000542", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "lymphocyte", }, { - "ID": "CL:0000900", - "label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "name": "naive CD8+ T cell", - "type": "broad_synonym", + "o": "CL:0000785", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "mature B cell", }, { - "ID": "CL:0000900", - "label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "name": "naive thymus-dervied CD8-positive, alpha-beta T-cell", - "type": "exact_synonym", + "o": "CL:0000785", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "mature B cell", }, { - "ID": "CL:0000900", - "label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "name": "T.8Nve.Sp", - "type": "narrow_synonym", + "o": "CL:0000842", + "s": "CL:0000084", + "p": "rdfs:subClassOf", + "s_label": "T cell", + "o_label": "mononuclear cell", }, - ] - - -def get_simple_enrichment_result(): - return [ { - "o": "CL:0000084", - "s": "CL:0000897", + "o": "CL:0000842", + "s": "CL:0000787", "p": "rdfs:subClassOf", - "s_label": "CD4-positive, alpha-beta memory T cell", - "o_label": "T cell", + "s_label": "memory B cell", + "o_label": "mononuclear cell", }, { - "o": "CL:0000084", - "s": "CL:0000900", + "o": "CL:0000842", + "s": "CL:0000788", "p": "rdfs:subClassOf", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "o_label": "T cell", + "s_label": "naive B cell", + "o_label": "mononuclear cell", + }, + { + "o": "CL:0000945", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "lymphocyte of B lineage", + }, + { + "o": "CL:0000945", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "lymphocyte of B lineage", + }, + { + "o": "CL:0001201", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "B cell, CD19-positive", + }, + { + "o": "CL:0001201", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "B cell, CD19-positive", }, { "o": "CL:0000084", @@ -1085,128 +1083,144 @@ def get_simple_enrichment_result(): "o_label": "T cell", }, { - "o": "CL:0000813", - "s": "CL:0000897", + "o": "CL:0000145", + "s": "CL:0000980", "p": "rdfs:subClassOf", - "s_label": "CD4-positive, alpha-beta memory T cell", - "o_label": "memory T cell", + "s_label": "plasmablast", + "o_label": "professional antigen presenting cell", }, { - "o": "CL:0000813", + "o": "CL:0000542", "s": "CL:0000909", "p": "rdfs:subClassOf", "s_label": "CD8-positive, alpha-beta memory T cell", - "o_label": "memory T cell", + "o_label": "lymphocyte", }, { - "o": "CL:0000084", - "s": "CL:0000798", + "o": "CL:0000542", + "s": "CL:0000940", "p": "rdfs:subClassOf", - "s_label": "gamma-delta T cell", - "o_label": "T cell", + "s_label": "mucosal invariant T cell", + "o_label": "lymphocyte", }, { - "o": "CL:0000084", - "s": "CL:0000809", + "o": "CL:0000542", + "s": "CL:0000980", "p": "rdfs:subClassOf", - "s_label": "double-positive, alpha-beta thymocyte", - "o_label": "T cell", + "s_label": "plasmablast", + "o_label": "lymphocyte", }, { - "o": "CL:0000084", - "s": "CL:0000813", + "o": "CL:0000542", + "s": "CL:0002489", "p": "rdfs:subClassOf", - "s_label": "memory T cell", - "o_label": "T cell", + "s_label": "double negative thymocyte", + "o_label": "lymphocyte", }, { - "o": "CL:0000084", - "s": "CL:0000815", + "o": "CL:0000785", + "s": "CL:0000980", "p": "rdfs:subClassOf", - "s_label": "regulatory T cell", - "o_label": "T cell", + "s_label": "plasmablast", + "o_label": "mature B cell", }, { - "o": "CL:0000084", - "s": "CL:0000895", + "o": "CL:0000789", + "s": "CL:0000909", "p": "rdfs:subClassOf", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "o_label": "T cell", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "alpha-beta T cell", }, - ] - - -def get_minimal_enrichment_result(): - return [ { - "o": "CL:0000084", - "s": "CL:0000813", + "o": "CL:0000789", + "s": "CL:0000940", "p": "rdfs:subClassOf", - "s_label": "memory T cell", - "o_label": "T cell", + "s_label": "mucosal invariant T cell", + "o_label": "alpha-beta T cell", }, { - "o": "CL:0000084", - "s": "CL:0000815", + "o": "CL:0000791", + "s": "CL:0000909", "p": "rdfs:subClassOf", - "s_label": "regulatory T cell", - "o_label": "T cell", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "mature alpha-beta T cell", }, { - "o": "CL:0000789", - "s": "CL:0000809", + "o": "CL:0000791", + "s": "CL:0000940", "p": "rdfs:subClassOf", - "s_label": "double-positive, alpha-beta thymocyte", - "o_label": "alpha-beta T cell", + "s_label": "mucosal invariant T cell", + "o_label": "mature alpha-beta T cell", + }, + { + "o": "CL:0000813", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "memory T cell", }, { "o": "CL:0000842", - "s": "CL:0000809", + "s": "CL:0000909", "p": "rdfs:subClassOf", - "s_label": "double-positive, alpha-beta thymocyte", + "s_label": "CD8-positive, alpha-beta memory T cell", "o_label": "mononuclear cell", }, { "o": "CL:0000842", - "s": "CL:0000813", + "s": "CL:0000940", "p": "rdfs:subClassOf", - "s_label": "memory T cell", + "s_label": "mucosal invariant T cell", "o_label": "mononuclear cell", }, { - "o": "CL:0002420", - "s": "CL:0000809", + "o": "CL:0000842", + "s": "CL:0000980", "p": "rdfs:subClassOf", - "s_label": "double-positive, alpha-beta thymocyte", - "o_label": "immature T cell", + "s_label": "plasmablast", + "o_label": "mononuclear cell", }, { - "o": "CL:0000145", - "s": "CL:0000787", + "o": "CL:0000842", + "s": "CL:0002489", "p": "rdfs:subClassOf", - "s_label": "memory B cell", - "o_label": "professional antigen presenting cell", + "s_label": "double negative thymocyte", + "o_label": "mononuclear cell", }, { - "o": "CL:0000236", - "s": "CL:0000787", + "o": "CL:0000945", + "s": "CL:0000980", "p": "rdfs:subClassOf", - "s_label": "memory B cell", - "o_label": "B cell", + "s_label": "plasmablast", + "o_label": "lymphocyte of B lineage", }, { - "o": "CL:0000842", - "s": "CL:0000084", + "o": "CL:0000946", + "s": "CL:0000980", "p": "rdfs:subClassOf", - "s_label": "T cell", - "o_label": "mononuclear cell", + "s_label": "plasmablast", + "o_label": "antibody secreting cell", }, { - "o": "CL:0000842", - "s": "CL:0000787", + "o": "CL:0001201", + "s": "CL:0000980", "p": "rdfs:subClassOf", - "s_label": "memory B cell", - "o_label": "mononuclear cell", + "s_label": "plasmablast", + "o_label": "B cell, CD19-positive", + }, + { + "o": "CL:0002419", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "mature T cell", + }, + { + "o": "CL:0002419", + "s": "CL:0000940", + "p": "rdfs:subClassOf", + "s_label": "mucosal invariant T cell", + "o_label": "mature T cell", }, { "o": "CL:0000084", @@ -1223,110 +1237,117 @@ def get_minimal_enrichment_result(): "o_label": "T cell", }, { - "o": "CL:0000789", + "o": "CL:0000084", + "s": "CL:0000900", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "T cell", + }, + { + "o": "CL:0000542", "s": "CL:0000895", "p": "rdfs:subClassOf", "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "o_label": "alpha-beta T cell", + "o_label": "lymphocyte", }, { - "o": "CL:0000813", + "o": "CL:0000542", "s": "CL:0000897", "p": "rdfs:subClassOf", "s_label": "CD4-positive, alpha-beta memory T cell", - "o_label": "memory T cell", + "o_label": "lymphocyte", }, { - "o": "CL:0000842", - "s": "CL:0000815", + "o": "CL:0000542", + "s": "CL:0000900", "p": "rdfs:subClassOf", - "s_label": "regulatory T cell", - "o_label": "mononuclear cell", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "lymphocyte", }, { - "o": "CL:0000842", + "o": "CL:0000624", "s": "CL:0000895", "p": "rdfs:subClassOf", "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "o_label": "mononuclear cell", - }, - { - "o": "CL:0000084", - "s": "CL:0000798", - "p": "rdfs:subClassOf", - "s_label": "gamma-delta T cell", - "o_label": "T cell", + "o_label": "CD4-positive, alpha-beta T cell", }, { - "o": "CL:0000084", - "s": "CL:0000809", + "o": "CL:0000624", + "s": "CL:0000897", "p": "rdfs:subClassOf", - "s_label": "double-positive, alpha-beta thymocyte", - "o_label": "T cell", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "CD4-positive, alpha-beta T cell", }, { - "o": "CL:0000145", - "s": "CL:0000788", + "o": "CL:0000625", + "s": "CL:0000900", "p": "rdfs:subClassOf", - "s_label": "naive B cell", - "o_label": "professional antigen presenting cell", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "CD8-positive, alpha-beta T cell", }, { - "o": "CL:0000236", - "s": "CL:0000788", + "o": "CL:0000625", + "s": "CL:0000909", "p": "rdfs:subClassOf", - "s_label": "naive B cell", - "o_label": "B cell", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "CD8-positive, alpha-beta T cell", }, { - "o": "CL:0000842", - "s": "CL:0000788", + "o": "CL:0000789", + "s": "CL:0000895", "p": "rdfs:subClassOf", - "s_label": "naive B cell", - "o_label": "mononuclear cell", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "alpha-beta T cell", }, { - "o": "CL:0000842", - "s": "CL:0000798", + "o": "CL:0000789", + "s": "CL:0000897", "p": "rdfs:subClassOf", - "s_label": "gamma-delta T cell", - "o_label": "mononuclear cell", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "alpha-beta T cell", }, { - "o": "CL:0000084", + "o": "CL:0000789", "s": "CL:0000900", "p": "rdfs:subClassOf", "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "o_label": "T cell", + "o_label": "alpha-beta T cell", }, { - "o": "CL:0000084", - "s": "CL:0000909", + "o": "CL:0000791", + "s": "CL:0000895", "p": "rdfs:subClassOf", - "s_label": "CD8-positive, alpha-beta memory T cell", - "o_label": "T cell", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "mature alpha-beta T cell", }, { - "o": "CL:0000789", + "o": "CL:0000791", "s": "CL:0000897", "p": "rdfs:subClassOf", "s_label": "CD4-positive, alpha-beta memory T cell", - "o_label": "alpha-beta T cell", + "o_label": "mature alpha-beta T cell", }, { - "o": "CL:0000789", + "o": "CL:0000791", "s": "CL:0000900", "p": "rdfs:subClassOf", "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "o_label": "alpha-beta T cell", + "o_label": "mature alpha-beta T cell", }, { "o": "CL:0000813", - "s": "CL:0000909", + "s": "CL:0000897", "p": "rdfs:subClassOf", - "s_label": "CD8-positive, alpha-beta memory T cell", + "s_label": "CD4-positive, alpha-beta memory T cell", "o_label": "memory T cell", }, + { + "o": "CL:0000842", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "mononuclear cell", + }, { "o": "CL:0000842", "s": "CL:0000897", @@ -1342,1626 +1363,2769 @@ def get_minimal_enrichment_result(): "o_label": "mononuclear cell", }, { - "o": "CL:0000084", - "s": "CL:0000940", + "o": "CL:0000898", + "s": "CL:0000895", "p": "rdfs:subClassOf", - "s_label": "mucosal invariant T cell", - "o_label": "T cell", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "naive T cell", }, { - "o": "CL:0000789", - "s": "CL:0000909", + "o": "CL:0000898", + "s": "CL:0000900", "p": "rdfs:subClassOf", - "s_label": "CD8-positive, alpha-beta memory T cell", - "o_label": "alpha-beta T cell", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "naive T cell", }, { - "o": "CL:0000789", - "s": "CL:0000940", + "o": "CL:0002419", + "s": "CL:0000895", "p": "rdfs:subClassOf", - "s_label": "mucosal invariant T cell", - "o_label": "alpha-beta T cell", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "mature T cell", }, { - "o": "CL:0000842", - "s": "CL:0000909", + "o": "CL:0002419", + "s": "CL:0000897", "p": "rdfs:subClassOf", - "s_label": "CD8-positive, alpha-beta memory T cell", - "o_label": "mononuclear cell", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "mature T cell", }, { - "o": "CL:0000842", - "s": "CL:0000940", + "o": "CL:0002419", + "s": "CL:0000900", "p": "rdfs:subClassOf", - "s_label": "mucosal invariant T cell", - "o_label": "mononuclear cell", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "mature T cell", }, { "o": "CL:0000084", - "s": "CL:0002489", + "s": "CL:0000798", "p": "rdfs:subClassOf", - "s_label": "double negative thymocyte", + "s_label": "gamma-delta T cell", "o_label": "T cell", }, { - "o": "CL:0000145", - "s": "CL:0000980", + "o": "CL:0000084", + "s": "CL:0000809", "p": "rdfs:subClassOf", - "s_label": "plasmablast", - "o_label": "professional antigen presenting cell", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "T cell", }, + {"o": "CL:0000084", "s": "CL:0000813", "p": "rdfs:subClassOf", "s_label": "memory T cell", "o_label": "T cell"}, { - "o": "CL:0000236", - "s": "CL:0000980", + "o": "CL:0000084", + "s": "CL:0000815", "p": "rdfs:subClassOf", - "s_label": "plasmablast", - "o_label": "B cell", + "s_label": "regulatory T cell", + "o_label": "T cell", }, { - "o": "CL:0000842", - "s": "CL:0000980", + "o": "CL:0000542", + "s": "CL:0000798", "p": "rdfs:subClassOf", - "s_label": "plasmablast", - "o_label": "mononuclear cell", + "s_label": "gamma-delta T cell", + "o_label": "lymphocyte", }, { - "o": "CL:0000842", - "s": "CL:0002489", + "o": "CL:0000542", + "s": "CL:0000809", "p": "rdfs:subClassOf", - "s_label": "double negative thymocyte", - "o_label": "mononuclear cell", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "lymphocyte", }, { - "o": "CL:0002420", - "s": "CL:0002489", + "o": "CL:0000542", + "s": "CL:0000813", "p": "rdfs:subClassOf", - "s_label": "double negative thymocyte", - "o_label": "immature T cell", - }, - ] - - -def get_full_enrichment_result(): - return [ - { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0000785", - "x_label": "mature B cell", - "o": "CL:0000145", - "o_label": "professional antigen presenting cell", - }, - { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0000785", - "x_label": "mature B cell", - "o": "CL:0000145", - "o_label": "professional antigen presenting cell", - }, - { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000785", - "x_label": "mature B cell", - "o": "CL:0000145", - "o_label": "professional antigen presenting cell", + "s_label": "memory T cell", + "o_label": "lymphocyte", }, { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0000785", - "x_label": "mature B cell", - "o": "CL:0000236", - "o_label": "B cell", + "o": "CL:0000542", + "s": "CL:0000815", + "p": "rdfs:subClassOf", + "s_label": "regulatory T cell", + "o_label": "lymphocyte", }, { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0000785", - "x_label": "mature B cell", - "o": "CL:0000236", - "o_label": "B cell", + "o": "CL:0000789", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "alpha-beta T cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000785", - "x_label": "mature B cell", - "o": "CL:0000236", - "o_label": "B cell", + "o": "CL:0000790", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "immature alpha-beta T cell", }, { - "s": "CL:0000084", - "s_label": "T cell", - "x": "CL:0000542", - "x_label": "lymphocyte", "o": "CL:0000842", + "s": "CL:0000798", + "p": "rdfs:subClassOf", + "s_label": "gamma-delta T cell", "o_label": "mononuclear cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000542", - "x_label": "lymphocyte", "o": "CL:0000842", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", "o_label": "mononuclear cell", }, { - "s": "CL:0000798", - "s_label": "gamma-delta T cell", - "x": "CL:0000542", - "x_label": "lymphocyte", "o": "CL:0000842", + "s": "CL:0000813", + "p": "rdfs:subClassOf", + "s_label": "memory T cell", "o_label": "mononuclear cell", }, { + "o": "CL:0000842", "s": "CL:0000815", + "p": "rdfs:subClassOf", "s_label": "regulatory T cell", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", - }, - { - "s": "CL:0000813", - "s_label": "memory T cell", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", "o_label": "mononuclear cell", }, { + "o": "CL:0000893", "s": "CL:0000809", + "p": "rdfs:subClassOf", "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o_label": "thymocyte", }, { - "s": "CL:0000940", - "s_label": "mucosal invariant T cell", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o": "CL:0002419", + "s": "CL:0000813", + "p": "rdfs:subClassOf", + "s_label": "memory T cell", + "o_label": "mature T cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o": "CL:0002419", + "s": "CL:0000815", + "p": "rdfs:subClassOf", + "s_label": "regulatory T cell", + "o_label": "mature T cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o": "CL:0002420", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "immature T cell", }, + ] + + +def get_enrichment_validate_curie_list_result(): + return [ + {"term": "CL:0000084", "label": "T cell"}, + {"term": "CL:0000787", "label": "memory B cell"}, + {"term": "CL:0000788", "label": "naive B cell"}, + {"term": "CL:0000798", "label": "gamma-delta T cell"}, + {"term": "CL:0000809", "label": "double-positive, alpha-beta thymocyte"}, + {"term": "CL:0000813", "label": "memory T cell"}, + {"term": "CL:0000815", "label": "regulatory T cell"}, + {"term": "CL:0000895", "label": "naive thymus-derived CD4-positive, alpha-beta T cell"}, + {"term": "CL:0000897", "label": "CD4-positive, alpha-beta memory T cell"}, + {"term": "CL:0000900", "label": "naive thymus-derived CD8-positive, alpha-beta T cell"}, + {"term": "CL:0000909", "label": "CD8-positive, alpha-beta memory T cell"}, + {"term": "CL:0000940", "label": "mucosal invariant T cell"}, + {"term": "CL:0000980", "label": "plasmablast"}, + {"term": "CL:0002489", "label": "double negative thymocyte"}, + ] + + +def get_enrichment_find_obsolete_terms_data(): + return [] + + +def get_synonym_lookup_data(): + return [ + {"ID": "CL:0000084", "label": "T cell", "name": "mature T cell", "type": "related_synonym"}, + {"ID": "CL:0000084", "label": "T cell", "name": "T lymphocyte", "type": "exact_synonym"}, + {"ID": "CL:0000084", "label": "T cell", "name": "T-cell", "type": "exact_synonym"}, + {"ID": "CL:0000084", "label": "T cell", "name": "T-lymphocyte", "type": "exact_synonym"}, + {"ID": "CL:0000084", "label": "T cell", "name": "immature T cell", "type": "related_synonym"}, + {"ID": "CL:0000813", "label": "memory T cell", "name": "memory T lymphocyte", "type": "exact_synonym"}, + {"ID": "CL:0000813", "label": "memory T cell", "name": "memory T-cell", "type": "exact_synonym"}, + {"ID": "CL:0000813", "label": "memory T cell", "name": "memory T-lymphocyte", "type": "exact_synonym"}, { - "s": "CL:0002489", - "s_label": "double negative thymocyte", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "ID": "CL:0000815", + "label": "regulatory T cell", + "name": "suppressor T-lymphocyte", + "type": "broad_synonym", }, + {"ID": "CL:0000815", "label": "regulatory T cell", "name": "suppressor T-cell", "type": "broad_synonym"}, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "ID": "CL:0000815", + "label": "regulatory T cell", + "name": "suppressor T lymphocyte", + "type": "broad_synonym", }, + {"ID": "CL:0000815", "label": "regulatory T cell", "name": "suppressor T cell", "type": "broad_synonym"}, + {"ID": "CL:0000815", "label": "regulatory T cell", "name": "Treg", "type": "exact_synonym"}, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "ID": "CL:0000815", + "label": "regulatory T cell", + "name": "regulatory T-lymphocyte", + "type": "exact_synonym", }, + {"ID": "CL:0000815", "label": "regulatory T cell", "name": "regulatory T-cell", "type": "exact_synonym"}, { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "ID": "CL:0000815", + "label": "regulatory T cell", + "name": "regulatory T lymphocyte", + "type": "exact_synonym", }, { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0000542", - "x_label": "lymphocyte", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "ID": "CL:0000900", + "label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "name": "naive thymus-dervied CD8-positive, alpha-beta T-lymphocyte", + "type": "exact_synonym", }, { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0000785", - "x_label": "mature B cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "ID": "CL:0000900", + "label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "name": "naive thymus-dervied CD8-positive, alpha-beta T lymphocyte", + "type": "exact_synonym", }, { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0000785", - "x_label": "mature B cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "ID": "CL:0000900", + "label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "name": "naive CD8+ T cell", + "type": "broad_synonym", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000785", - "x_label": "mature B cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "ID": "CL:0000900", + "label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "name": "naive thymus-dervied CD8-positive, alpha-beta T-cell", + "type": "exact_synonym", }, { - "s": "CL:0000813", - "s_label": "memory T cell", - "x": "CL:0002419", - "x_label": "mature T cell", - "o": "CL:0000084", - "o_label": "T cell", + "ID": "CL:0000900", + "label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "name": "T.8Nve.Sp", + "type": "narrow_synonym", }, + ] + + +def get_simple_enrichment_result(): + return [ { - "s": "CL:0000815", - "s_label": "regulatory T cell", - "x": "CL:0002419", - "x_label": "mature T cell", "o": "CL:0000084", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", "o_label": "T cell", }, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0002419", - "x_label": "mature T cell", "o": "CL:0000084", + "s": "CL:0000900", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", "o_label": "T cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0002419", - "x_label": "mature T cell", "o": "CL:0000084", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", "o_label": "T cell", }, { + "o": "CL:0000084", "s": "CL:0000940", + "p": "rdfs:subClassOf", "s_label": "mucosal invariant T cell", - "x": "CL:0002419", - "x_label": "mature T cell", + "o_label": "T cell", + }, + { "o": "CL:0000084", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", "o_label": "T cell", }, { + "o": "CL:0000813", "s": "CL:0000897", + "p": "rdfs:subClassOf", "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0002419", - "x_label": "mature T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o_label": "memory T cell", }, { + "o": "CL:0000813", "s": "CL:0000909", + "p": "rdfs:subClassOf", "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0002419", - "x_label": "mature T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o_label": "memory T cell", }, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", "o": "CL:0000084", + "s": "CL:0000798", + "p": "rdfs:subClassOf", + "s_label": "gamma-delta T cell", "o_label": "T cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", "o": "CL:0000084", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", "o_label": "T cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", "o": "CL:0000084", + "s": "CL:0000813", + "p": "rdfs:subClassOf", + "s_label": "memory T cell", "o_label": "T cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", "o": "CL:0000084", + "s": "CL:0000815", + "p": "rdfs:subClassOf", + "s_label": "regulatory T cell", "o_label": "T cell", }, { - "s": "CL:0000940", - "s_label": "mucosal invariant T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", "o": "CL:0000084", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", "o_label": "T cell", }, + ] + + +def get_minimal_enrichment_result(): + return [ { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", - }, - { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", - }, - { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", + "o": "CL:0000084", + "s": "CL:0000813", + "p": "rdfs:subClassOf", + "s_label": "memory T cell", + "o_label": "T cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", + "o": "CL:0000084", + "s": "CL:0000815", + "p": "rdfs:subClassOf", + "s_label": "regulatory T cell", + "o_label": "T cell", }, { - "s": "CL:0000940", - "s_label": "mucosal invariant T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", "o": "CL:0000789", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", "o_label": "alpha-beta T cell", }, { - "s": "CL:0000813", - "s_label": "memory T cell", - "x": "CL:0002419", - "x_label": "mature T cell", "o": "CL:0000842", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", "o_label": "mononuclear cell", }, { - "s": "CL:0000815", - "s_label": "regulatory T cell", - "x": "CL:0002419", - "x_label": "mature T cell", "o": "CL:0000842", + "s": "CL:0000813", + "p": "rdfs:subClassOf", + "s_label": "memory T cell", "o_label": "mononuclear cell", }, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0002419", - "x_label": "mature T cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o": "CL:0002420", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "immature T cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0002419", - "x_label": "mature T cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o": "CL:0000145", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "professional antigen presenting cell", }, { - "s": "CL:0000940", - "s_label": "mucosal invariant T cell", - "x": "CL:0002419", - "x_label": "mature T cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o": "CL:0000236", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "B cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0002419", - "x_label": "mature T cell", "o": "CL:0000842", + "s": "CL:0000084", + "p": "rdfs:subClassOf", + "s_label": "T cell", "o_label": "mononuclear cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0002419", - "x_label": "mature T cell", "o": "CL:0000842", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", "o_label": "mononuclear cell", }, { + "o": "CL:0000084", "s": "CL:0000895", + "p": "rdfs:subClassOf", "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o_label": "T cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o": "CL:0000084", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "T cell", + }, + { + "o": "CL:0000789", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "alpha-beta T cell", }, { + "o": "CL:0000813", "s": "CL:0000897", + "p": "rdfs:subClassOf", "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o_label": "memory T cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", "o": "CL:0000842", + "s": "CL:0000815", + "p": "rdfs:subClassOf", + "s_label": "regulatory T cell", "o_label": "mononuclear cell", }, { - "s": "CL:0000940", - "s_label": "mucosal invariant T cell", - "x": "CL:0000791", - "x_label": "mature alpha-beta T cell", "o": "CL:0000842", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", "o_label": "mononuclear cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000790", - "x_label": "immature alpha-beta T cell", "o": "CL:0000084", + "s": "CL:0000798", + "p": "rdfs:subClassOf", + "s_label": "gamma-delta T cell", "o_label": "T cell", }, { + "o": "CL:0000084", "s": "CL:0000809", + "p": "rdfs:subClassOf", "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000893", - "x_label": "thymocyte", - "o": "CL:0000084", - "o_label": "T cell", - }, - { - "s": "CL:0002489", - "s_label": "double negative thymocyte", - "x": "CL:0000893", - "x_label": "thymocyte", - "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000790", - "x_label": "immature alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", + "o": "CL:0000145", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "professional antigen presenting cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000790", - "x_label": "immature alpha-beta T cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o": "CL:0000236", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "B cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000893", - "x_label": "thymocyte", "o": "CL:0000842", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", "o_label": "mononuclear cell", }, { - "s": "CL:0002489", - "s_label": "double negative thymocyte", - "x": "CL:0000893", - "x_label": "thymocyte", "o": "CL:0000842", + "s": "CL:0000798", + "p": "rdfs:subClassOf", + "s_label": "gamma-delta T cell", "o_label": "mononuclear cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000790", - "x_label": "immature alpha-beta T cell", - "o": "CL:0002420", - "o_label": "immature T cell", - }, - { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000893", - "x_label": "thymocyte", - "o": "CL:0002420", - "o_label": "immature T cell", - }, - { - "s": "CL:0002489", - "s_label": "double negative thymocyte", - "x": "CL:0000893", - "x_label": "thymocyte", - "o": "CL:0002420", - "o_label": "immature T cell", - }, - { - "s": "CL:0000798", - "s_label": "gamma-delta T cell", - "x": "CL:0000084", - "x_label": "T cell", "o": "CL:0000084", + "s": "CL:0000900", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", "o_label": "T cell", }, { - "s": "CL:0000813", - "s_label": "memory T cell", - "x": "CL:0000084", - "x_label": "T cell", "o": "CL:0000084", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", "o_label": "T cell", }, { + "o": "CL:0000789", "s": "CL:0000897", + "p": "rdfs:subClassOf", "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000084", - "x_label": "T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o_label": "alpha-beta T cell", }, { - "s": "CL:0000815", - "s_label": "regulatory T cell", - "x": "CL:0000084", - "x_label": "T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o": "CL:0000789", + "s": "CL:0000900", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "alpha-beta T cell", + }, + { + "o": "CL:0000813", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "memory T cell", + }, + { + "o": "CL:0000842", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "mononuclear cell", }, { + "o": "CL:0000842", "s": "CL:0000900", + "p": "rdfs:subClassOf", "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000084", - "x_label": "T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o_label": "mononuclear cell", }, { - "s": "CL:0002489", - "s_label": "double negative thymocyte", - "x": "CL:0000084", - "x_label": "T cell", "o": "CL:0000084", + "s": "CL:0000940", + "p": "rdfs:subClassOf", + "s_label": "mucosal invariant T cell", "o_label": "T cell", }, { + "o": "CL:0000789", "s": "CL:0000909", + "p": "rdfs:subClassOf", "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000084", - "x_label": "T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o_label": "alpha-beta T cell", }, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000084", - "x_label": "T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o": "CL:0000789", + "s": "CL:0000940", + "p": "rdfs:subClassOf", + "s_label": "mucosal invariant T cell", + "o_label": "alpha-beta T cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000084", - "x_label": "T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o": "CL:0000842", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "mononuclear cell", }, { + "o": "CL:0000842", "s": "CL:0000940", + "p": "rdfs:subClassOf", "s_label": "mucosal invariant T cell", - "x": "CL:0000084", - "x_label": "T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o_label": "mononuclear cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000898", - "x_label": "naive T cell", "o": "CL:0000084", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", "o_label": "T cell", }, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000898", - "x_label": "naive T cell", - "o": "CL:0000084", - "o_label": "T cell", + "o": "CL:0000145", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", + "o_label": "professional antigen presenting cell", }, { - "s": "CL:0000798", - "s_label": "gamma-delta T cell", - "x": "CL:0000084", - "x_label": "T cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "o": "CL:0000236", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", + "o_label": "B cell", }, { - "s": "CL:0000813", - "s_label": "memory T cell", - "x": "CL:0000084", - "x_label": "T cell", "o": "CL:0000842", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", "o_label": "mononuclear cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000084", - "x_label": "T cell", "o": "CL:0000842", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", "o_label": "mononuclear cell", }, { - "s": "CL:0000815", - "s_label": "regulatory T cell", - "x": "CL:0000084", - "x_label": "T cell", + "o": "CL:0002420", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", + "o_label": "immature T cell", + }, + ] + + +def get_full_enrichment_result(): + return [ + { + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0000785", + "x_label": "mature B cell", + "o": "CL:0000145", + "o_label": "professional antigen presenting cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0000785", + "x_label": "mature B cell", + "o": "CL:0000145", + "o_label": "professional antigen presenting cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000785", + "x_label": "mature B cell", + "o": "CL:0000145", + "o_label": "professional antigen presenting cell", + }, + { + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0000785", + "x_label": "mature B cell", + "o": "CL:0000236", + "o_label": "B cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0000785", + "x_label": "mature B cell", + "o": "CL:0000236", + "o_label": "B cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000785", + "x_label": "mature B cell", + "o": "CL:0000236", + "o_label": "B cell", + }, + { + "s": "CL:0000084", + "s_label": "T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000084", - "x_label": "T cell", + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0002489", - "s_label": "double negative thymocyte", - "x": "CL:0000084", - "x_label": "T cell", + "s": "CL:0000798", + "s_label": "gamma-delta T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000084", - "x_label": "T cell", + "s": "CL:0000815", + "s_label": "regulatory T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000084", - "x_label": "T cell", + "s": "CL:0000813", + "s_label": "memory T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { "s": "CL:0000809", "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000084", - "x_label": "T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { "s": "CL:0000940", "s_label": "mucosal invariant T cell", - "x": "CL:0000084", - "x_label": "T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000898", - "x_label": "naive T cell", + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000898", - "x_label": "naive T cell", + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000625", - "x_label": "CD8-positive, alpha-beta T cell", - "o": "CL:0000084", - "o_label": "T cell", + "s": "CL:0002489", + "s_label": "double negative thymocyte", + "x": "CL:0000542", + "x_label": "lymphocyte", + "o": "CL:0000842", + "o_label": "mononuclear cell", }, { "s": "CL:0000909", "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000625", - "x_label": "CD8-positive, alpha-beta T cell", - "o": "CL:0000084", - "o_label": "T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", + "o": "CL:0000842", + "o_label": "mononuclear cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000625", - "x_label": "CD8-positive, alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000542", + "x_label": "lymphocyte", + "o": "CL:0000842", + "o_label": "mononuclear cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000625", - "x_label": "CD8-positive, alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0000542", + "x_label": "lymphocyte", + "o": "CL:0000842", + "o_label": "mononuclear cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000625", - "x_label": "CD8-positive, alpha-beta T cell", + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0000542", + "x_label": "lymphocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000625", - "x_label": "CD8-positive, alpha-beta T cell", + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0000785", + "x_label": "mature B cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0000785", + "x_label": "mature B cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000785", + "x_label": "mature B cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, + { + "s": "CL:0000813", + "s_label": "memory T cell", + "x": "CL:0002419", + "x_label": "mature T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000815", + "s_label": "regulatory T cell", + "x": "CL:0002419", + "x_label": "mature T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0002419", + "x_label": "mature T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0002419", + "x_label": "mature T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0002419", + "x_label": "mature T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, { "s": "CL:0000897", "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000813", - "x_label": "memory T cell", + "x": "CL:0002419", + "x_label": "mature T cell", "o": "CL:0000084", "o_label": "T cell", }, { "s": "CL:0000909", "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000813", - "x_label": "memory T cell", + "x": "CL:0002419", + "x_label": "mature T cell", "o": "CL:0000084", "o_label": "T cell", }, { "s": "CL:0000895", "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000624", - "x_label": "CD4-positive, alpha-beta T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000624", - "x_label": "CD4-positive, alpha-beta T cell", + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0000145", - "x_label": "professional antigen presenting cell", - "o": "CL:0000145", - "o_label": "professional antigen presenting cell", + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0000145", - "x_label": "professional antigen presenting cell", - "o": "CL:0000145", - "o_label": "professional antigen presenting cell", + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000145", - "x_label": "professional antigen presenting cell", - "o": "CL:0000145", - "o_label": "professional antigen presenting cell", + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { "s": "CL:0000895", "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000624", - "x_label": "CD4-positive, alpha-beta T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", "o": "CL:0000789", "o_label": "alpha-beta T cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000624", - "x_label": "CD4-positive, alpha-beta T cell", + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", "o": "CL:0000789", "o_label": "alpha-beta T cell", }, { "s": "CL:0000897", "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000813", - "x_label": "memory T cell", - "o": "CL:0000813", - "o_label": "memory T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000813", - "x_label": "memory T cell", - "o": "CL:0000813", - "o_label": "memory T cell", + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000813", - "x_label": "memory T cell", + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", + }, + { + "s": "CL:0000813", + "s_label": "memory T cell", + "x": "CL:0002419", + "x_label": "mature T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000813", - "x_label": "memory T cell", + "s": "CL:0000815", + "s_label": "regulatory T cell", + "x": "CL:0002419", + "x_label": "mature T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { "s": "CL:0000895", "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000624", - "x_label": "CD4-positive, alpha-beta T cell", + "x": "CL:0002419", + "x_label": "mature T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000624", - "x_label": "CD4-positive, alpha-beta T cell", + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0002419", + "x_label": "mature T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0000236", - "x_label": "B cell", - "o": "CL:0000236", - "o_label": "B cell", + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0002419", + "x_label": "mature T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000236", - "x_label": "B cell", - "o": "CL:0000236", - "o_label": "B cell", + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0002419", + "x_label": "mature T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", }, { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0000236", - "x_label": "B cell", - "o": "CL:0000236", - "o_label": "B cell", - }, - { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0001201", - "x_label": "B cell, CD19-positive", - "o": "CL:0000236", - "o_label": "B cell", - }, - { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0001201", - "x_label": "B cell, CD19-positive", - "o": "CL:0000236", - "o_label": "B cell", - }, - { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0001201", - "x_label": "B cell, CD19-positive", - "o": "CL:0000236", - "o_label": "B cell", - }, - { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0000236", - "x_label": "B cell", + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0002419", + "x_label": "mature T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000236", - "x_label": "B cell", + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0000236", - "x_label": "B cell", + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0001201", - "x_label": "B cell, CD19-positive", + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0001201", - "x_label": "B cell, CD19-positive", + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0001201", - "x_label": "B cell, CD19-positive", + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0000791", + "x_label": "mature alpha-beta T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000945", - "x_label": "lymphocyte of B lineage", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000790", + "x_label": "immature alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0000945", - "x_label": "lymphocyte of B lineage", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000893", + "x_label": "thymocyte", + "o": "CL:0000084", + "o_label": "T cell", }, { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0000945", - "x_label": "lymphocyte of B lineage", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "s": "CL:0002489", + "s_label": "double negative thymocyte", + "x": "CL:0000893", + "x_label": "thymocyte", + "o": "CL:0000084", + "o_label": "T cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000946", - "x_label": "antibody secreting cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000790", + "x_label": "immature alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0001200", - "x_label": "lymphocyte of B lineage, CD19-positive", + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000790", + "x_label": "immature alpha-beta T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000787", - "s_label": "memory B cell", - "x": "CL:0001200", - "x_label": "lymphocyte of B lineage, CD19-positive", + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000893", + "x_label": "thymocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000788", - "s_label": "naive B cell", - "x": "CL:0001200", - "x_label": "lymphocyte of B lineage, CD19-positive", + "s": "CL:0002489", + "s_label": "double negative thymocyte", + "x": "CL:0000893", + "x_label": "thymocyte", "o": "CL:0000842", "o_label": "mononuclear cell", }, { "s": "CL:0000809", "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "x": "CL:0000790", + "x_label": "immature alpha-beta T cell", + "o": "CL:0002420", + "o_label": "immature T cell", + }, + { + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000893", + "x_label": "thymocyte", + "o": "CL:0002420", + "o_label": "immature T cell", + }, + { + "s": "CL:0002489", + "s_label": "double negative thymocyte", + "x": "CL:0000893", + "x_label": "thymocyte", + "o": "CL:0002420", + "o_label": "immature T cell", + }, + { + "s": "CL:0000798", + "s_label": "gamma-delta T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0000940", - "s_label": "mucosal invariant T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0000813", + "s_label": "memory T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0000815", + "s_label": "regulatory T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0002489", + "s_label": "double negative thymocyte", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0002420", - "x_label": "immature T cell", + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000084", "o_label": "T cell", }, { - "s": "CL:0002489", - "s_label": "double negative thymocyte", - "x": "CL:0002420", - "x_label": "immature T cell", + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000084", "o_label": "T cell", }, { "s": "CL:0000809", "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", + "x": "CL:0000084", + "x_label": "T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { "s": "CL:0000940", "s_label": "mucosal invariant T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", + "x": "CL:0000084", + "x_label": "T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { "s": "CL:0000900", "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", - }, - { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", + "x": "CL:0000898", + "x_label": "naive T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { "s": "CL:0000895", "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", - }, - { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", - "o": "CL:0000789", - "o_label": "alpha-beta T cell", + "x": "CL:0000898", + "x_label": "naive T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0000798", + "s_label": "gamma-delta T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000940", - "s_label": "mucosal invariant T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0000813", + "s_label": "memory T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000900", - "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000909", - "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0000815", + "s_label": "regulatory T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000895", - "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000789", - "x_label": "alpha-beta T cell", + "s": "CL:0002489", + "s_label": "double negative thymocyte", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000084", - "s_label": "T cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000798", - "s_label": "gamma-delta T cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000813", - "s_label": "memory T cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000815", - "s_label": "regulatory T cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0000084", + "x_label": "T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000980", - "s_label": "plasmablast", - "x": "CL:0000842", - "x_label": "mononuclear cell", + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000898", + "x_label": "naive T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0000842", - "x_label": "mononuclear cell", + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000898", + "x_label": "naive T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { - "s": "CL:0000940", - "s_label": "mucosal invariant T cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000625", + "x_label": "CD8-positive, alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { - "s": "CL:0000897", - "s_label": "CD4-positive, alpha-beta memory T cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000625", + "x_label": "CD8-positive, alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { "s": "CL:0000900", "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "x": "CL:0000625", + "x_label": "CD8-positive, alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", }, { - "s": "CL:0002489", - "s_label": "double negative thymocyte", - "x": "CL:0000842", - "x_label": "mononuclear cell", + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000625", + "x_label": "CD8-positive, alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", + }, + { + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000625", + "x_label": "CD8-positive, alpha-beta T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, { "s": "CL:0000909", "s_label": "CD8-positive, alpha-beta memory T cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", + "x": "CL:0000625", + "x_label": "CD8-positive, alpha-beta T cell", "o": "CL:0000842", "o_label": "mononuclear cell", }, + { + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000813", + "x_label": "memory T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000813", + "x_label": "memory T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, { "s": "CL:0000895", "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "x": "CL:0000624", + "x_label": "CD4-positive, alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000624", + "x_label": "CD4-positive, alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { "s": "CL:0000787", "s_label": "memory B cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "x": "CL:0000145", + "x_label": "professional antigen presenting cell", + "o": "CL:0000145", + "o_label": "professional antigen presenting cell", }, { "s": "CL:0000788", "s_label": "naive B cell", - "x": "CL:0000842", - "x_label": "mononuclear cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "x": "CL:0000145", + "x_label": "professional antigen presenting cell", + "o": "CL:0000145", + "o_label": "professional antigen presenting cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0002420", - "x_label": "immature T cell", - "o": "CL:0002420", - "o_label": "immature T cell", + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000145", + "x_label": "professional antigen presenting cell", + "o": "CL:0000145", + "o_label": "professional antigen presenting cell", }, { - "s": "CL:0002489", - "s_label": "double negative thymocyte", - "x": "CL:0002420", - "x_label": "immature T cell", - "o": "CL:0002420", - "o_label": "immature T cell", + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000624", + "x_label": "CD4-positive, alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", }, { - "s": "CL:0000809", - "s_label": "double-positive, alpha-beta thymocyte", - "x": "CL:0002420", - "x_label": "immature T cell", - "o": "CL:0000842", - "o_label": "mononuclear cell", + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000624", + "x_label": "CD4-positive, alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", + }, + { + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000813", + "x_label": "memory T cell", + "o": "CL:0000813", + "o_label": "memory T cell", + }, + { + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000813", + "x_label": "memory T cell", + "o": "CL:0000813", + "o_label": "memory T cell", + }, + { + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000813", + "x_label": "memory T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000813", + "x_label": "memory T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000624", + "x_label": "CD4-positive, alpha-beta T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000624", + "x_label": "CD4-positive, alpha-beta T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0000236", + "x_label": "B cell", + "o": "CL:0000236", + "o_label": "B cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000236", + "x_label": "B cell", + "o": "CL:0000236", + "o_label": "B cell", + }, + { + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0000236", + "x_label": "B cell", + "o": "CL:0000236", + "o_label": "B cell", + }, + { + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0001201", + "x_label": "B cell, CD19-positive", + "o": "CL:0000236", + "o_label": "B cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0001201", + "x_label": "B cell, CD19-positive", + "o": "CL:0000236", + "o_label": "B cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0001201", + "x_label": "B cell, CD19-positive", + "o": "CL:0000236", + "o_label": "B cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0000236", + "x_label": "B cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000236", + "x_label": "B cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0000236", + "x_label": "B cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0001201", + "x_label": "B cell, CD19-positive", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0001201", + "x_label": "B cell, CD19-positive", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0001201", + "x_label": "B cell, CD19-positive", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000945", + "x_label": "lymphocyte of B lineage", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0000945", + "x_label": "lymphocyte of B lineage", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0000945", + "x_label": "lymphocyte of B lineage", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000946", + "x_label": "antibody secreting cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0001200", + "x_label": "lymphocyte of B lineage, CD19-positive", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0001200", + "x_label": "lymphocyte of B lineage, CD19-positive", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0001200", + "x_label": "lymphocyte of B lineage, CD19-positive", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0002420", + "x_label": "immature T cell", + "o": "CL:0000084", + "o_label": "T cell", }, { "s": "CL:0002489", "s_label": "double negative thymocyte", "x": "CL:0002420", "x_label": "immature T cell", + "o": "CL:0000084", + "o_label": "T cell", + }, + { + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", + }, + { + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", + }, + { + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", + }, + { + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", + }, + { + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", + }, + { + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000789", + "o_label": "alpha-beta T cell", + }, + { + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000789", + "x_label": "alpha-beta T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000084", + "s_label": "T cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000798", + "s_label": "gamma-delta T cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000813", + "s_label": "memory T cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000815", + "s_label": "regulatory T cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000980", + "s_label": "plasmablast", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000940", + "s_label": "mucosal invariant T cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000897", + "s_label": "CD4-positive, alpha-beta memory T cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000900", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0002489", + "s_label": "double negative thymocyte", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000909", + "s_label": "CD8-positive, alpha-beta memory T cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000895", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000787", + "s_label": "memory B cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000788", + "s_label": "naive B cell", + "x": "CL:0000842", + "x_label": "mononuclear cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0002420", + "x_label": "immature T cell", + "o": "CL:0002420", + "o_label": "immature T cell", + }, + { + "s": "CL:0002489", + "s_label": "double negative thymocyte", + "x": "CL:0002420", + "x_label": "immature T cell", + "o": "CL:0002420", + "o_label": "immature T cell", + }, + { + "s": "CL:0000809", + "s_label": "double-positive, alpha-beta thymocyte", + "x": "CL:0002420", + "x_label": "immature T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + { + "s": "CL:0002489", + "s_label": "double negative thymocyte", + "x": "CL:0002420", + "x_label": "immature T cell", + "o": "CL:0000842", + "o_label": "mononuclear cell", + }, + ] + + +def get_contextual_enrichment_result(): + return [ + { + "o": "CL:1000504", + "s": "CL:1000597", + "p": "rdfs:subClassOf", + "s_label": "papillary tips cell", + "o_label": "kidney medulla cell", + }, + { + "o": "CL:1000617", + "s": "CL:1000597", + "p": "rdfs:subClassOf", + "s_label": "papillary tips cell", + "o_label": "kidney inner medulla cell", + }, + { + "o": "CL:1000504", + "s": "CL:1001107", + "p": "rdfs:subClassOf", + "s_label": "kidney loop of Henle thin ascending limb epithelial cell", + "o_label": "kidney medulla cell", + }, + { + "o": "CL:1000504", + "s": "CL:1001108", + "p": "rdfs:subClassOf", + "s_label": "kidney loop of Henle medullary thick ascending limb epithelial cell", + "o_label": "kidney medulla cell", + }, + { + "o": "CL:1000504", + "s": "CL:1001111", + "p": "rdfs:subClassOf", + "s_label": "kidney loop of Henle thin descending limb epithelial cell", + "o_label": "kidney medulla cell", + }, + { + "o": "CL:1000616", + "s": "CL:1001108", + "p": "rdfs:subClassOf", + "s_label": "kidney loop of Henle medullary thick ascending limb epithelial cell", + "o_label": "kidney outer medulla cell", + }, + { + "o": "CL:1000616", + "s": "CL:1001111", + "p": "rdfs:subClassOf", + "s_label": "kidney loop of Henle thin descending limb epithelial cell", + "o_label": "kidney outer medulla cell", + }, + { + "o": "CL:1000617", + "s": "CL:1001107", + "p": "rdfs:subClassOf", + "s_label": "kidney loop of Henle thin ascending limb epithelial cell", + "o_label": "kidney inner medulla cell", + }, + { + "o": "CL:1001106", + "s": "CL:1001108", + "p": "rdfs:subClassOf", + "s_label": "kidney loop of Henle medullary thick ascending limb epithelial cell", + "o_label": "kidney loop of Henle thick ascending limb epithelial cell", + }, + ] + + +def get_context_members_result(): + return [ + {"context": "UBERON:0000362", "term": "CL:1000504", "label": "kidney medulla cell"}, + {"context": "UBERON:0000362", "term": "CL:1000546", "label": "kidney medulla collecting duct epithelial cell"}, + { + "context": "UBERON:0000362", + "term": "CL:1000547", + "label": "kidney inner medulla collecting duct epithelial cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:1000548", + "label": "kidney outer medulla collecting duct epithelial cell", + }, + {"context": "UBERON:0000362", "term": "CL:1000597", "label": "papillary tips cell"}, + {"context": "UBERON:0000362", "term": "CL:1000616", "label": "kidney outer medulla cell"}, + {"context": "UBERON:0000362", "term": "CL:1000617", "label": "kidney inner medulla cell"}, + {"context": "UBERON:0000362", "term": "CL:1000682", "label": "kidney medulla interstitial cell"}, + { + "context": "UBERON:0000362", + "term": "CL:1000716", + "label": "kidney outer medulla collecting duct principal cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:1000717", + "label": "kidney outer medulla collecting duct intercalated cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:1000718", + "label": "kidney inner medulla collecting duct principal cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:1000719", + "label": "kidney inner medulla collecting duct intercalated cell", + }, + {"context": "UBERON:0000362", "term": "CL:1000803", "label": "kidney inner medulla interstitial cell"}, + {"context": "UBERON:0000362", "term": "CL:1000804", "label": "kidney outer medulla interstitial cell"}, + {"context": "UBERON:0000362", "term": "CL:1000839", "label": "kidney proximal straight tubule epithelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1000854", "label": "kidney blood vessel cell"}, + {"context": "UBERON:0000362", "term": "CL:1000891", "label": "kidney arterial blood vessel cell"}, + {"context": "UBERON:0000362", "term": "CL:1000892", "label": "kidney capillary endothelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1000893", "label": "kidney venous blood vessel cell"}, + {"context": "UBERON:0000362", "term": "CL:1001005", "label": "glomerular capillary endothelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1001006", "label": "kidney afferent arteriole cell"}, + {"context": "UBERON:0000362", "term": "CL:1001009", "label": "kidney efferent arteriole cell"}, + {"context": "UBERON:0000362", "term": "CL:1001033", "label": "peritubular capillary endothelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1001036", "label": "vasa recta cell"}, + {"context": "UBERON:0000362", "term": "CL:1001045", "label": "kidney cortex artery cell"}, + {"context": "UBERON:0000362", "term": "CL:1001052", "label": "kidney cortex vein cell"}, + {"context": "UBERON:0000362", "term": "CL:1001064", "label": "kidney artery smooth muscle cell"}, + {"context": "UBERON:0000362", "term": "CL:1001066", "label": "kidney arteriole smooth muscle cell"}, + {"context": "UBERON:0000362", "term": "CL:1001068", "label": "kidney venous system smooth muscle cell"}, + {"context": "UBERON:0000362", "term": "CL:1001096", "label": "kidney afferent arteriole endothelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1001097", "label": "kidney afferent arteriole smooth muscle cell"}, + {"context": "UBERON:0000362", "term": "CL:1001099", "label": "kidney efferent arteriole endothelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1001100", "label": "kidney efferent arteriole smooth muscle cell"}, + { + "context": "UBERON:0000362", + "term": "CL:1001106", + "label": "kidney loop of Henle thick ascending limb epithelial cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:1001107", + "label": "kidney loop of Henle thin ascending limb epithelial cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:1001108", + "label": "kidney loop of Henle medullary thick ascending limb epithelial cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:1001109", + "label": "kidney loop of Henle cortical thick ascending limb epithelial cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:1001111", + "label": "kidney loop of Henle thin descending limb epithelial cell", + }, + {"context": "UBERON:0000362", "term": "CL:1001123", "label": "kidney outer medulla peritubular capillary cell"}, + {"context": "UBERON:0000362", "term": "CL:1001124", "label": "kidney cortex peritubular capillary cell"}, + {"context": "UBERON:0000362", "term": "CL:1001126", "label": "inner renal medulla vasa recta cell"}, + {"context": "UBERON:0000362", "term": "CL:1001127", "label": "outer renal medulla vasa recta cell"}, + {"context": "UBERON:0000362", "term": "CL:1001131", "label": "vasa recta ascending limb cell"}, + {"context": "UBERON:0000362", "term": "CL:1001135", "label": "arcuate artery cell"}, + {"context": "UBERON:0000362", "term": "CL:1001138", "label": "interlobular artery cell"}, + {"context": "UBERON:0000362", "term": "CL:1001142", "label": "arcuate vein cell"}, + {"context": "UBERON:0000362", "term": "CL:1001145", "label": "interlobular vein cell"}, + {"context": "UBERON:0000362", "term": "CL:1001209", "label": "inner medulla vasa recta ascending limb cell"}, + {"context": "UBERON:0000362", "term": "CL:1001210", "label": "outer medulla vasa recta ascending limb cell"}, + {"context": "UBERON:0000362", "term": "CL:1001213", "label": "arcuate artery endothelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1001214", "label": "arcuate artery smooth muscle cell"}, + {"context": "UBERON:0000362", "term": "CL:1001216", "label": "interlobulary artery endothelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1001217", "label": "interlobulary artery smooth muscle cell"}, + {"context": "UBERON:0000362", "term": "CL:1001220", "label": "arcuate vein endothelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1001221", "label": "arcuate vein smooth muscle cell"}, + {"context": "UBERON:0000362", "term": "CL:1001223", "label": "interlobulary vein endothelial cell"}, + {"context": "UBERON:0000362", "term": "CL:1001224", "label": "interlobulary vein smooth muscle cell"}, + {"context": "UBERON:0000362", "term": "CL:1001285", "label": "vasa recta descending limb cell"}, + {"context": "UBERON:0000362", "term": "CL:1001286", "label": "inner medulla vasa recta descending limb cell"}, + {"context": "UBERON:0000362", "term": "CL:1001287", "label": "outer medulla vasa recta descending limb cell"}, + { + "context": "UBERON:0000362", + "term": "CL:4030012", + "label": "kidney loop of Henle short descending thin limb epithelial cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:4030013", + "label": "kidney loop of Henle long descending thin limb outer medulla epithelial cell", + }, + { + "context": "UBERON:0000362", + "term": "CL:4030014", + "label": "kidney loop of Henle long descending thin limb inner medulla epithelial cell", + }, + {"context": "UBERON:0000362", "term": "CL:4030022", "label": "renal medullary fibroblast"}, + {"context": "UBERON:0000362", "term": "UBERON:0001290", "label": "proximal straight tubule"}, + {"context": "UBERON:0000362", "term": "UBERON:0001293", "label": "outer medulla of kidney"}, + {"context": "UBERON:0000362", "term": "UBERON:0001294", "label": "inner medulla of kidney"}, + {"context": "UBERON:0000362", "term": "UBERON:0004193", "label": "loop of Henle ascending limb thin segment"}, + {"context": "UBERON:0000362", "term": "UBERON:0004204", "label": "outer medullary collecting duct"}, + {"context": "UBERON:0000362", "term": "UBERON:0004205", "label": "inner medullary collecting duct"}, + {"context": "UBERON:0000362", "term": "UBERON:0004775", "label": "outer renal medulla vasa recta"}, + {"context": "UBERON:0000362", "term": "UBERON:0004776", "label": "inner renal medulla vasa recta"}, + {"context": "UBERON:0000362", "term": "UBERON:0005185", "label": "renal medulla collecting duct"}, + {"context": "UBERON:0000362", "term": "UBERON:0005211", "label": "renal medulla interstitium"}, + {"context": "UBERON:0000362", "term": "UBERON:0005213", "label": "outer renal medulla interstitium"}, + {"context": "UBERON:0000362", "term": "UBERON:0005214", "label": "inner renal medulla interstitium"}, + {"context": "UBERON:0000362", "term": "UBERON:0006341", "label": "outer renal medulla peritubular capillary"}, + {"context": "UBERON:0000362", "term": "UBERON:0006376", "label": "premacula segment of distal straight tubule"}, + {"context": "UBERON:0000362", "term": "UBERON:0009089", "label": "inner medulla vasa recta descending limb"}, + {"context": "UBERON:0000362", "term": "UBERON:0009090", "label": "outer medulla vasa recta descending limb"}, + {"context": "UBERON:0000362", "term": "UBERON:0009092", "label": "inner medulla vasa recta ascending limb"}, + {"context": "UBERON:0000362", "term": "UBERON:0009093", "label": "outer medulla vasa recta ascending limb"}, + {"context": "UBERON:0000362", "term": "UBERON:0009095", "label": "tip of renal papilla"}, + {"context": "UBERON:0000362", "term": "UBERON:0004200", "label": "kidney pyramid"}, + {"context": "UBERON:0000362", "term": "UBERON:0004201", "label": "kidney outer medulla inner stripe"}, + {"context": "UBERON:0000362", "term": "UBERON:0004202", "label": "kidney outer medulla outer stripe"}, + {"context": "UBERON:0000362", "term": "UBERON:0005111", "label": "metanephric pyramid"}, + {"context": "UBERON:0000362", "term": "UBERON:0005114", "label": "metanephric ascending thin limb"}, + {"context": "UBERON:0000362", "term": "UBERON:0005125", "label": "metanephric proximal straight tubule"}, + {"context": "UBERON:0000362", "term": "UBERON:0001228", "label": "renal papilla"}, + {"context": "UBERON:0000362", "term": "UBERON:0006542", "label": "outer medulla outer stripe loop of Henle"}, + {"context": "UBERON:0000362", "term": "UBERON:0003455", "label": "inner renal medulla loop of Henle"}, + {"context": "UBERON:0000362", "term": "UBERON:0006541", "label": "outer medulla inner stripe loop of Henle"}, + {"context": "UBERON:0000362", "term": "UBERON:0009622", "label": "pronephric proximal straight tubule"}, + {"context": "UBERON:0000362", "term": "UBERON:0018119", "label": "left renal medulla interstitium"}, + {"context": "UBERON:0000362", "term": "UBERON:0018120", "label": "right renal medulla interstitium"}, + {"context": "UBERON:0000362", "term": "UBERON:0034996", "label": "outer renal medulla loop of Henle"}, + {"context": "UBERON:0000362", "term": "UBERON:0034997", "label": "renal medulla loop of Henle"}, + ] + + +def get_ancestor_enrichment_result(): + return [ + { + "o": "CL:0000893", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", + "o_label": "thymocyte", + }, + { + "o": "CL:0002420", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", + "o_label": "immature T cell", + }, + { + "o": "CL:0000145", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "professional antigen presenting cell", + }, + { + "o": "CL:0000145", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "professional antigen presenting cell", + }, + {"o": "CL:0000542", "s": "CL:0000084", "p": "rdfs:subClassOf", "s_label": "T cell", "o_label": "lymphocyte"}, + { + "o": "CL:0000542", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "lymphocyte", + }, + { + "o": "CL:0000542", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "lymphocyte", + }, + { + "o": "CL:0000785", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "mature B cell", + }, + { + "o": "CL:0000785", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "mature B cell", + }, + { + "o": "CL:0000842", + "s": "CL:0000084", + "p": "rdfs:subClassOf", + "s_label": "T cell", + "o_label": "mononuclear cell", + }, + { + "o": "CL:0000842", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "mononuclear cell", + }, + { + "o": "CL:0000842", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "mononuclear cell", + }, + { + "o": "CL:0000945", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "lymphocyte of B lineage", + }, + { + "o": "CL:0000945", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "lymphocyte of B lineage", + }, + { + "o": "CL:0001201", + "s": "CL:0000787", + "p": "rdfs:subClassOf", + "s_label": "memory B cell", + "o_label": "B cell, CD19-positive", + }, + { + "o": "CL:0001201", + "s": "CL:0000788", + "p": "rdfs:subClassOf", + "s_label": "naive B cell", + "o_label": "B cell, CD19-positive", + }, + { + "o": "CL:0000084", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "T cell", + }, + { + "o": "CL:0000084", + "s": "CL:0000940", + "p": "rdfs:subClassOf", + "s_label": "mucosal invariant T cell", + "o_label": "T cell", + }, + { + "o": "CL:0000084", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", + "o_label": "T cell", + }, + { + "o": "CL:0000145", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", + "o_label": "professional antigen presenting cell", + }, + { + "o": "CL:0000542", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "lymphocyte", + }, + { + "o": "CL:0000542", + "s": "CL:0000940", + "p": "rdfs:subClassOf", + "s_label": "mucosal invariant T cell", + "o_label": "lymphocyte", + }, + { + "o": "CL:0000542", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", + "o_label": "lymphocyte", + }, + { + "o": "CL:0000542", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", + "o_label": "lymphocyte", + }, + { + "o": "CL:0000785", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", + "o_label": "mature B cell", + }, + { + "o": "CL:0000789", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "alpha-beta T cell", + }, + { + "o": "CL:0000789", + "s": "CL:0000940", + "p": "rdfs:subClassOf", + "s_label": "mucosal invariant T cell", + "o_label": "alpha-beta T cell", + }, + { + "o": "CL:0000791", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "mature alpha-beta T cell", + }, + { + "o": "CL:0000791", + "s": "CL:0000940", + "p": "rdfs:subClassOf", + "s_label": "mucosal invariant T cell", + "o_label": "mature alpha-beta T cell", + }, + { + "o": "CL:0000813", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "memory T cell", + }, + { + "o": "CL:0000842", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "mononuclear cell", + }, + { + "o": "CL:0000842", + "s": "CL:0000940", + "p": "rdfs:subClassOf", + "s_label": "mucosal invariant T cell", + "o_label": "mononuclear cell", + }, + { + "o": "CL:0000842", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", + "o_label": "mononuclear cell", + }, + { + "o": "CL:0000842", + "s": "CL:0002489", + "p": "rdfs:subClassOf", + "s_label": "double negative thymocyte", + "o_label": "mononuclear cell", + }, + { + "o": "CL:0000945", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", + "o_label": "lymphocyte of B lineage", + }, + { + "o": "CL:0000946", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", + "o_label": "antibody secreting cell", + }, + { + "o": "CL:0001201", + "s": "CL:0000980", + "p": "rdfs:subClassOf", + "s_label": "plasmablast", + "o_label": "B cell, CD19-positive", + }, + { + "o": "CL:0002419", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "mature T cell", + }, + { + "o": "CL:0002419", + "s": "CL:0000940", + "p": "rdfs:subClassOf", + "s_label": "mucosal invariant T cell", + "o_label": "mature T cell", + }, + { + "o": "CL:0000084", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "T cell", + }, + { + "o": "CL:0000084", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "T cell", + }, + { + "o": "CL:0000084", + "s": "CL:0000900", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "T cell", + }, + { + "o": "CL:0000542", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "lymphocyte", + }, + { + "o": "CL:0000542", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "lymphocyte", + }, + { + "o": "CL:0000542", + "s": "CL:0000900", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "lymphocyte", + }, + { + "o": "CL:0000624", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "CD4-positive, alpha-beta T cell", + }, + { + "o": "CL:0000624", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "CD4-positive, alpha-beta T cell", + }, + { + "o": "CL:0000625", + "s": "CL:0000900", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "CD8-positive, alpha-beta T cell", + }, + { + "o": "CL:0000625", + "s": "CL:0000909", + "p": "rdfs:subClassOf", + "s_label": "CD8-positive, alpha-beta memory T cell", + "o_label": "CD8-positive, alpha-beta T cell", + }, + { + "o": "CL:0000789", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "alpha-beta T cell", + }, + { + "o": "CL:0000789", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "alpha-beta T cell", + }, + { + "o": "CL:0000789", + "s": "CL:0000900", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "alpha-beta T cell", + }, + { + "o": "CL:0000791", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "mature alpha-beta T cell", + }, + { + "o": "CL:0000791", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "mature alpha-beta T cell", + }, + { + "o": "CL:0000791", + "s": "CL:0000900", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "mature alpha-beta T cell", + }, + { + "o": "CL:0000813", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "memory T cell", + }, + { + "o": "CL:0000842", + "s": "CL:0000895", + "p": "rdfs:subClassOf", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "mononuclear cell", + }, + { "o": "CL:0000842", + "s": "CL:0000897", + "p": "rdfs:subClassOf", + "s_label": "CD4-positive, alpha-beta memory T cell", "o_label": "mononuclear cell", }, - ] - - -def get_contextual_enrichment_result(): - return [ { - "o": "CL:1000504", - "s": "CL:1000597", + "o": "CL:0000842", + "s": "CL:0000900", "p": "rdfs:subClassOf", - "s_label": "papillary tips cell", - "o_label": "kidney medulla cell", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "mononuclear cell", }, { - "o": "CL:1000617", - "s": "CL:1000597", + "o": "CL:0000898", + "s": "CL:0000895", "p": "rdfs:subClassOf", - "s_label": "papillary tips cell", - "o_label": "kidney inner medulla cell", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "naive T cell", }, { - "o": "CL:1000504", - "s": "CL:1001107", + "o": "CL:0000898", + "s": "CL:0000900", "p": "rdfs:subClassOf", - "s_label": "kidney loop of Henle thin ascending limb epithelial cell", - "o_label": "kidney medulla cell", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "naive T cell", }, { - "o": "CL:1000504", - "s": "CL:1001108", + "o": "CL:0002419", + "s": "CL:0000895", "p": "rdfs:subClassOf", - "s_label": "kidney loop of Henle medullary thick ascending limb epithelial cell", - "o_label": "kidney medulla cell", + "s_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + "o_label": "mature T cell", }, { - "o": "CL:1000504", - "s": "CL:1001111", + "o": "CL:0002419", + "s": "CL:0000897", "p": "rdfs:subClassOf", - "s_label": "kidney loop of Henle thin descending limb epithelial cell", - "o_label": "kidney medulla cell", + "s_label": "CD4-positive, alpha-beta memory T cell", + "o_label": "mature T cell", }, { - "o": "CL:1000616", - "s": "CL:1001108", + "o": "CL:0002419", + "s": "CL:0000900", "p": "rdfs:subClassOf", - "s_label": "kidney loop of Henle medullary thick ascending limb epithelial cell", - "o_label": "kidney outer medulla cell", + "s_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + "o_label": "mature T cell", }, { - "o": "CL:1000616", - "s": "CL:1001111", + "o": "CL:0000084", + "s": "CL:0000798", "p": "rdfs:subClassOf", - "s_label": "kidney loop of Henle thin descending limb epithelial cell", - "o_label": "kidney outer medulla cell", + "s_label": "gamma-delta T cell", + "o_label": "T cell", }, { - "o": "CL:1000617", - "s": "CL:1001107", + "o": "CL:0000084", + "s": "CL:0000809", "p": "rdfs:subClassOf", - "s_label": "kidney loop of Henle thin ascending limb epithelial cell", - "o_label": "kidney inner medulla cell", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "T cell", }, + {"o": "CL:0000084", "s": "CL:0000813", "p": "rdfs:subClassOf", "s_label": "memory T cell", "o_label": "T cell"}, { - "o": "CL:1001106", - "s": "CL:1001108", + "o": "CL:0000084", + "s": "CL:0000815", "p": "rdfs:subClassOf", - "s_label": "kidney loop of Henle medullary thick ascending limb epithelial cell", - "o_label": "kidney loop of Henle thick ascending limb epithelial cell", + "s_label": "regulatory T cell", + "o_label": "T cell", }, - ] - - -def get_context_members_result(): - return [ - {"context": "UBERON:0000362", "term": "CL:1000504", "label": "kidney medulla cell"}, - {"context": "UBERON:0000362", "term": "CL:1000546", "label": "kidney medulla collecting duct epithelial cell"}, { - "context": "UBERON:0000362", - "term": "CL:1000547", - "label": "kidney inner medulla collecting duct epithelial cell", + "o": "CL:0000542", + "s": "CL:0000798", + "p": "rdfs:subClassOf", + "s_label": "gamma-delta T cell", + "o_label": "lymphocyte", }, { - "context": "UBERON:0000362", - "term": "CL:1000548", - "label": "kidney outer medulla collecting duct epithelial cell", + "o": "CL:0000542", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "lymphocyte", }, - {"context": "UBERON:0000362", "term": "CL:1000597", "label": "papillary tips cell"}, - {"context": "UBERON:0000362", "term": "CL:1000616", "label": "kidney outer medulla cell"}, - {"context": "UBERON:0000362", "term": "CL:1000617", "label": "kidney inner medulla cell"}, - {"context": "UBERON:0000362", "term": "CL:1000682", "label": "kidney medulla interstitial cell"}, { - "context": "UBERON:0000362", - "term": "CL:1000716", - "label": "kidney outer medulla collecting duct principal cell", + "o": "CL:0000542", + "s": "CL:0000813", + "p": "rdfs:subClassOf", + "s_label": "memory T cell", + "o_label": "lymphocyte", }, { - "context": "UBERON:0000362", - "term": "CL:1000717", - "label": "kidney outer medulla collecting duct intercalated cell", + "o": "CL:0000542", + "s": "CL:0000815", + "p": "rdfs:subClassOf", + "s_label": "regulatory T cell", + "o_label": "lymphocyte", }, { - "context": "UBERON:0000362", - "term": "CL:1000718", - "label": "kidney inner medulla collecting duct principal cell", + "o": "CL:0000789", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "alpha-beta T cell", }, { - "context": "UBERON:0000362", - "term": "CL:1000719", - "label": "kidney inner medulla collecting duct intercalated cell", + "o": "CL:0000790", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "immature alpha-beta T cell", }, - {"context": "UBERON:0000362", "term": "CL:1000803", "label": "kidney inner medulla interstitial cell"}, - {"context": "UBERON:0000362", "term": "CL:1000804", "label": "kidney outer medulla interstitial cell"}, - {"context": "UBERON:0000362", "term": "CL:1000839", "label": "kidney proximal straight tubule epithelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1000854", "label": "kidney blood vessel cell"}, - {"context": "UBERON:0000362", "term": "CL:1000891", "label": "kidney arterial blood vessel cell"}, - {"context": "UBERON:0000362", "term": "CL:1000892", "label": "kidney capillary endothelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1000893", "label": "kidney venous blood vessel cell"}, - {"context": "UBERON:0000362", "term": "CL:1001005", "label": "glomerular capillary endothelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1001006", "label": "kidney afferent arteriole cell"}, - {"context": "UBERON:0000362", "term": "CL:1001009", "label": "kidney efferent arteriole cell"}, - {"context": "UBERON:0000362", "term": "CL:1001033", "label": "peritubular capillary endothelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1001036", "label": "vasa recta cell"}, - {"context": "UBERON:0000362", "term": "CL:1001045", "label": "kidney cortex artery cell"}, - {"context": "UBERON:0000362", "term": "CL:1001052", "label": "kidney cortex vein cell"}, - {"context": "UBERON:0000362", "term": "CL:1001064", "label": "kidney artery smooth muscle cell"}, - {"context": "UBERON:0000362", "term": "CL:1001066", "label": "kidney arteriole smooth muscle cell"}, - {"context": "UBERON:0000362", "term": "CL:1001068", "label": "kidney venous system smooth muscle cell"}, - {"context": "UBERON:0000362", "term": "CL:1001096", "label": "kidney afferent arteriole endothelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1001097", "label": "kidney afferent arteriole smooth muscle cell"}, - {"context": "UBERON:0000362", "term": "CL:1001099", "label": "kidney efferent arteriole endothelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1001100", "label": "kidney efferent arteriole smooth muscle cell"}, { - "context": "UBERON:0000362", - "term": "CL:1001106", - "label": "kidney loop of Henle thick ascending limb epithelial cell", + "o": "CL:0000842", + "s": "CL:0000798", + "p": "rdfs:subClassOf", + "s_label": "gamma-delta T cell", + "o_label": "mononuclear cell", }, { - "context": "UBERON:0000362", - "term": "CL:1001107", - "label": "kidney loop of Henle thin ascending limb epithelial cell", + "o": "CL:0000842", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "mononuclear cell", }, { - "context": "UBERON:0000362", - "term": "CL:1001108", - "label": "kidney loop of Henle medullary thick ascending limb epithelial cell", + "o": "CL:0000842", + "s": "CL:0000813", + "p": "rdfs:subClassOf", + "s_label": "memory T cell", + "o_label": "mononuclear cell", }, { - "context": "UBERON:0000362", - "term": "CL:1001109", - "label": "kidney loop of Henle cortical thick ascending limb epithelial cell", + "o": "CL:0000842", + "s": "CL:0000815", + "p": "rdfs:subClassOf", + "s_label": "regulatory T cell", + "o_label": "mononuclear cell", }, { - "context": "UBERON:0000362", - "term": "CL:1001111", - "label": "kidney loop of Henle thin descending limb epithelial cell", + "o": "CL:0000893", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "thymocyte", }, - {"context": "UBERON:0000362", "term": "CL:1001123", "label": "kidney outer medulla peritubular capillary cell"}, - {"context": "UBERON:0000362", "term": "CL:1001124", "label": "kidney cortex peritubular capillary cell"}, - {"context": "UBERON:0000362", "term": "CL:1001126", "label": "inner renal medulla vasa recta cell"}, - {"context": "UBERON:0000362", "term": "CL:1001127", "label": "outer renal medulla vasa recta cell"}, - {"context": "UBERON:0000362", "term": "CL:1001131", "label": "vasa recta ascending limb cell"}, - {"context": "UBERON:0000362", "term": "CL:1001135", "label": "arcuate artery cell"}, - {"context": "UBERON:0000362", "term": "CL:1001138", "label": "interlobular artery cell"}, - {"context": "UBERON:0000362", "term": "CL:1001142", "label": "arcuate vein cell"}, - {"context": "UBERON:0000362", "term": "CL:1001145", "label": "interlobular vein cell"}, - {"context": "UBERON:0000362", "term": "CL:1001209", "label": "inner medulla vasa recta ascending limb cell"}, - {"context": "UBERON:0000362", "term": "CL:1001210", "label": "outer medulla vasa recta ascending limb cell"}, - {"context": "UBERON:0000362", "term": "CL:1001213", "label": "arcuate artery endothelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1001214", "label": "arcuate artery smooth muscle cell"}, - {"context": "UBERON:0000362", "term": "CL:1001216", "label": "interlobulary artery endothelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1001217", "label": "interlobulary artery smooth muscle cell"}, - {"context": "UBERON:0000362", "term": "CL:1001220", "label": "arcuate vein endothelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1001221", "label": "arcuate vein smooth muscle cell"}, - {"context": "UBERON:0000362", "term": "CL:1001223", "label": "interlobulary vein endothelial cell"}, - {"context": "UBERON:0000362", "term": "CL:1001224", "label": "interlobulary vein smooth muscle cell"}, - {"context": "UBERON:0000362", "term": "CL:1001285", "label": "vasa recta descending limb cell"}, - {"context": "UBERON:0000362", "term": "CL:1001286", "label": "inner medulla vasa recta descending limb cell"}, - {"context": "UBERON:0000362", "term": "CL:1001287", "label": "outer medulla vasa recta descending limb cell"}, { - "context": "UBERON:0000362", - "term": "CL:4030012", - "label": "kidney loop of Henle short descending thin limb epithelial cell", + "o": "CL:0002419", + "s": "CL:0000813", + "p": "rdfs:subClassOf", + "s_label": "memory T cell", + "o_label": "mature T cell", }, { - "context": "UBERON:0000362", - "term": "CL:4030013", - "label": "kidney loop of Henle long descending thin limb outer medulla epithelial cell", + "o": "CL:0002419", + "s": "CL:0000815", + "p": "rdfs:subClassOf", + "s_label": "regulatory T cell", + "o_label": "mature T cell", }, { - "context": "UBERON:0000362", - "term": "CL:4030014", - "label": "kidney loop of Henle long descending thin limb inner medulla epithelial cell", + "o": "CL:0002420", + "s": "CL:0000809", + "p": "rdfs:subClassOf", + "s_label": "double-positive, alpha-beta thymocyte", + "o_label": "immature T cell", }, - {"context": "UBERON:0000362", "term": "CL:4030022", "label": "renal medullary fibroblast"}, - {"context": "UBERON:0000362", "term": "UBERON:0001290", "label": "proximal straight tubule"}, - {"context": "UBERON:0000362", "term": "UBERON:0001293", "label": "outer medulla of kidney"}, - {"context": "UBERON:0000362", "term": "UBERON:0001294", "label": "inner medulla of kidney"}, - {"context": "UBERON:0000362", "term": "UBERON:0004193", "label": "loop of Henle ascending limb thin segment"}, - {"context": "UBERON:0000362", "term": "UBERON:0004204", "label": "outer medullary collecting duct"}, - {"context": "UBERON:0000362", "term": "UBERON:0004205", "label": "inner medullary collecting duct"}, - {"context": "UBERON:0000362", "term": "UBERON:0004775", "label": "outer renal medulla vasa recta"}, - {"context": "UBERON:0000362", "term": "UBERON:0004776", "label": "inner renal medulla vasa recta"}, - {"context": "UBERON:0000362", "term": "UBERON:0005185", "label": "renal medulla collecting duct"}, - {"context": "UBERON:0000362", "term": "UBERON:0005211", "label": "renal medulla interstitium"}, - {"context": "UBERON:0000362", "term": "UBERON:0005213", "label": "outer renal medulla interstitium"}, - {"context": "UBERON:0000362", "term": "UBERON:0005214", "label": "inner renal medulla interstitium"}, - {"context": "UBERON:0000362", "term": "UBERON:0006341", "label": "outer renal medulla peritubular capillary"}, - {"context": "UBERON:0000362", "term": "UBERON:0006376", "label": "premacula segment of distal straight tubule"}, - {"context": "UBERON:0000362", "term": "UBERON:0009089", "label": "inner medulla vasa recta descending limb"}, - {"context": "UBERON:0000362", "term": "UBERON:0009090", "label": "outer medulla vasa recta descending limb"}, - {"context": "UBERON:0000362", "term": "UBERON:0009092", "label": "inner medulla vasa recta ascending limb"}, - {"context": "UBERON:0000362", "term": "UBERON:0009093", "label": "outer medulla vasa recta ascending limb"}, - {"context": "UBERON:0000362", "term": "UBERON:0009095", "label": "tip of renal papilla"}, - {"context": "UBERON:0000362", "term": "UBERON:0004200", "label": "kidney pyramid"}, - {"context": "UBERON:0000362", "term": "UBERON:0004201", "label": "kidney outer medulla inner stripe"}, - {"context": "UBERON:0000362", "term": "UBERON:0004202", "label": "kidney outer medulla outer stripe"}, - {"context": "UBERON:0000362", "term": "UBERON:0005111", "label": "metanephric pyramid"}, - {"context": "UBERON:0000362", "term": "UBERON:0005114", "label": "metanephric ascending thin limb"}, - {"context": "UBERON:0000362", "term": "UBERON:0005125", "label": "metanephric proximal straight tubule"}, - {"context": "UBERON:0000362", "term": "UBERON:0001228", "label": "renal papilla"}, - {"context": "UBERON:0000362", "term": "UBERON:0006542", "label": "outer medulla outer stripe loop of Henle"}, - {"context": "UBERON:0000362", "term": "UBERON:0003455", "label": "inner renal medulla loop of Henle"}, - {"context": "UBERON:0000362", "term": "UBERON:0006541", "label": "outer medulla inner stripe loop of Henle"}, - {"context": "UBERON:0000362", "term": "UBERON:0009622", "label": "pronephric proximal straight tubule"}, - {"context": "UBERON:0000362", "term": "UBERON:0018119", "label": "left renal medulla interstitium"}, - {"context": "UBERON:0000362", "term": "UBERON:0018120", "label": "right renal medulla interstitium"}, - {"context": "UBERON:0000362", "term": "UBERON:0034996", "label": "outer renal medulla loop of Henle"}, - {"context": "UBERON:0000362", "term": "UBERON:0034997", "label": "renal medulla loop of Henle"}, + ] + + +def get_ancestor_object_list(): + return [ + {"s": "CL:0000813", "o0": "CL:0002419", "o1": "CL:0000084"}, + {"s": "CL:0000815", "o0": "CL:0002419", "o1": "CL:0000084"}, + {"s": "CL:0000787", "o0": "CL:0000785", "o1": "CL:0000145"}, + {"s": "CL:0000788", "o0": "CL:0000785", "o1": "CL:0000145"}, + {"s": "CL:0000980", "o0": "CL:0000785", "o1": "CL:0000145"}, + {"s": "CL:0000798", "o0": "CL:0000084", "o1": "CL:0000542"}, + {"s": "CL:0000809", "o0": "CL:0000790", "o1": "CL:0000789"}, + {"s": "CL:0000940", "o0": "CL:0000791", "o1": "CL:0000789"}, + {"s": "CL:0000895", "o0": "CL:0000624", "o1": "CL:0000791"}, + {"s": "CL:0000897", "o0": "CL:0000624", "o1": "CL:0000791"}, + {"s": "CL:0000900", "o0": "CL:0000625", "o1": "CL:0000791"}, + {"s": "CL:0000909", "o0": "CL:0000625", "o1": "CL:0000791"}, + {"s": "CL:0000084", "o0": "CL:0000542", "o1": "CL:0000842"}, + {"s": "CL:0000980", "o0": "CL:0000946", "o1": "CL:0000945"}, + {"s": "CL:0000787", "o0": "CL:0000785", "o1": "CL:0001201"}, + {"s": "CL:0000788", "o0": "CL:0000785", "o1": "CL:0001201"}, + {"s": "CL:0000980", "o0": "CL:0000785", "o1": "CL:0001201"}, + {"s": "CL:0000940", "o0": "CL:0000791", "o1": "CL:0002419"}, + {"s": "CL:0000897", "o0": "CL:0000813", "o1": "CL:0002419"}, + {"s": "CL:0000909", "o0": "CL:0000813", "o1": "CL:0002419"}, + {"s": "CL:0000895", "o0": "CL:0000898", "o1": "CL:0002419"}, + {"s": "CL:0000900", "o0": "CL:0000898", "o1": "CL:0002419"}, + {"s": "CL:0000809", "o0": "CL:0000790", "o1": "CL:0002420"}, + {"s": "CL:0000809", "o0": "CL:0000893", "o1": "CL:0002420"}, + {"s": "CL:0002489", "o0": "CL:0000893", "o1": "CL:0002420"}, ] From 7fc4fdf4b0b61c8488a82a039277205db7d64e93 Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 18:55:46 +0100 Subject: [PATCH 07/12] Fixed import order --- test/test_query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_query.py b/test/test_query.py index 471e388..1765c35 100644 --- a/test/test_query.py +++ b/test/test_query.py @@ -1,7 +1,7 @@ from test.data.query_data import ( get_ancestor_enrichment_data, - get_ancestor_object_list, get_ancestor_enrichment_result, + get_ancestor_object_list, get_blood_and_immune_test_data, get_context_list, get_context_members_result, From 9b30a28a86546494da357e6d7b25c7e87e54d1ad Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 18:58:34 +0100 Subject: [PATCH 08/12] Updated test_get_ancestor_enrichment_query --- test/utils/test_sparql_queries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/test_sparql_queries.py b/test/utils/test_sparql_queries.py index 75da017..1005aa0 100644 --- a/test/utils/test_sparql_queries.py +++ b/test/utils/test_sparql_queries.py @@ -85,7 +85,7 @@ def test_get_ancestor_enrichment_query(): "GRAPH { ?o0 rdfs:isDefinedBy . " "?o1 rdfs:isDefinedBy . " "?o2 rdfs:isDefinedBy . " - "?o3 rdfs:isDefinedBy . }}" + "?o3 rdfs:isDefinedBy . }} #LIMIT" ) assert get_ancestor_enrichment_query(term_iri_list, 4) == expected_n4_query assert "o6" in get_ancestor_enrichment_query(term_iri_list, 7) From 4d5ab994d076acee6602c3d01120d45b4d3b498e Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 19:00:50 +0100 Subject: [PATCH 09/12] Removed unnecessary f-string --- pandasaurus/utils/sparql_queries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandasaurus/utils/sparql_queries.py b/pandasaurus/utils/sparql_queries.py index 247f7b7..a875904 100644 --- a/pandasaurus/utils/sparql_queries.py +++ b/pandasaurus/utils/sparql_queries.py @@ -49,7 +49,7 @@ def get_label_query(term_iri_list: List[str]) -> str: def get_ancestor_enrichment_query(seed_list: List[str], step_count) -> str: query = "SELECT * WHERE { GRAPH " query += f"{{ VALUES ?s {{{' '.join(seed_list)} }} " - query += f"?s rdfs:subClassOf ?o0. " + query += "?s rdfs:subClassOf ?o0. " defined_by = ( "GRAPH { ?o0 rdfs:isDefinedBy " ". " From 8c30cc178692710db17766be83c81c76dab80eda Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 22:42:24 +0100 Subject: [PATCH 10/12] Minor refactoring in query.py --- pandasaurus/query.py | 64 +++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/pandasaurus/query.py b/pandasaurus/query.py index e984436..91fcf52 100644 --- a/pandasaurus/query.py +++ b/pandasaurus/query.py @@ -48,15 +48,15 @@ def __init__( """ # Might be unnecessary - self.__seed_list = seed_list - self.__enrichment_property_list = enrichment_property_list if enrichment_property_list else ["rdfs:subClassOf"] - self.__term_list: List[Term] = CurieValidator.construct_term_list(seed_list) + self._seed_list = seed_list + self._enrichment_property_list = enrichment_property_list if enrichment_property_list else ["rdfs:subClassOf"] + self._term_list: List[Term] = CurieValidator.construct_term_list(seed_list) self.enriched_df = pd.DataFrame() self.graph_df = pd.DataFrame() self.graph = Graph() # Validation and reporting try: - CurieValidator.get_validation_report(self.__term_list) + CurieValidator.get_validation_report(self._term_list) except InvalidTerm as e: print(e.message) if force_fail: @@ -77,9 +77,9 @@ def simple_enrichment(self) -> pd.DataFrame: Enriched DataFrame """ - source_list = [term.get_iri() for term in self.__term_list] - object_list = [term.get_iri() for term in self.__term_list] - query_string = get_simple_enrichment_query(source_list, object_list, self.__enrichment_property_list) + source_list = [term.get_iri() for term in self._term_list] + object_list = [term.get_iri() for term in self._term_list] + query_string = get_simple_enrichment_query(source_list, object_list, self._enrichment_property_list) self.enriched_df = ( pd.DataFrame( [res for res in run_sparql_query(query_string)], @@ -88,9 +88,7 @@ def simple_enrichment(self) -> pd.DataFrame: .sort_values("s") .reset_index(drop=True) ) - self.mirror_enrichment_for_graph_generation(object_list) - self.graph = GraphGenerator.generate_enrichment_graph(self.graph_df) - self.graph = GraphGenerator.apply_transitive_reduction(self.graph, self.graph_df["p"].unique().tolist()) + self._generate_enrichment_graph(object_list) return self.enriched_df @@ -106,7 +104,7 @@ def minimal_slim_enrichment(self, slim_list: List[str]) -> pd.DataFrame: Enriched DataFrame """ - source_list = [term.get_iri() for term in self.__term_list] + source_list = [term.get_iri() for term in self._term_list] object_list = source_list + SlimManager.get_slim_members(slim_list) s_result = [] for chunk in chunks(object_list, 90): @@ -114,7 +112,7 @@ def minimal_slim_enrichment(self, slim_list: List[str]) -> pd.DataFrame: [ res for res in run_sparql_query( - get_simple_enrichment_query(source_list, chunk, self.__enrichment_property_list) + get_simple_enrichment_query(source_list, chunk, self._enrichment_property_list) ) ] ) @@ -123,9 +121,7 @@ def minimal_slim_enrichment(self, slim_list: List[str]) -> pd.DataFrame: .sort_values("s") .reset_index(drop=True) ) - self.mirror_enrichment_for_graph_generation(object_list) - self.graph = GraphGenerator.generate_enrichment_graph(self.graph_df) - self.graph = GraphGenerator.apply_transitive_reduction(self.graph, self.enriched_df["p"].unique().tolist()) + self._generate_enrichment_graph(object_list) return self.enriched_df @@ -142,7 +138,7 @@ def full_slim_enrichment(self, slim_list: List[str]) -> pd.DataFrame: Enriched DataFrame """ - source_list = [term.get_iri() for term in self.__term_list] + source_list = [term.get_iri() for term in self._term_list] object_list = source_list + SlimManager.get_slim_members(slim_list) s_result = [] for chunk in chunks(object_list, 90): @@ -155,9 +151,7 @@ def full_slim_enrichment(self, slim_list: List[str]) -> pd.DataFrame: .sort_values("s") .reset_index(drop=True) ) - self.mirror_enrichment_for_graph_generation(object_list) - self.graph = GraphGenerator.generate_enrichment_graph(self.graph_df) - self.graph = GraphGenerator.apply_transitive_reduction(self.graph, self.enriched_df["p"].unique().tolist()) + self._generate_enrichment_graph(object_list) return self.enriched_df @@ -176,7 +170,7 @@ def contextual_slim_enrichment(self, context: List[str]) -> pd.DataFrame: """ # TODO add a curie checking mechanism for context list query_string = get_contextual_enrichment_query(context) - source_list = [term.get_iri() for term in self.__term_list] + source_list = [term.get_iri() for term in self._term_list] object_list = source_list + [res.get("term") for res in run_sparql_query(query_string)] s_result = [] for chunk in chunks(object_list, 90): @@ -184,7 +178,7 @@ def contextual_slim_enrichment(self, context: List[str]) -> pd.DataFrame: [ res for res in run_sparql_query( - get_simple_enrichment_query(source_list, chunk, self.__enrichment_property_list) + get_simple_enrichment_query(source_list, chunk, self._enrichment_property_list) ) ] ) @@ -194,14 +188,12 @@ def contextual_slim_enrichment(self, context: List[str]) -> pd.DataFrame: .sort_values("s") .reset_index(drop=True) ) - self.mirror_enrichment_for_graph_generation(object_list) - self.graph = GraphGenerator.generate_enrichment_graph(self.graph_df) - self.graph = GraphGenerator.apply_transitive_reduction(self.graph, self.enriched_df["p"].unique().tolist()) + self._generate_enrichment_graph(object_list) return self.enriched_df def ancestor_enrichment(self, step_count: str) -> pd.DataFrame: - source_list = [term.get_iri() for term in self.__term_list] + source_list = [term.get_iri() for term in self._term_list] query_string = get_ancestor_enrichment_query(source_list, step_count) object_list = list(set(uri for res in run_sparql_query(query_string) for uri in res.values())) s_result = [] @@ -210,7 +202,7 @@ def ancestor_enrichment(self, step_count: str) -> pd.DataFrame: [ res for res in run_sparql_query( - get_simple_enrichment_query(source_list, chunk, self.__enrichment_property_list) + get_simple_enrichment_query(source_list, chunk, self._enrichment_property_list) ) ] ) @@ -220,9 +212,7 @@ def ancestor_enrichment(self, step_count: str) -> pd.DataFrame: .sort_values("s") .reset_index(drop=True) ) - self.mirror_enrichment_for_graph_generation(object_list) - self.graph = GraphGenerator.generate_enrichment_graph(self.graph_df) - self.graph = GraphGenerator.apply_transitive_reduction(self.graph, self.enriched_df["p"].unique().tolist()) + self._generate_enrichment_graph(object_list) return self.enriched_df @@ -234,7 +224,7 @@ def synonym_lookup(self) -> pd.DataFrame: """ label_df = pd.DataFrame( - {term.get_iri(): term.get_label() for term in self.__term_list}.items(), columns=["ID", "label"] + {term.get_iri(): term.get_label() for term in self._term_list}.items(), columns=["ID", "label"] ) synonym_query_results = run_sparql_query(get_synonym_query(label_df["ID"].tolist())) @@ -269,7 +259,7 @@ def get_most_specific_objects(self, predicate: str, ontology: str): Returns: """ - subject_list = [term.get_iri() for term in self.__term_list] + subject_list = [term.get_iri() for term in self._term_list] query_string = get_most_specific_objects_query(subject_list, predicate, ontology) return ( pd.DataFrame( @@ -295,7 +285,7 @@ def get_most_specific_subjects(self, predicate: str, ontology: str): Returns: """ - object_list = [term.get_iri() for term in self.__term_list] + object_list = [term.get_iri() for term in self._term_list] query_string = get_most_specific_subjects_query(object_list, predicate, ontology) return ( pd.DataFrame( @@ -324,7 +314,7 @@ def query(self, column_name: str, query_term: str) -> pd.DataFrame: def update_obsoleted_terms(self): """Replaces all obsoleted terms in the term list with the new term that obsoletes them.""" - [getattr(term, "update_obsoleted_term")() for term in self.__term_list] + [getattr(term, "update_obsoleted_term")() for term in self._term_list] def mirror_enrichment_for_graph_generation(self, term_list: List[str]): # TODO definitely need a refactoring later on @@ -335,7 +325,7 @@ def mirror_enrichment_for_graph_generation(self, term_list: List[str]): [ res for res in run_sparql_query( - get_simple_enrichment_query(s_chunk, o_chunk, self.__enrichment_property_list) + get_simple_enrichment_query(s_chunk, o_chunk, self._enrichment_property_list) ) ] ) @@ -344,3 +334,9 @@ def mirror_enrichment_for_graph_generation(self, term_list: List[str]): .sort_values("s") .reset_index(drop=True) ) + + def _generate_enrichment_graph(self, object_list): + self.mirror_enrichment_for_graph_generation(object_list) + self.graph = GraphGenerator.generate_enrichment_graph(self.graph_df) + self.graph = GraphGenerator.apply_transitive_reduction(self.graph, self.enriched_df["p"].unique().tolist()) + # self.graph = GraphGenerator.apply_transitive_reduction(self.graph, self.graph_df["p"].unique().tolist())ş From 6da9dfe6faee5f566e1a201f7c66d93208b0475d Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 22:42:59 +0100 Subject: [PATCH 11/12] Added new cases for get_most_specific_objects and get_most_specific_subjects --- test/data/query_data.py | 663 ++++++++++++++++++++++++++++++ test/test_query.py | 54 ++- test/utils/test_sparql_queries.py | 26 ++ 3 files changed, 742 insertions(+), 1 deletion(-) diff --git a/test/data/query_data.py b/test/data/query_data.py index 8bac8be..70d9bcc 100644 --- a/test/data/query_data.py +++ b/test/data/query_data.py @@ -4161,3 +4161,666 @@ def get_synonym_lookup_result(): {"s": "CL:0000815"}, {"s": "CL:0000900"}, ] + + +def get_most_specific_objects_result(): + return [ + {"s": "CL:0000084"}, + {"s": "CL:0000813"}, + {"s": "CL:0000815"}, + {"s": "CL:0000900", "narrow_synonym": "T.8Nve.Sp"}, + {"s": "CL:0000084", "exact_synonym": "T lymphocyte"}, + {"s": "CL:0000084", "exact_synonym": "T-cell"}, + {"s": "CL:0000084", "exact_synonym": "T-lymphocyte"}, + {"s": "CL:0000813", "exact_synonym": "memory T lymphocyte"}, + {"s": "CL:0000813", "exact_synonym": "memory T-cell"}, + {"s": "CL:0000813", "exact_synonym": "memory T-lymphocyte"}, + {"s": "CL:0000815", "exact_synonym": "regulatory T lymphocyte"}, + {"s": "CL:0000815", "exact_synonym": "regulatory T-cell"}, + {"s": "CL:0000815", "exact_synonym": "regulatory T-lymphocyte"}, + {"s": "CL:0000815", "exact_synonym": "Treg"}, + {"s": "CL:0000900", "exact_synonym": "naive thymus-dervied CD8-positive, alpha-beta T lymphocyte"}, + {"s": "CL:0000900", "exact_synonym": "naive thymus-dervied CD8-positive, alpha-beta T-cell"}, + {"s": "CL:0000900", "exact_synonym": "naive thymus-dervied CD8-positive, alpha-beta T-lymphocyte"}, + {"s": "CL:0000084"}, + {"s": "CL:0000813"}, + {"s": "CL:0000815", "broad_synonym": "suppressor T cell"}, + {"s": "CL:0000815", "broad_synonym": "suppressor T lymphocyte"}, + {"s": "CL:0000815", "broad_synonym": "suppressor T-cell"}, + {"s": "CL:0000815", "broad_synonym": "suppressor T-lymphocyte"}, + {"s": "CL:0000900", "broad_synonym": "naive CD8+ T cell"}, + {"s": "CL:0000084", "related_synonym": "immature T cell"}, + {"s": "CL:0000084", "related_synonym": "mature T cell"}, + {"s": "CL:0000813"}, + {"s": "CL:0000815"}, + {"s": "CL:0000900"}, + ] + + +def get_most_specific_subjects_result(): + return [ + { + "s": "CL:0000492", + "s_label": "CD4-positive helper T cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000545", + "s_label": "T-helper 1 cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000546", + "s_label": "T-helper 2 cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000793", + "s_label": "CD4-positive, alpha-beta intraepithelial T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000810", + "s_label": "CD4-positive, alpha-beta thymocyte", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000811", + "s_label": "CD8-positive, alpha-beta thymocyte", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000814", + "s_label": "mature NK T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000903", + "s_label": "natural T-regulatory cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000914", + "s_label": "immature NK T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000915", + "s_label": "CD8-alpha-alpha-positive, alpha-beta intraepithelial T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000921", + "s_label": "type I NK T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000922", + "s_label": "type II NK T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000923", + "s_label": "CD4-positive type I NK T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000924", + "s_label": "CD4-negative, CD8-negative type I NK T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000925", + "s_label": "activated CD4-positive type I NK T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000926", + "s_label": "CD4-positive type I NK T cell secreting interferon-gamma", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000927", + "s_label": "CD4-positive type I NK T cell secreting interleukin-4", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000928", + "s_label": "activated CD4-negative, CD8-negative type I NK T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000929", + "s_label": "CD4-negative, CD8-negative type I NK T cell secreting interferon-gamma", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000930", + "s_label": "CD4-negative, CD8-negative type I NK T cell secreting interleukin-4", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000931", + "s_label": "activated type II NK T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000932", + "s_label": "type II NK T cell secreting interferon-gamma", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0000933", + "s_label": "type II NK T cell secreting interleukin-4", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0002037", + "s_label": "CD2-positive, CD5-positive, CD44-positive alpha-beta intraepithelial T cell", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0002039", + "s_label": "immature NK T cell stage I", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0002040", + "s_label": "immature NK T cell stage II", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0002041", + "s_label": "immature NK T cell stage III", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + { + "s": "CL:0002042", + "s_label": "immature NK T cell stage IV", + "p": "RO:0002202", + "o": "CL:0000809", + "o_label": "double-positive, alpha-beta thymocyte", + }, + {"s": "CL:0000786", "s_label": "plasma cell", "p": "RO:0002202", "o": "CL:0000980", "o_label": "plasmablast"}, + { + "s": "CL:0000794", + "s_label": "CD8-positive, alpha-beta cytotoxic T cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0000896", + "s_label": "activated CD4-positive, alpha-beta T cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000899", + "s_label": "T-helper 17 cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000901", + "s_label": "Tr1 cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000902", + "s_label": "induced T-regulatory cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000904", + "s_label": "central memory CD4-positive, alpha-beta T cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000905", + "s_label": "effector memory CD4-positive, alpha-beta T cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000906", + "s_label": "activated CD8-positive, alpha-beta T cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0000907", + "s_label": "central memory CD8-positive, alpha-beta T cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0000908", + "s_label": "CD8-positive, alpha-beta cytokine secreting effector T cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0000913", + "s_label": "effector memory CD8-positive, alpha-beta T cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0000917", + "s_label": "Tc1 cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0000918", + "s_label": "Tc2 cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0000919", + "s_label": "CD8-positive, CD25-positive, alpha-beta regulatory T cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0000920", + "s_label": "CD8-positive, CD28-negative, alpha-beta regulatory T cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0000934", + "s_label": "CD4-positive, alpha-beta cytotoxic T cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0000947", + "s_label": "IgE plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000948", + "s_label": "IgE memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000951", + "s_label": "IgE short lived plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000970", + "s_label": "unswitched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000972", + "s_label": "class switched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000973", + "s_label": "IgA memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000974", + "s_label": "long lived plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000975", + "s_label": "short lived plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000976", + "s_label": "IgA short lived plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000977", + "s_label": "IgG short lived plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000978", + "s_label": "IgM short lived plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000979", + "s_label": "IgG memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000985", + "s_label": "IgG plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000986", + "s_label": "IgM plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0000987", + "s_label": "IgA plasma cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0001042", + "s_label": "T-helper 22 cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0001043", + "s_label": "activated CD4-positive, alpha-beta T cell, human", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0001049", + "s_label": "activated CD8-positive, alpha-beta T cell, human", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0001062", + "s_label": "effector memory CD8-positive, alpha-beta T cell, terminally differentiated", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0001087", + "s_label": "effector memory CD4-positive, alpha-beta T cell, terminally differentiated", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0001203", + "s_label": "CD8-positive, alpha-beta memory T cell, CD45RO-positive", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0001204", + "s_label": "CD4-positive, alpha-beta memory T cell, CD45RO-positive", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0002038", + "s_label": "T follicular helper cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0002061", + "s_label": "T-helper 9 cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + { + "s": "CL:0002105", + "s_label": "CD38-positive IgG memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002106", + "s_label": "IgD-positive CD38-positive IgG memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002107", + "s_label": "IgD-negative CD38-positive IgG memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002108", + "s_label": "CD38-negative IgG memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002111", + "s_label": "CD38-negative unswitched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002112", + "s_label": "B220-positive CD38-negative unswitched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002113", + "s_label": "B220-low CD38-negative unswitched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002114", + "s_label": "CD38-positive unswitched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002115", + "s_label": "B220-positive CD38-positive unswitched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002116", + "s_label": "B220-low CD38-positive unswitched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002117", + "s_label": "IgG-negative class switched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002118", + "s_label": "CD38-negative IgG-negative class switched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002119", + "s_label": "CD38-positive IgG-negative class switched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002120", + "s_label": "CD24-positive CD38-negative IgG-negative class switched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002121", + "s_label": "CD24-negative CD38-negative IgG-negative class switched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002122", + "s_label": "B220-positive CD38-positive IgG-negative class switched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002123", + "s_label": "B220-low CD38-positive IgG-negative class switched memory B cell", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0002128", + "s_label": "Tc17 cell", + "p": "RO:0002202", + "o": "CL:0000900", + "o_label": "naive thymus-derived CD8-positive, alpha-beta T cell", + }, + { + "s": "CL:0009033", + "s_label": "plasma cell of appendix", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0009059", + "s_label": "plasma cell of medullary sinus of lymph node", + "p": "RO:0002202", + "o": "CL:0000980", + "o_label": "plasmablast", + }, + { + "s": "CL:0009062", + "s_label": "germinal center T cell", + "p": "RO:0002202", + "o": "CL:0000895", + "o_label": "naive thymus-derived CD4-positive, alpha-beta T cell", + }, + ] diff --git a/test/test_query.py b/test/test_query.py index 1765c35..8fa7ed8 100644 --- a/test/test_query.py +++ b/test/test_query.py @@ -14,6 +14,8 @@ get_kidney_test_data, get_minimal_enrichment_data, get_minimal_enrichment_result, + get_most_specific_objects_result, + get_most_specific_subjects_result, get_simple_enrichment_data, get_simple_enrichment_result, get_synonym_lookup_data, @@ -310,4 +312,54 @@ def test_update_obsoleted_terms(): ] q = Query(seed_list) q.update_obsoleted_terms() - assert [str(term) for term in q._Query__term_list] == expected_update_obsoleted_terms + assert [str(term) for term in q._term_list] == expected_update_obsoleted_terms + + +def test_get_most_specific_objects(mocker): + seed_list = get_blood_and_immune_test_data() + expected_df = ( + pd.DataFrame( + get_most_specific_objects_result(), + columns=["s", "s_label", "p", "o", "o_label"], + ) + .sort_values("s") + .reset_index(drop=True) + ) + + mocker.patch( + "pandasaurus.query.run_sparql_query", + side_effect=[ + iter(get_most_specific_objects_result()), + ], + ) + + q = Query(seed_list) + result_df = q.get_most_specific_objects("RO:0002215", "http://purl.obolibrary.org/obo/cl.owl") + + assert expected_df["s"].reset_index(drop=True).equals(result_df["s"].reset_index(drop=True)) + assert expected_df["o"].reset_index(drop=True).equals(result_df["o"].reset_index(drop=True)) + + +def test_get_most_specific_subjects(mocker): + seed_list = get_blood_and_immune_test_data() + expected_df = ( + pd.DataFrame( + get_most_specific_subjects_result(), + columns=["s", "s_label", "p", "o", "o_label"], + ) + .sort_values("s") + .reset_index(drop=True) + ) + + mocker.patch( + "pandasaurus.query.run_sparql_query", + side_effect=[ + iter(get_most_specific_subjects_result()), + ], + ) + + q = Query(seed_list) + result_df = q.get_most_specific_subjects("RO:0002215", "http://purl.obolibrary.org/obo/cl.owl") + + assert expected_df["s"].reset_index(drop=True).equals(result_df["s"].reset_index(drop=True)) + assert expected_df["o"].reset_index(drop=True).equals(result_df["o"].reset_index(drop=True)) diff --git a/test/utils/test_sparql_queries.py b/test/utils/test_sparql_queries.py index 1005aa0..b22f5ab 100644 --- a/test/utils/test_sparql_queries.py +++ b/test/utils/test_sparql_queries.py @@ -1,8 +1,12 @@ +from test.data.query_data import get_blood_and_immune_test_data + from pandasaurus.utils.sparql_queries import ( get_ancestor_enrichment_query, get_contextual_enrichment_query, get_full_enrichment_query, get_label_query, + get_most_specific_objects_query, + get_most_specific_subjects_query, get_replaced_by_query, get_simple_enrichment_query, get_slim_list_query, @@ -145,3 +149,25 @@ def test_get_slim_members_query(): ) assert query == expected_query + + +def test_get_most_specific_objects_query(): + assert ( + len( + get_most_specific_objects_query( + get_blood_and_immune_test_data(), "RO:0002215", "http://purl.obolibrary.org/obo/cl.owl" + ) + ) + == 703 + ) + + +def test_get_most_specific_subjects_query(): + assert ( + len( + get_most_specific_subjects_query( + get_blood_and_immune_test_data(), "RO:0002215", "http://purl.obolibrary.org/obo/cl.owl" + ) + ) + == 706 + ) From abce05047def22f6c7faa000a105e315a28a3495 Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Mon, 11 Sep 2023 22:50:01 +0100 Subject: [PATCH 12/12] Added parent_enrichment and docstrings for parent_enrichment and ancestor_enrichment --- pandasaurus/query.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/pandasaurus/query.py b/pandasaurus/query.py index 91fcf52..481a381 100644 --- a/pandasaurus/query.py +++ b/pandasaurus/query.py @@ -193,6 +193,25 @@ def contextual_slim_enrichment(self, context: List[str]) -> pd.DataFrame: return self.enriched_df def ancestor_enrichment(self, step_count: str) -> pd.DataFrame: + """ + Perform ancestor enrichment analysis with a specified number of hops. + + Args: + step_count (str): The number of hops to consider when enriching terms. + + Returns: + pd.DataFrame: A DataFrame containing enriched terms and associated information. + + This method conducts an ancestor enrichment analysis on a set of seed terms, + considering the specified number of hops in the ontology graph. The analysis + retrieves terms that are ancestors of the seed terms within the specified + number of hops and compiles the results into a DataFrame. + + The `step_count` parameter controls the depth of the analysis. A smaller + `step_count` limits the analysis to immediate ancestors, while a larger value + includes more distant ancestors. + + """ source_list = [term.get_iri() for term in self._term_list] query_string = get_ancestor_enrichment_query(source_list, step_count) object_list = list(set(uri for res in run_sparql_query(query_string) for uri in res.values())) @@ -216,6 +235,26 @@ def ancestor_enrichment(self, step_count: str) -> pd.DataFrame: return self.enriched_df + def parent_enrichment(self): + """ + Perform parent enrichment analysis. + + This method is a convenience wrapper around the `ancestor_enrichment` method, + specifically designed to perform parent enrichment analysis. Parent enrichment + analysis considers only immediate parent terms of the seed terms in the ontology + graph (i.e., one-hop ancestors). + + Returns: + pd.DataFrame: A DataFrame containing enriched parent terms and associated + information. + + This method simplifies the process of conducting parent enrichment analysis by + calling the `ancestor_enrichment` method with a `step_count` of 1, which limits + the analysis to immediate parent terms of the seed terms. + + """ + self.ancestor_enrichment(1) + def synonym_lookup(self) -> pd.DataFrame: """